Skip to content

build(release): add git-cliff version-bump script - #20

Merged
cvega merged 2 commits into
mainfrom
build/release-bump
Jun 14, 2026
Merged

cvega merged 2 commits into
mainfrom
build/release-bump

Conversation

@cvega

@cvega cvega commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

Adds bun run release:prep — automated version bumping driven by git-cliff, so cutting a release no longer requires hand-editing package.json (which we did manually for v0.0.2 and v0.0.3).

How it works

bun run release:prep

scripts/release-prep.ts runs git-cliff to compute the next semver from the Conventional Commits since the last tag:

Commit since last tag Bump
breaking change major
feat: minor
anything else (fix, ci, build, …) patch

It then writes that version into package.json (touching only the version line, so Biome's formatting stays intact) and regenerates CHANGELOG.md with the unreleased commits filed under the new version.

It deliberately does not commit, tag, or push — so the release still goes through a reviewed chore(release): <version> PR and the existing tag-triggered release.yml. It just removes the manual version edit.

If there are no releasable commits since the last tag, it reports that and makes no changes.

Verified locally

Ran it against the real history (last tag v0.0.3):

Bumped 0.0.3 → 0.0.4  (updated package.json + CHANGELOG.md)
Next:
  1. Review the diff
  2. Commit:  git commit -am "chore(release): 0.0.4"
  3. Open a PR and merge it
  4. Tag:     git tag v0.0.4 && git push origin v0.0.4

The CHANGELOG.md correctly grew a [0.0.4] section grouping the commits. (The test bump was reverted — this PR does not change the version; it only adds the tooling.)

Contents

  • scripts/release-prep.ts — the bump script (typechecks under scripts/tsconfig.json).
  • package.json — release:prep script + git-cliff devDependency (the npm wrapper that vendors the 2.13.1 binary, matching the version release.yml's git-cliff-action uses).
  • docs/development.md — a new Releasing section documenting the full flow (previously undocumented).

Notes

  • Full gate suite green; coverage holds at 86.49% / 84.56% (the script isn't imported by tests, so it's outside the coverage denominator, like the other scripts/).
  • knip doesn't flag git-cliff, and bun audit is clean with it added.
  • Pairs with the just-merged CHANGELOG fix (fix(ci): commit CHANGELOG.md on the first release #19): release:prep keeps CHANGELOG.md current in the bump PR, and the pipeline's post-tag regeneration becomes a confirming no-op.
  • This is a prep helper, intentionally not a verify gate.

Possible follow-up

If you later want zero-touch releases, this same git-cliff foundation can drive a scheduled/standing "release PR" (release-please style). For now it keeps the human gate you preferred.

cvega added 2 commits June 14, 2026 15:27
Adds `bun run release:prep`, which computes the next semver from the
Conventional Commits since the last tag (via git-cliff — breaking → major,
feat → minor, else → patch), writes it to package.json, and regenerates
CHANGELOG.md so the unreleased section is filed under the new version.

It stops short of committing or tagging, so the release still goes through
a normal reviewed `chore(release): <version>` PR and the existing
tag-triggered release.yml — it just removes the hand-editing that set the
version for v0.0.2 and v0.0.3.
@cvega
cvega merged commit 7493bc3 into main Jun 14, 2026
2 checks passed
@cvega
cvega deleted the build/release-bump branch June 18, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant