Various Upgrades #126
Workflow file for this run
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: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
release: | |
types: | |
- created | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} | |
strategy: | |
matrix: | |
ghc: ['9.6', '9.4', '9.2'] | |
cabal: ['latest'] | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
exclude: | |
- ghc: 8.10 | |
os: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: mkdir artifact | |
- run: mkdir artifact/${{ matrix.os }} | |
- id: setup-haskell | |
uses: haskell/actions/setup@v2 | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
- run: cabal configure --enable-tests --flags strict --jobs | |
- run: cabal freeze | |
- run: cat cabal.project.freeze | |
- run: cp cabal.project.freeze artifact/${{ matrix.os }} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.setup-haskell.outputs.cabal-store }} | |
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | |
restore-keys: ${{ matrix.os }}-${{ matrix.ghc }}- | |
- run: cabal build | |
- run: cabal test --enable-tests --test-show-details=direct | |
- run: cabal check | |
- run: cabal sdist --output-dir artifact/${{ matrix.os }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: hermes-json-${{ github.sha }} | |
path: artifact | |
release: | |
needs: ci | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: hermes-json-${{ github.sha }} | |
path: artifact | |
- uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
asset_content_type: application/gzip | |
asset_name: hermes-json-${{ github.event.release.tag_name }}.tar.gz | |
asset_path: artifact/ubuntu-latest/hermes-json-${{ github.event.release.tag_name }}.tar.gz | |
upload_url: ${{ github.event.release.upload_url }} | |
- run: cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/ubuntu-latest/hermes-json-${{ github.event.release.tag_name }}.tar.gz |