All JavaScript package publishing happens in GitHub Actions. Do not publish from your local machine.
- If your PR changes a publishable package, run
pnpm changesetand commit the generated.changeset/*.mdfile. - Merge the PR into
main. - For a stable release:
- Run Prepare Release on
main. - Merge the generated PR into
release. - Run Release Packages with
release_mode=stableandref=release. - Approve the
npm-publishenvironment. - The backsync workflow enables auto-merge on the backsync PR; approve it only after the publish succeeds.
- Run Prepare Release on
- For a prerelease from a branch:
- Run Release Packages with
release_mode=prereleaseandref=<branch>. - Install from the
rctag, for examplenpm install braintrust@rc.
- Run Release Packages with
If your PR changes a publishable package, CI expects a changeset unless you explicitly skip it.
Create one with:
pnpm changesetThat creates a .changeset/*.md file. Commit it with your PR.
Use:
patchfor fixes and non-breaking maintenance changesminorfor new backwards-compatible featuresmajorfor breaking changes
If no release is intended, bypass the check with either:
- the
skip-changesetPR label #skip-changesetin the PR title or body
This is the normal production release flow.
- Merge the feature PR into
main. - Run Prepare Release from
main. - That workflow:
- runs
changeset version - creates a branch named
release/{short-main-sha} - opens a PR from that branch into
release
- runs
- Review and merge that PR into
release. - Run Release Packages with:
release_mode=stableref=release
- Approve the
npm-publishenvironment when GitHub asks. - The backsync workflow opens a PR from
backsync/{short-release-sha}tomainand enables auto-merge on it. - After the publish succeeds, approve that backsync PR so it can merge into
main.
Stable releases publish to the npm latest dist-tag, push release tags, and create GitHub Releases.
Use this to publish a test build from a branch before merging to main.
- Run Release Packages.
- Set:
release_mode=prereleaseref=<branch, tag, or SHA>
- Wait for the workflow to finish.
- Install from
rc, for example:
npm install braintrust@rcPrereleases:
- publish only packages with releasable changesets on that ref
- do not create git tags
- do not create GitHub Releases
- do not commit version changes back to the repo
- Prepare Release must be run from
main. releaseis the branch used for stable publishing.- The backsync PR is opened when
releasegets the release commit, not after publish, and the workflow enables auto-merge on it. Becausemainrequires an approving review, do not approve that PR until the stable publish succeeds.