Skip to content

Conversation

@BowTiedRadone
Copy link

@BowTiedRadone BowTiedRadone commented Sep 11, 2025

This PR adds a GitHub Actions workflow to automate the release process for the Hedgehog library. Key features:

  • Builds and packages the Hedgehog library using the latest GHC and cabal-install via GHCup.
  • Uses cabal sdist to generate the tarball matching maintainer/Hackage requirements.
  • Checks the package with cabal check before upload.
  • Uploads the tarball to Hackage using a repository secret (HACKAGE_TOKEN).
  • Only triggers on new tags.

Notes

The workflow expects a valid HACKAGE_TOKEN secret to be set in the repository for Hackage uploads. The tarball creation logic is designed to match the official Hackage release process as closely as possible.

Considerations

The new workflow's output was tested locally using act and diff-checked agains the latest official Hackage release. This PR should be merged after one of the maintainers can confirm the HACKAGE_TOKEN secret addition.

- name: Upload to Hackage
run: cabal upload --publish hedgehog-${GITHUB_REF_NAME}.tar.gz
env:
HACKAGE_TOKEN: ${{ secrets.HACKAGE_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Author

Choose a reason for hiding this comment

The 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.

@moodmosaic
Copy link
Member

Thank you @BowTiedRadone!

We can simplify the workflow by using cabal sdist, and speed up the checkout by doing a shallow clone (fetch-depth: 1).

@BowTiedRadone BowTiedRadone marked this pull request as ready for review September 12, 2025 10:21
@BowTiedRadone BowTiedRadone changed the title [DRAFT] Add automated release workflow Add automated release workflow Sep 12, 2025
Co-authored-by: Nikos Baxevanis <[email protected]>
@BowTiedRadone
Copy link
Author

I think the last discussion item for this PR is the fact that it uses ubuntu-22.04, while #558 just updated haskell-ci workflow to use ubuntu-24.04. Should we update this workflow to use ubuntu-24.04 as well?

@moodmosaic
Copy link
Member

I think the last discussion item for this PR is the fact that it uses ubuntu-22.04, while #558 just updated haskell-ci workflow to use ubuntu-24.04. Should we update this workflow to use ubuntu-24.04 as well?

Yes, that's a good point 👍

Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for your contribution! I’m curious to know what @vrom911 and/or @chshersh think (if their time permits). 🙏

Co-authored-by: Nikos Baxevanis <[email protected]>
@moodmosaic
Copy link
Member

@BowTiedRadone, what would be the easiest way to test this?

@BowTiedRadone
Copy link
Author

BowTiedRadone commented Sep 19, 2025

@moodmosaic The easiest would be cutting a test tag (since the workflow does not publish anyway). The other way would be to use https://github.com/nektos/act for local debugging. For the second, I can share the steps if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants