All 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. - Review the generated prepare release PR, but do not merge it manually.
- Run Publish Stable Release with the
release_prnumber shown in the prepare workflow summary. - Approve the
npm-publishenvironment. - The publish workflow publishes from the exact prepare PR head commit, creates tags and GitHub Releases for that commit, then attempts to squash-merge the prepare PR into
main.
- Run Prepare Release on
- For a prerelease from a branch:
- Run Publish Prerelease Snapshot with
ref=<branch, tag, or SHA>. - Install from the
rctag, for examplenpm install braintrust@rc.
- Run Publish Prerelease Snapshot 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 feature PRs into
main. - Run Prepare Release from
main. - That workflow:
- validates publishable package metadata
- runs
changeset version - creates a branch named
prepare-release/{short-main-sha} - opens a prepare release PR from that branch into
main - writes the
release_prnumber to the workflow summary
- Review the prepare release PR to confirm the package versions, changelogs, and consumed changeset deletions look right.
- Run Publish Stable Release with:
release_pr=<prepare release PR number>
- Approve the
npm-publishenvironment when GitHub asks.
The stable publish workflow checks out the exact prepare PR head SHA. It does not publish from the current tip of main.
The workflow then:
- detects packages whose versions changed between the recorded
Source-main-shaand the prepare PR head - publishes any of those package versions that are not already on npm
- pushes Changesets-style release tags for the prepare PR head commit
- creates GitHub Releases
- attempts to squash-merge the prepare release PR into
mainwith--match-head-commit
If publishing succeeds but the PR cannot be auto-merged, the release is still published. Merge or repair the prepare release PR manually afterward.
Stable releases publish to the npm latest dist-tag.
Use this to publish a test build from a branch before merging to main.
- Run Publish Prerelease Snapshot.
- Set:
ref=<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
- publish to the npm
rcdist-tag - 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. - Stable publishing must use a prepare release PR created by Prepare Release.
- The old
releasebranch and backsync workflow are no longer part of the release process. - Re-running Publish Stable Release for the same
release_pris safe after a partial failure. Already-published npm versions are skipped, but tags and GitHub Releases are still reconciled for the prepared release set.