This can be used to automate the release process of a Haskell package.
To use this action to automate the release process of your Haskell package you will need to:
- Generate a Hackage Auth Token
- Add the generated Hackage Auth Token to your GitHub repository
- Create a GitHub Actions workflow
By following these three steps you will end up with a GitHub Actions workflow that automates releases.
Specifically, whenever the workflow detects a new version without a corresponding git tag it:
- creates a git tag
- publishes your package to Hackage
- Go to https://hackage.haskell.org/users/account-management
- Sign in with your Hackage credentials
- Generate a new token under Authentication Tokens -> Register new token
- Go to Settings -> Secrets and variables -> Actions -> Repository secrets -> New repository secret
- Use
HACKAGE_AUTH_TOKEN
as Name and the Auth token value as Secret - Click Add secret
# file: .github/workflows/publish.yml
name: publish
permissions:
contents: write
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: sol/haskell-autotag@v1
id: autotag
- run: cabal sdist
- uses: haskell-actions/[email protected]
with:
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
publish: true
if: steps.autotag.outputs.created