-
Notifications
You must be signed in to change notification settings - Fork 111
Add automated release workflow #559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 7 commits
51d3c5f
cb9f682
2f2fafd
02d4c34
407dd94
8761d0a
580b3d7
c990e94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: Release Hedgehog | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "*" | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Build and Release Hedgehog | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - name: Checkout repository with full history | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Install GHCup | ||
| run: | | ||
| curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org \ | ||
| | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 sh -s -- -y | ||
| echo "$HOME/.ghcup/bin" >> $GITHUB_PATH | ||
| echo "$HOME/.cabal/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Install latest recommended GHC | ||
| run: | | ||
| ghcup install ghc recommended | ||
| ghcup set ghc recommended | ||
|
|
||
| - name: Install latest recommended cabal | ||
| run: | | ||
| ghcup install cabal recommended | ||
| ghcup set cabal recommended | ||
|
|
||
| - name: Cabal update | ||
| run: cabal update | ||
|
|
||
| - name: Build source distribution | ||
| run: cabal sdist hedgehog/hedgehog.cabal | ||
|
|
||
| # If the version in the tag doesn't match the version in the .cabal file, | ||
| # `cabal check` will fail. This ensures they are in sync. | ||
| - name: Check Hedgehog package | ||
| run: | | ||
| VERSION=${GITHUB_REF_NAME} | ||
moodmosaic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| SDIST=$(ls dist-newstyle/sdist/hedgehog-$VERSION.tar.gz) | ||
| tar -xzf "$SDIST" -C /tmp | ||
| cd "/tmp/hedgehog-$VERSION" | ||
| cabal check | ||
moodmosaic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Upload to Hackage | ||
| run: | | ||
| VERSION=${GITHUB_REF_NAME} | ||
| SDIST=$(ls dist-newstyle/sdist/hedgehog-$VERSION.tar.gz) | ||
| cabal upload "$SDIST" | ||
| env: | ||
| HACKAGE_TOKEN: ${{ secrets.HACKAGE_TOKEN }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can generate and add one. Before we do that, we need to make sure that the Actions permissions are set to the minimal needed for each workflow/job, to avoid hijacking.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I recommend this action to at least require an approval from a GitHub account with write access. |
||
Uh oh!
There was an error while loading. Please reload this page.