Use cabal to build binary release #422
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: ['pull_request', 'push'] | |
jobs: | |
build: | |
name: Build on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest] | |
ghc: ["9.6.2"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('*.cabal') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.ghc }}-v1- | |
- run: make build | |
- run: make test | |
- if: startsWith(github.ref, 'refs/tags') | |
run: make artifact | |
- uses: actions/upload-artifact@v4 | |
if: startsWith(github.ref, 'refs/tags') | |
with: | |
path: artifacts/* | |
name: artifacts-${{ runner.os }} | |
release: | |
name: Release | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: artifacts-* | |
- run: ls -R | |
- run: 'sha256sum artifacts-*/*' | |
- uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: 'artifacts-*/stylish-haskell-*' |