release-version

command
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Command release-version reads commit subjects since a base ref and decides the next semantic-version bump according to Conventional Commits 1.0 — emitting the next "vMAJOR.MINOR.PATCH" tag (or, with --report, a human-readable explanation) on stdout.

Designed to be called from the auto-tag CI workflow:

NEXT=$(go run ./cmd/release-version --base "$LATEST_TAG")
git tag -a "$NEXT" -m "Release $NEXT"

Conventional Commits → semver mapping (see CONTRIBUTING.md "Releases"):

feat!:, fix!:, refactor!:, ...        → MAJOR
BREAKING CHANGE: in body              → MAJOR
feat:, feat(scope):                   → MINOR
fix:, perf:, refactor:                → PATCH
chore:, ci:, docs:, test:, style:,    → PATCH (defensive default)
build:, revert:                       → PATCH
(unrecognised subject)                → PATCH + warning on stderr

Aggregate over every commit in the range: pick the highest bump encountered. A merge commit subject ("Merge pull request #N from …") is ignored — only the squash-style commits the PR actually contributed are read. Empty ranges report exit 4 ("no commits, no release") so the caller can short-circuit.

Exit codes:

0  success — wrote next tag to stdout
2  invalid CLI flags or git invocation failed
3  base ref does not exist / unparseable input
4  no commits in the range (caller should skip the release step)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL