Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Release process

A cerebro release is a git tag and a Codeberg release page. Nothing goes to crates.io: all four crates are publish = false, they depend on each other by path, and cargo package can’t resolve a path dependency from a registry. That’s the whole story in ADR-0012.

What a release looks like

main  ──▶  just release  ──▶  release PR  ──▶  merge  ──▶  CI publishes
           bump + changelog                  reviewed     tag + release page
           + lockfile

One version covers the whole workspace. All four crates inherit [workspace.package] version, so one tag names one release: cerebro-v0.3.0.

Cutting one

just release-status   # what Cargo.toml says vs. what the commits propose
just release          # branch, changelog section, version bump, one commit

just release needs cargo and git-cliff. Install git-cliff with cargo install git-cliff --locked. It writes nothing to the forge and prints the two commands that follow:

git push -u codeberg release/cerebro-v0.3.0
fj pr create 'chore(release): cerebro-v0.3.0' --base main

One commit goes on that branch, carrying three files: CHANGELOG.md with the new section, Cargo.toml with the version, and Cargo.lock re-resolved to match. All four crates inherit [workspace.package] version, so the lock moves with the manifest or it quietly disagrees with every release tag until someone’s build rewrites it.

Read the changelog section in that diff. It comes from commit subjects, and a subject that needs rewording is cheaper to fix in the release PR than on a published release page.

Once the PR merges, CI publishes on its own. The push to main leaves the manifest ahead of the last tag, so scripts/release.sh publish posts one release with that version’s changelog section as the body, and Codeberg creates the tag pointing at the commit CI built. On any other push to main it prints “already released” and exits 0.

To see what CI would do without doing it:

just release-preview

Version numbers

Commit types decide the bump, since the last cerebro-v* tag:

Commits since the last tagBumpExample
fix:patch0.2.2 → 0.2.3
feat:minor0.2.2 → 0.3.0
feat!: or a BREAKING CHANGE: footer, below 1.0.0minor0.5.0 → 0.6.0
feat!: or a BREAKING CHANGE: footer, from 1.0.0major1.4.2 → 2.0.0
build:, ci:, chore:, style:, test: onlynone0.2.2 → nothing to release

Commit subjects follow conventional commits because they’re the release notes. The commit-msg hook runs cog verify, which enforces the format.

Breaking changes below 1.0.0

SemVer §4 says a 0.x release is initial development: the public API promises no stability, and anything may change in any release. A ! below 1.0.0 is therefore information for consumers, not a claim the tooling is entitled to make on their behalf. scripts/release.sh clamps it: when the current version is 0.x and conventional commits ask for a major, the release is the next minor instead. An unreleased fix(deps)! at 0.5.0 cuts 0.6.0. Only the number moves. cliff.toml stays as it is, so the 0.6.0 section still opens that entry with [**breaking**] and names every affected surface. Clamping a version is not softening a changelog, and just release-status says which number it clamped and why.

A major is still available. It has to be asked for by name, and that is the only way one happens while the current major is 0:

CEREBRO_RELEASE_MAJOR=1 just release   # or: just release-major

release-major is the same command with the variable set, listed by just --list so the escape hatch is not buried in this page.

The variable is an opt-in, not an instruction. It lets through the major git-cliff worked out, and it invents nothing: with no breaking commit in range the proposal is still a patch or a minor. Any other value stops the script with a message instead of guessing, because a typo that quietly published 1.0.0 is the exact failure this rule exists to prevent. From 1.0.0 upward the variable is not needed, and a ! means a major there as it always has.

Releasing by hand

If CI is unavailable, the same API call works from a laptop. It’s the exact request publish makes:

version=$(bash scripts/release.sh version)
notes=$(bash scripts/release.sh notes "$version")

Don’t git push a tag by hand. The forge cuts the tag as it creates the release, which keeps the tag, the release page, and the commit CI tested in agreement.

Tests

bash scripts/release-test.sh

Scratch git repositories, a stubbed curl, and assertions on every decision: which line bump rewrites, what next proposes for each commit type, how the pre-1.0 clamp and its CEREBRO_RELEASE_MAJOR opt-in behave, whether notes stops at the next section, and the publish branches (no-op, publish once, stand down after the tag exists, refuse without notes or a token). It runs in the CI test step and inside just test, so a broken release script can’t merge quietly.