Add automatic CI-driven release process #4

closed colechristensen cole.christensen@gmail.com wants to merge feat/ci-release-process into main
No CI

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

  • ci/release.sh outputs 2026.4.1 with no existing tags
  • ci/release.sh increments build within same month (2026.4.1 -> 2026.4.2)
  • ci/release.sh resets build on month change (2026.3.5 -> 2026.4.1)
  • mix compile works without $VERSION set (uses 0.0.0-dev)
  • VERSION=2026.4.1 mix eval 'Mix.Project.config()[:version]' returns correct version
  • All 547 tests pass, dialyzer clean
Created Apr 09, 2026 at 13:21 UTC