feat(ci): bake CalVer version into released binaries #4
merged
cole.christensen@gmail.com wants to merge
fix/git-safe-directory
into main
No CI
Summary
- Add
build.rsthat runsgit describe --tags --alwaysand setsANVIL_VERSIONat compile time - Clap reads
ANVIL_VERSIONfor--versionoutput instead ofCARGO_PKG_VERSION - CI bootstrap-builds once (to get the anvil binary for release.sh), computes the CalVer version, creates a local git tag, then rebuilds so the version is baked into the released binary
- Dev builds report git SHA (
anvil 9ff9d8e), release builds report CalVer (anvil 2026.04.2)
How it works
The local tag only exists inside the CI container — it never gets pushed. The server-side tag is created by anvil release create --tag $VERSION. No commits to main, no branch protection issues, no CI loops.
Refs #1
Test plan
- Local build without tags → reports git SHA
- Local build with tag → reports tag
- fmt, clippy, tests pass
- CI publishes release with version-stamped binary
Created Apr 12, 2026 at 16:58 UTC
| Merged Apr 12, 2026 at 17:27 UTC
by
cole.christensen@gmail.com