feat(ci): bake CalVer version into released binaries (#4)
## Summary
- Add `build.rs` that runs `git describe --tags --always` and sets `ANVIL_VERSION` at compile time
- Clap reads `ANVIL_VERSION` for `--version` output instead of `CARGO_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
- [x] Local build without tags → reports git SHA
- [x] Local build with tag → reports tag
- [x] fmt, clippy, tests pass
- [ ] CI publishes release with version-stamped binary
SHA:
45992034a3b55690328f40d455f072e0357dcbf7
Author:
Anvil <noreply@anvil.fangorn.io>
Date:
2026-04-12 17:27
Parents:
9ff9d8e
5 files changed
+56
-18
| Type | ||
|---|---|---|
|
|
.anvil.yml | +1 −1 |
|
||
|
|
build.rs | +26 −0 |
|
||