Publishing runs in CI (the release job in .github/workflows/ci.yml), right after
build-test goes green on main. Locally you only describe and bump.
bun run changesetInteractively select the affected packages (@react-text-game/core, @react-text-game/ui) and the bump type: • patch — bug fixes, minor changes. • minor — backward-compatible features. • major — breaking changes. Write a short description (it will go into the CHANGELOG).
bun run version-packagesThis consumes the changeset files, rewrites versions and CHANGELOGs, and refreshes
bun.lock so CI's --frozen-lockfile install keeps working.
git add -A && git commit -m "Version Packages" && git pushCI then builds, lints, typechecks, tests, and — only if all of that passes — publishes
every package whose version is not yet on npm, pushes the @react-text-game/<pkg>@<version>
tags, and creates the matching GitHub Releases.
Nothing gets published when versions are unchanged, so ordinary pushes to main are safe.
A release can be re-run from Actions → CI → Run workflow if npm was unavailable.
If a changeset file reaches main without step 2, CI opens a "Version Packages" PR with
the bumps instead of publishing. Merge it to release, or drop it and run step 2 locally.
NPM_TOKENrepository secret — a granular npm access token with read/write on the@react-text-gamescope.GITHUB_TOKENis provided by Actions automatically.- On npmjs.com the packages must allow automation tokens (Settings → "Require two-factor authentication or an automation token"; the "disallow tokens" variant blocks CI publishing).
- Provenance is enabled via
NPM_CONFIG_PROVENANCE, which is why every publishable package carries an explicitrepositoryobject with itsdirectory. releaseis the one script that deliberately skipsbunx --bun.--bunalso forces thenpm publishthat changesets spawns onto Bun's runtime, and signing the provenance attestation there dies withERR_OSSL_NO_DEFAULT_DIGEST(BoringSSL). Plainchangeset publishkeeps npm on Node, where the signing works.prepackchecks thatdistexists rather than rebuilding it (scripts/assert-built.ts). It used to runbun run build, which cannot be done safely during a release:changeset publishpacks several packages at once, every build begins withrm -rf dist, and the packages that depend on@react-text-game/corecompile against the directory core's own build has just deleted. That is not hypothetical — it is what publishedcore@0.11.0whileui@0.7.0anddevtools@0.1.1failed withTS2307: Cannot find module '@react-text-game/core'. The workflow builds the whole workspace through Turborepo, in dependency order, immediately before publishing, sodistonly needs checking. When a release does fail partway, fix the cause and push: the next run publishes whichever packages are still missing from npm and skips the rest.