Use this sequence when cutting a new release.
- Work from a clean branch tip you intend to release.
- Pick the release tag in advance, for example
v0.7.0.
-
Run release prep.
make release-prep TAG=v0.7.0
This target:
- requires a clean working tree
- runs
go test ./... - generates the changelog entry from the latest existing tag through
HEAD - stages
CHANGELOG.md - creates the release prep commit
-
Review the generated changelog commit.
If you need to edit the release notes, update
CHANGELOG.mdand amend or replace the prep commit before tagging. -
Create the annotated tag on the release commit.
git tag -a v0.7.0 -m "v0.7.0" -
Build release artifacts.
make release
-
Push the release commit and tag.
git push origin main git push origin v0.7.0
-
make changefileprepends a new section toCHANGELOG.md. -
If the target tag already exists in
CHANGELOG.md,make changefile TAG=...exits without modifying the file. -
make release-prep TAG=...fails if the working tree is dirty. -
If you want a custom prep commit message, override
RELEASE_COMMIT_MSG, for example:make release-prep TAG=v0.7.0 RELEASE_COMMIT_MSG="Cut v0.7.0 release" -
The old
make taghelper was removed because tagging is now a deliberate manual step after the changelog commit.