This repository has been archived by the owner on Dec 28, 2024. It is now read-only.
Update to latest resolver. Use a token to publish to Hackage rather … #108
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: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: 'Install OS-level packages needed for Monomer' | |
run: sudo apt-get update && sudo apt-get install --assume-yes libsdl2-dev libglew-dev | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
key: stack | |
path: ~/.stack | |
- name: 'Install Stack' | |
uses: haskell-actions/setup@v2 | |
with: | |
stack-setup-ghc: true | |
enable-stack: true | |
- name: 'Check formatting' | |
uses: mrkkrp/ormolu-action@v14 | |
- name: 'Check package metadata' | |
run: cabal check | |
- name: 'Build and test' | |
run: stack test | |
- name: 'Generate package' | |
run: stack sdist | |
- name: 'Archive package' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: package | |
path: .stack-work/dist/*/*/monomer-hagrid-*.tar.gz | |
if-no-files-found: error | |
publish: | |
needs: [build] | |
if: github.ref_type == 'tag' | |
runs-on: ubuntu-24.04 | |
environment: | |
name: hackage | |
url: https://hackage.haskell.org/package/monomer-hagrid | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: package | |
- name: 'Publish Package to Hackage' | |
run: cabal upload "--token=$HACKAGE_TOKEN" --publish */*/*.tar.gz | |
env: | |
HACKAGE_TOKEN: ${{ secrets.HACKAGE_TOKEN }} |