|
| 1 | +# Release |
| 2 | + |
| 3 | +Prepare a release PR for initium. This command handles version bumping, changelog updates, and PR creation. The release is published automatically when the PR merges (CI detects the version bump and creates the tag, which triggers the release workflow). |
| 4 | + |
| 5 | +## Determine the next version number |
| 6 | + |
| 7 | +Follow semantic versioning (MAJOR.MINOR.PATCH): |
| 8 | + |
| 9 | +1. Read `CHANGELOG.md` under `## [Unreleased]` to see what has changed since the last release. |
| 10 | +2. Read recent commits since the last tag: `git log $(git describe --tags --abbrev=0)..HEAD --oneline` |
| 11 | +3. Determine the version bump: |
| 12 | + - **PATCH** (x.y.Z): Only bug fixes, documentation, or internal changes with no user-facing behavior change. |
| 13 | + - **MINOR** (x.Y.0): New features, new CLI flags, new configuration options, or backward-compatible enhancements. |
| 14 | + - **MAJOR** (X.0.0): Breaking changes — removed features, changed defaults, incompatible schema/config changes, or renamed CLI flags. |
| 15 | +4. Read the current version from `Cargo.toml` and compute the next version. |
| 16 | + |
| 17 | +## Confirmation phase |
| 18 | + |
| 19 | +Before making any changes, present to the user: |
| 20 | +- The **current version** and the **proposed next version** with reasoning. |
| 21 | +- A **summary of changes** that will go into the release (from Unreleased changelog + commit log). |
| 22 | +- Ask: "Proceed with version X.Y.Z?" and wait for confirmation. |
| 23 | +- If the user suggests a different version, use that instead. |
| 24 | + |
| 25 | +## Execute the release |
| 26 | + |
| 27 | +Once confirmed: |
| 28 | + |
| 29 | +1. Fetch origin and create a branch: `release/vX.Y.Z` from `origin/main`. |
| 30 | +2. Bump version in `Cargo.toml` (the `version = "..."` field under `[package]`). |
| 31 | +3. Run `cargo check` to update `Cargo.lock`. |
| 32 | +4. Update `CHANGELOG.md`: |
| 33 | + - Move everything under `## [Unreleased]` into a new `## [X.Y.Z] - YYYY-MM-DD` section (use today's date). |
| 34 | + - Leave `## [Unreleased]` empty (with just the heading). |
| 35 | +5. Run `cargo test` to verify nothing is broken. |
| 36 | +6. Run `cargo clippy -- -D warnings` and `cargo fmt -- --check`. |
| 37 | +7. Commit: `release: vX.Y.Z` |
| 38 | +8. Push the branch and create a PR with title `release: vX.Y.Z`. |
| 39 | +9. The PR body should include the changelog entries for this version. |
| 40 | + |
| 41 | +When the PR merges, the auto-tag workflow detects the version bump in `Cargo.toml` and creates the `vX.Y.Z` tag, which triggers the release workflow (Docker build + crates.io publish). |
0 commit comments