ghcup-hs/.github/workflows/release.yaml

225 lines
5.9 KiB
YAML
Raw Normal View History

2022-10-20 12:37:50 +00:00
name: Build and release
on:
push:
2022-10-20 12:37:50 +00:00
branches:
- master
tags:
- 'v*'
2022-10-20 12:37:50 +00:00
pull_request:
branches:
- master
jobs:
2022-10-20 12:37:50 +00:00
build:
name: Build binary
runs-on: ${{ matrix.os }}
env:
CABAL_VER: 3.6.2.0
CACHE_VER: 1
MACOSX_DEPLOYMENT_TARGET: 10.13
JSON_VERSION: "0.0.7"
strategy:
matrix:
include:
- os: ubuntu-latest
ARTIFACT: "i386-linux-ghcup"
GHC_VER: 8.10.7
ARCH: 32
- os: ubuntu-latest
ARTIFACT: "x86_64-linux-ghcup"
GHC_VER: 8.10.7
ARCH: 64
- os: [self-hosted, macOS, aarch64]
ARTIFACT: "aarch64-apple-darwin-ghcup"
GHC_VER: 9.2.5
ARCH: ARM64
- os: macOS-10.15
ARTIFACT: "x86_64-apple-darwin-ghcup"
GHC_VER: 9.2.5
ARCH: 64
- os: windows-latest
ARTIFACT: "x86_64-mingw64-ghcup"
GHC_VER: 8.10.7
ARCH: 64
steps:
2022-10-20 12:37:50 +00:00
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'true'
- if: matrix.ARCH == '32' && runner.os == 'Linux'
name: Run build (32 bit linux)
uses: docker://i386/alpine:3.12
with:
args: sh .github/scripts/build.sh
env:
2022-10-20 12:37:50 +00:00
ARTIFACT: ${{ matrix.ARTIFACT }}
ARCH: ${{ matrix.ARCH }}
GHC_VER: ${{ matrix.GHC_VER }}
DISTRO: Alpine
- if: matrix.ARCH == '64' && runner.os == 'Linux'
name: Run build (64 bit linux)
uses: docker://alpine:3.12
with:
2022-10-20 12:37:50 +00:00
args: sh .github/scripts/build.sh
env:
ARTIFACT: ${{ matrix.ARTIFACT }}
ARCH: ${{ matrix.ARCH }}
GHC_VER: ${{ matrix.GHC_VER }}
DISTRO: Alpine
- if: runner.os != 'Linux'
name: Run build (windows/mac)
run: bash .github/scripts/build.sh
env:
ARTIFACT: ${{ matrix.ARTIFACT }}
ARCH: ${{ matrix.ARCH }}
GHC_VER: ${{ matrix.GHC_VER }}
DISTRO: na
- if: always()
name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
./out/*
2022-10-20 12:37:50 +00:00
test:
name: Test
needs: build
runs-on: ${{ matrix.os }}
env:
2022-10-20 12:37:50 +00:00
CABAL_VER: 3.6.2.0
CACHE_VER: 1
MACOSX_DEPLOYMENT_TARGET: 10.13
2022-10-20 12:37:50 +00:00
JSON_VERSION: "0.0.7"
strategy:
matrix:
2022-10-20 12:37:50 +00:00
include:
- os: ubuntu-latest
ARTIFACT: "i386-linux-ghcup"
GHC_VER: 8.10.7
ARCH: 32
DISTRO: Alpine
- os: ubuntu-latest
ARTIFACT: "x86_64-linux-ghcup"
GHC_VER: 8.10.7
ARCH: 64
DISTRO: Alpine
- os: ubuntu-latest
ARTIFACT: "x86_64-linux-ghcup"
GHC_VER: 8.10.7
ARCH: 64
DISTRO: Ubuntu
- os: [self-hosted, macOS, aarch64]
ARTIFACT: "aarch64-apple-darwin-ghcup"
GHC_VER: 9.2.5
ARCH: ARM64
DISTRO: na
- os: macOS-10.15
ARTIFACT: "x86_64-apple-darwin-ghcup"
GHC_VER: 9.2.5
ARCH: 64
DISTRO: na
- os: windows-latest
ARTIFACT: "x86_64-mingw64-ghcup"
GHC_VER: 8.10.7
ARCH: 64
DISTRO: na
steps:
- name: Checkout code
2022-10-20 12:37:50 +00:00
uses: actions/checkout@v3
with:
2022-10-20 12:37:50 +00:00
submodules: 'true'
2022-10-20 12:37:50 +00:00
- uses: actions/download-artifact@v3
with:
name: artifacts
path: ./out
2022-10-20 12:37:50 +00:00
- if: matrix.ARCH == '32' && runner.os == 'Linux' && matrix.DISTRO == 'Alpine'
name: Run build (32 bit linux Alpine)
uses: docker://i386/alpine:3.12
with:
args: sh .github/scripts/test.sh
env:
ARTIFACT: ${{ matrix.ARTIFACT }}
ARCH: ${{ matrix.ARCH }}
GHC_VER: ${{ matrix.GHC_VER }}
DISTRO: ${{ matrix.DISTRO }}
- if: matrix.ARCH == '64' && runner.os == 'Linux' && matrix.DISTRO == 'Alpine'
name: Run build (64 bit linux Alpine)
uses: docker://alpine:3.12
with:
args: sh .github/scripts/test.sh
env:
ARTIFACT: ${{ matrix.ARTIFACT }}
ARCH: ${{ matrix.ARCH }}
GHC_VER: ${{ matrix.GHC_VER }}
DISTRO: ${{ matrix.DISTRO }}
- if: runner.os == 'Linux' && matrix.DISTRO != 'Alpine'
name: Run build (64 bit linux)
run: sh .github/scripts/test.sh
env:
ARTIFACT: ${{ matrix.ARTIFACT }}
ARCH: ${{ matrix.ARCH }}
GHC_VER: ${{ matrix.GHC_VER }}
DISTRO: ${{ matrix.DISTRO }}
- if: runner.os != 'Linux'
name: Run build (windows/mac)
run: bash .github/scripts/test.sh
env:
ARTIFACT: ${{ matrix.ARTIFACT }}
ARCH: ${{ matrix.ARCH }}
GHC_VER: ${{ matrix.GHC_VER }}
DISTRO: ${{ matrix.DISTRO }}
hls:
name: hls
needs: build
runs-on: ubuntu-latest
env:
GHC_VERSION: "8.10.7"
HLS_TARGET_VERSION: "1.8.0.0"
CABAL_VERSION: "3.6.2.0"
JSON_VERSION: "0.0.7"
ARTIFACT: "x86_64-linux-ghcup"
DISTRO: Ubuntu
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'true'
2022-10-20 12:37:50 +00:00
- uses: actions/download-artifact@v3
with:
name: artifacts
path: ./out
2022-10-20 12:37:50 +00:00
- name: Run hls build
run: sh .github/scripts/hls.sh
2022-10-20 12:37:50 +00:00
release:
name: release
needs: [build, test, hls]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
2022-10-20 12:37:50 +00:00
name: artifacts
path: ./out
2022-10-20 12:37:50 +00:00
- name: Release
uses: softprops/action-gh-release@v1
with:
2022-10-20 12:37:50 +00:00
draft: true
files: |
./out/*