fangorn/ex_git_objectstore
public
ref:a3f0318b5ae6ee1965cb4b62b2f49b93435d58c3
Add automatic CI-driven release process (#4)
## Summary
- Add CalVer (`YYYY.M.BUILD`) release automation driven by Anvil CI
- Modeled after huorn-minecraft's `ci/release.sh` + `.anvil-ci.yml` pattern
- On every `main` push, after all checks pass: compute version, build, generate changelog, create Anvil release, tag and push
Closes #21
## Changes
- **ci/release.sh** — CalVer version computation from git tags (increment build within month, reset on new month)
- **mix.exs** — Version from `$VERSION` env var, defaults to `"0.0.0-dev"` for local builds
- **.anvil.yml** — New `release` step after compile/format/dialyzer/test, with branch guard and idempotency check
## Release step workflow
1. Guard: skip if not on `main`
2. Compute version via `ci/release.sh`
3. Idempotency: skip if tag already exists
4. Build with `VERSION` env var
5. Generate changelog from `git log` since last tag
6. Build hex package and docs
7. Create Anvil release with changelog
8. Tag commit and push tag
## Test plan
- [x] `ci/release.sh` outputs `2026.4.1` with no existing tags
- [x] `ci/release.sh` increments build within same month (`2026.4.1` -> `2026.4.2`)
- [x] `ci/release.sh` resets build on month change (`2026.3.5` -> `2026.4.1`)
- [x] `mix compile` works without `$VERSION` set (uses `0.0.0-dev`)
- [x] `VERSION=2026.4.1 mix eval 'Mix.Project.config()[:version]'` returns correct version
- [x] All 547 tests pass, dialyzer clean
SHA:
a3f0318b5ae6ee1965cb4b62b2f49b93435d58c3
Author:
Anvil <noreply@anvil.fangorn.io>
Date:
2026-04-09 16:15
Parents:
f3281b6
3 files changed
+82
-1
| Type | ||
|---|---|---|
|
|
.anvil.yml | +54 −0 |
|
||
|
|
mix.exs | +2 −1 |
|
||