feat(release): record the release version for Nix in the tagged commit #124
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/release-nix-version"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A flake cannot read Git tags, so
nix profile install …?ref=refs/tags/wraptool-vX.Y.Zreporteddevel+<commit>instead of the release version. This makes the release script record the version where the flake can see it.How it works
release-versionbuilds a release commit on top ofmainthat addsnix/release-version(containing e.g.0.11.0) and signs the tag on that commit. It uses a temporaryGIT_INDEX_FILE+commit-tree, so the working tree and current branch are untouched, and pushes only the tag —mainnever receives the commit. It refuses to run ifnix/release-versionexists onmain.--dry-runcreates the commit object (no refs) and prints it.flake.nixpicks the version in order:WRAPTOOL_VERSION(impure) →nix/release-version→devel+<short-sha>[-dirty].lint.yml: release tags are no longer reachable frommain, sogit describe --abbrev=0onmainwould stay at 0.10.0 forever. The SonarQubeprojectVersionnow comes from the newestwraptool-v*tag by version sort.publish-binaries.ymlneeds no change: it checks out the tag, checksrev-list -n1 tag == HEAD, and uses an exact-match describe.releases.qmd(script behaviour; the tag stays the only version source, the file is a copy written from it),contributing.qmd(version precedence table),installation.qmd(Nix version note), CHANGELOGUnreleased.Trade-off to be aware of
The Forgejo release, and
git describeonmain, now see the tag as offmain's history. The release commit differs frommainonly by the one file, which nothing but Nix reads, so the binaries are identical.Verified
test-release-version.sh(runs in CI) gains three cases, all passing:main, and leavesmainand the tree untouched;--yesrelease against a throwaway remote (the gpg stub now fakes-bsausigning): annotated tag pushed, tag commit holds the file and is a child ofmain, remotemainunchanged;main.HEADinstead of the release commit makes the suite fail.main-like commit →devel+ce5f73ddf7c7; commit withnix/release-version=9.9.9→9.9.9, and the built binary printswraptool 9.9.9;WRAPTOOL_VERSION=1.0.0still wins../release-version.quarto rendernot run.🤖 Generated with Claude Code