Use this guide to publish a new version of Nuits Receipts. Nobody edits the version by hand: scripts/version.mjs reads the Conventional Commits since the last v* tag and decides the bump. Releasing only tags the code. Each deployment owner decides when to deploy it (see Upgrade your deployment).
Prerequisites
- Push access to
mainon GitHub. - For a local release: Bun 1.4 or later, an up-to-date
mainwith tags fetched (git fetch --tags), and the GitHub CLI (gh) signed in.
Choose the commit type
Pull requests are squash-merged, so the pull request title becomes the commit subject. Give it a Conventional Commits type:
| Commit | Bump | Changelog section |
|---|---|---|
fix(...), hotfix(...) |
patch | Hotfixes |
perf(...), revert(...) |
patch | Hotfixes, or UI enhancements for a UI scope |
style(...) |
patch | UI enhancements |
feat(...) |
minor | Features, or UI enhancements for a UI scope |
type! or a BREAKING CHANGE: footer |
major | Breaking changes |
docs, test, chore, ci, build, refactor, copy, update |
none | not listed |
UI scopes are a11y, design, footer, style and ui. The highest bump in the range wins. Subjects that are not Conventional Commits are ignored and reported under unclassified, and merge commits are skipped.
Release from GitHub
Check the code
Before merging, run the full check and a deploy dry run:
bun run check bun run deploy:dry-runSee Run the tests for what
checkcovers.Merge to main
Merging does not release.
.github/workflows/release.ymlruns only when you start it by hand onmain: Actions, Release, Run workflow. It never runs on a push or a schedule, and a run started from another branch does nothing. One run releases every commit merged since the last tag.The workflow runs
bun scripts/version.mjs apply, which rewritespackage.jsonand prepends an entry toCHANGELOG.md, then acts on the plan:release: commitschore(release): vX.Y.Z, tagsvX.Y.Z, pushesmainand the tag, and creates a GitHub Release from that version’s changelog entry.baseline: first run only, when no tag exists. Tags the currentpackage.jsonversion and creates a GitHub Release for it.skip: nofeat,fix,perf,styleor breaking commits since the last tag. Nothing changes.
If
mainis protected, add aRELEASE_TOKENrepository secret with a token that may push to it. Without it the workflow uses the defaultGITHUB_TOKEN.Override the bump if needed
To force a bump, run the workflow by hand: Actions, Release, Run workflow, then choose
patch,minorormajorunder bump.autofollows the commits.
Release from your machine
The same steps run locally on an up-to-date main.
Preview the plan
bun run version:nextThis is read-only. It prints the plan as JSON:
action,currentVersion,bump,nextVersion,tag, the grouped changelog lines and anyunclassifiedsubjects. To preview a forced bump:bun run version:next -- --force minorApply the plan
bun run version:apply > plan.jsonThis rewrites
package.jsonand prependsCHANGELOG.md. It does not touch git or the network. ReadactionandnextVersioninplan.json.Commit, tag and publish
For
"action": "release", withX.Y.ZfromnextVersion:git add package.json CHANGELOG.md git commit -m "chore(release): vX.Y.Z" git tag -a vX.Y.Z -m "Release vX.Y.Z" git push origin main git push origin vX.Y.Z bun scripts/version.mjs notes X.Y.Z > notes.md gh release create vX.Y.Z --title vX.Y.Z --notes-file notes.mdFor
"action": "baseline", tag the current version withgit tag -a vX.Y.Z -m "Release baseline vX.Y.Z", push the tag and create a GitHub Release for it. For"action": "skip", there is nothing to do.
Nothing is published to npm.
Check it worked
- The new tag shows under Releases on GitHub with the grouped notes.
CHANGELOG.mdonmainstarts with the new version.- After a deployment, the footer of every app page shows the new version.
src/ui.tsreads it frompackage.jsonat build time, and ifSOURCE_REPOSITORYis set the version links to<SOURCE_REPOSITORY>/releases/tag/vX.Y.Z.
If something goes wrong
- Push rejected: no tag or release was created. Fix the cause and run it again; the plan is computed from scratch.
- Tag exists, release does not: run
bun scripts/version.mjs notes X.Y.Z > notes.md, thengh release create vX.Y.Z --notes-file notes.md. - Wrong commit type: land a correcting commit. Never move or delete a published tag.
Docs
The docs site in docs-site/ is not versioned by this process: a docs(...) commit does not bump the version. Build it before you merge a docs change, so broken internal links and copy rule hits fail locally rather than later. See the end of Run the tests for the commands.