Release v2.1.1 #9
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: Release | |
on: | |
release: | |
types: | |
- published | |
concurrency: | |
group: release-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
hackage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Haskell | |
id: setup-haskell-cabal | |
uses: haskell/actions/setup@v2 | |
with: | |
# I faced the following issue with GHC-9.2 and and I managed to solved | |
# it by going back to GHC-8.10.7 just to generate the docs: | |
# - https://github.com/haskell/cabal/issues/8326 | |
ghc-version: "8.10.7" | |
cabal-version: "3.6" | |
- name: Generate sdist | |
run: cabal sdist | |
- name: Upload candidate package to Hackage | |
env: | |
HACKAGE_API_KEY: ${{ secrets.HACKAGE_API_KEY }} | |
run: | | |
SDIST_PATH=$(ls dist-newstyle/sdist/cassava-megaparsec-*.tar.gz) | |
curl -X POST \ | |
--fail -i \ | |
-H 'Accept: text/plain' \ | |
-H "Authorization: X-ApiKey ${HACKAGE_API_KEY}" \ | |
--form "package=@${SDIST_PATH}" \ | |
"https://hackage.haskell.org/packages/candidates" | |
- name: Generate documentation | |
run: cabal haddock --haddock-for-hackage --enable-documentation | |
- name: Upload Docs for candidate to Hackage | |
env: | |
HACKAGE_API_KEY: ${{ secrets.HACKAGE_API_KEY }} | |
run: |- | |
TAG_VERSION=${{ github.ref_name }} | |
DOCS_PATH=$(ls dist-newstyle/cassava-megaparsec-*-docs.tar.gz) | |
curl -X PUT \ | |
--fail -i \ | |
-H 'Content-Type: application/x-tar' \ | |
-H 'Content-Encoding: gzip' \ | |
-H "Authorization: X-ApiKey ${HACKAGE_API_KEY}" \ | |
--data-binary "@${DOCS_PATH}" \ | |
"https://hackage.haskell.org/package/cassava-megaparsec-$TAG_VERSION/candidate/docs" |