This guide explains how to release packages from this repository.
Important: all publishing happens in GitHub Actions. Do not publish from your local machine.
- Run
pnpm changesetin any PR that contains changes that may in any way be user facing - Commit the generated
.changeset/*.mdfile - Merging your PR will update or create a "Release PR"
- Merging the "Release PR" will trigger a release
- Release runs need to be approved on GitHub via Deployment Approvals
| I want to... | What to do |
|---|---|
| Make my PR release something | Run pnpm changeset and commit the generated .changeset/*.md file |
Ship a normal stable release to npm latest |
Merge the auto-created release PR on main, then approve the npm-publish environment |
| Publish a branch build for testing | Run the Release Packages workflow with release_mode=prerelease and your branch name |
| Manually trigger a canary publish | Run the Release Packages workflow with release_mode=canary |
| Preview what would publish without actually publishing | Run the workflow with a dry-run-* mode |
If your PR changes a publishable package, it usually needs a changeset.
pnpm changesetThat command will ask:
- which package(s) changed
- whether the bump is
patch,minor, ormajor - what should appear in the changelog
Commit the generated .changeset/*.md file with your PR.
| Bump | Use it for | Examples |
|---|---|---|
patch |
Bug fixes, internal refactors, performance work, dependency updates, docs-only API-neutral changes | Fix a crash, improve retry logic, bump a dependency |
minor |
New backwards-compatible functionality | Add a new method, export a new helper, add an optional parameter |
major |
Breaking changes | Remove or rename public API, change behavior in a way that may break users, drop Node support |
---
"braintrust": patch
---
Fix span export when using custom headersYou can edit the generated file by hand before committing it.
You usually do not need one for docs-only, test-only, or CI-only changes.
If your PR touches a publishable package but does not contain any potentially user-facing or user-impacting changes, bypass the check by using one of these:
- add the
skip-changesetlabel to the PR - include
#skip-changesetin the PR title or body
This is the normal production release flow.
A stable release is a two-step process:
feature PR with changeset
→ merge to main
→ automation opens or updates a release PR
→ merge the release PR
→ approve npm-publish
→ packages publish to npm
Merging your feature PR does not publish anything by itself. It only feeds changes into the next release PR.
- Merge your PR with its changeset into
main. - Wait for GitHub Actions to create or update the release PR.
- Review the release PR:
- are the package bumps correct?
- do the changelog entries read well?
- Merge the release PR.
- Open the workflow run and approve the
npm-publishenvironment when prompted. - The workflow publishes to npm, pushes release tags, and creates GitHub Releases.
- npm publishes on the
latestdist-tag - Changesets package tags such as
braintrust@3.8.0 - GitHub Releases
Canaries are nightly snapshots from main.
Use them when someone wants the newest merged JS SDK code without waiting for the next stable release.
nightly scheduler workflow dispatches canary publish on main
→ check for pending changesets
→ check whether HEAD already has a canary
→ check whether latest CI passed
→ publish @canary if needed
- runs automatically every night at 04:00 UTC
- can also be triggered manually with
release_mode=canary - skips if there are no pending changesets
- skips if the current
maincommit already has a canary - skips if the latest required CI run on
maindid not succeed
npm install braintrust@canary
npm install @braintrust/otel@canary1.2.3-canary.20260404040000.abc1234
That includes:
- the base version
- a timestamp
- the short commit hash
- do not create git tags
- do not create GitHub Releases
- do not commit version changes back to the repo
- do not need manual environment approval
Use a prerelease when you want to publish a test build from a branch before merging to main.
- Open Actions in GitHub.
- Open the Release Packages workflow.
- Click Run workflow.
- Set:
release_mode=prereleasebranch=<your branch>
- Run the workflow.
- After it finishes, install from the
rcdist-tag:
npm install braintrust@rc1.2.3-rc.20260414104840.abcdef1234567890abcdef1234567890abcdef12
That includes:
- the next base version
- a timestamp
- the commit SHA
- do not create git tags
- do not create GitHub Releases
- do not commit version changes back to the repo
- do not publish packages that have no releasable changesets on that branch
Use a dry run when you want to answer: what would publish if I ran this for real?
Available modes:
| Mode | Simulates |
|---|---|
dry-run-stable |
stable release from a ref |
dry-run-prerelease |
prerelease from a branch |
dry-run-canary |
canary publish from a ref |
Dry runs will:
- compute versions
- build the publishable packages
- create tarball artifacts
- show a summary in the workflow output
Dry runs will not:
- publish to npm
- create tags
- create GitHub Releases
- commit anything back to the repo
No. Stable release publishing happens from the push-to-main flow around the release PR.
Yes. Use release_mode=prerelease and a specific branch ref.
- canary: automated or manual snapshot from
main, published tocanary - prerelease: manual snapshot from any branch, published to
rc