-
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 5 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,56 @@ | ||
| 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: | | ||
| mkdir -p "$HOME/.ghcup/bin" | ||
| curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup" | ||
moodmosaic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| chmod a+x "$HOME/.ghcup/bin/ghcup" | ||
|
|
||
| - name: Install GHC | ||
| run: | | ||
| "$HOME/.ghcup/bin/ghcup" install ghc 9.12.2 | ||
| "$HOME/.ghcup/bin/ghcup" set ghc 9.12.2 | ||
moodmosaic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Install cabal-install | ||
| run: | | ||
| "$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 | ||
moodmosaic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| echo "$HOME/.ghcup/bin" >> $GITHUB_PATH | ||
| echo "$HOME/.cabal/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Cabal update | ||
| run: cabal update | ||
|
|
||
| - name: Build source distribution | ||
| run: cabal sdist hedgehog/hedgehog.cabal | ||
|
|
||
| - 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.