ci(release): integrate release-please for automated semantic versioning#1093
ci(release): integrate release-please for automated semantic versioning#1093rhysmcneill wants to merge 3 commits intoschollz:mainfrom
Conversation
… versioning for release assets
|
how does this work? |
Did you see the workflow diagram at the top of my description - It shows how it works. Essentially, if a contributor creates a PR the title must follow the following format It is a pretty simple workflow to follow - Would you like me to crate a
You just need to review the PR, and make the adjustments that I outlined in the description. Afterwards, merge the PR and then from now on we will have automated release workflow. Of course, you have the final say on when a release happens since all you need to do is merge the release-please PR, which then triggers the build and publish for the artifacts.
I dont understand what you mean by this - Release-please will create tags for each release in the format of Let me know if you need any further explanation / context - Happy to explain things further, or even jump on a call to discuss it. Thanks! |
Closes #1092
Summary
This PR implements the release-please integration proposed in #1092, automating version determination, changelog generation, and release asset publishing for croc.
What this adds
.github/workflows/release-please.ymlrelease-please-config.jsonrelease-type: go, bootstrapped fromv10.4.2).release-please-manifest.json10.4.2— prevents any version regression.github/workflows/release.ymlworkflow_dispatchinput for manual use.github/workflows/pr-title.ymlHow the release flow works
The maintainer retains full control — no release ships without an explicit merge.
All existing downstream workflows remain untouched
deploy.yml(Docker multi-arch) andwinget.yml(Windows Package Manager) both trigger onrelease: types: [created]— they will continue to work exactly as today, fired by the release that release-please creates.Maintainer prerequisites before merging
Before merging this PR, a few one-time repo settings changes are needed for release-please to work correctly. None of these require code changes.
1. Tag protection rule for
v*release-please creates and pushes tags like
v10.4.3directly. Without a tag protection rule, anyone with write access can push or delete release tags.Settings -> Rules -> New ruleset:
v*github-actions[bot](so release-please can push the tag)2. Squash merging only (required for changelog)
release-please reads commit messages on
mainto determine the next version and generateCHANGELOG.md. It is mandatory that only squash merging is allowed. Squash merging ensures the PR title (whichpr-title.ymlenforces to be a valid Conventional Commit) becomes the single commit onmain, giving clean and accurate changelogs. Merge commits and rebase merging must be disabled — if they are left enabled, noisy or non-conventional commits from PR branches will land onmainand corrupt the changelog and version logic.Settings -> General -> Pull Requests:
3. GitHub Actions permissions
release-please needs to open PRs and create releases.
Settings -> Actions -> General -> Workflow permissions:
4. Adopt Conventional Commits (gradual)
The
pr-title.ymlworkflow added in this PR enforces Conventional Commit format on PR titles. This can be introduced gradually — existing contributors will be prompted by the CI check.Key prefixes and their effect on versioning:
fix:— patch bump (e.g.v10.4.2->v10.4.3)feat:— minor bump (e.g.v10.4.2->v10.5.0)feat!:orBREAKING CHANGE:in body — major bump (e.g.v10.4.2->v11.0.0)chore:,docs:,ci:,refactor:,test:— no version bump (included in changelog only)5.
GITHUB_TOKENpermissions (already covered)The
release-please.ymlworkflow declarescontents: write,issues: write, andpull-requests: write— no additional secrets or tokens are required beyond the defaultGITHUB_TOKEN.Testing
I have tested this workflow on my own fork (rhysmcneill/croc) and the release-please action runs correctly — the Release PR is created with the right version bump and changelog entries. A full end-to-end test (i.e. merging the Release PR and validating the published artifacts) is not possible in isolation, as it would result in releasing actual build artifacts from a fork.
Test plan
fix:orfeat:PR tomain— release-please will open a Release PR within secondsCHANGELOG.mdcontent)If any issues arise when merged then ping me and we can look at it, however, as I outlined above, this works on my fork but I could not verify the release artifacts triggered since it would release genuine croc artifacts from a fork