This document outlines how to manage canary, release candidate (RC), and stable releases of our packages using Changesets and GitHub Actions.
| Branch | Purpose | Tag | Description |
|---|---|---|---|
main |
Stable release | latest |
Final production-ready versions |
canary |
Ongoing integration/dev builds | canary |
Publishes preview builds for testing |
rc |
Release candidate cycle | rc |
Publishes versions under test for GA release |
canaryis a long-lived branch for ongoing integration builds.rcis a temporary branch, created per release cycle and typically deleted after merging intomain.
-
Create from
main:git checkout main git pull git checkout -b canary npx changeset pre enter canary git add .changeset/pre.json git commit -am "enter canary prerelease mode" git push origin canaryNote:
-amonly stages tracked files. Usegit addif.changeset/pre.jsonis new. -
Merge PRs into
canarywith changesets. -
Canary versions will look like
1.2.3-canary.0,1.2.3-canary.1, etc.
Only create this when you're preparing a stable release from canary or main.
-
Create from
main:git checkout main git pull git checkout -b rc npx changeset pre enter rc git add .changeset/pre.json git commit -am "enter rc prerelease mode" git push origin rc -
Merge PRs into
rcwith changesets. -
RC versions will look like
1.2.3-rc.0,1.2.3-rc.1, etc.
- For every merged PR that should be testable in production-like environments without waiting for a full release.
- Create a PR and merge it into the
canarybranch. - GitHub Actions will:
- Verify pre.json is in canary mode.
- Create a version PR if needed.
- Publish the version to npm with the
canarytag once merged.
npm install @knocklabs/some-package@canary- When preparing for a stable release and want to QA the build across environments.
- Merge PRs with changesets into the
rcbranch. - GitHub Actions will:
- Verify pre.json is in rc mode.
- Create a version PR if needed.
- Publish the version to npm with the
rctag once merged.
npm install @knocklabs/some-package@rc- When the RC has been fully tested and approved for production.
-
On the
rcbranch:npx changeset pre exit npx changeset version git commit -am "exit rc prerelease mode" git push origin rc
-
Merge
rcintomain. -
GitHub Actions on
mainwill:- Check for
.changeset/pre.json. If it exists, the workflow will fail to prevent accidental prerelease publication tolatest. - If all looks good, it will create a version PR or publish the stable version directly to the
latestnpm tag.
- Check for
npm install @knocklabs/some-packagemainis blocked from publishing if.changeset/pre.jsonexists (pre-release guard).canary/rcrequire valid.changeset/pre.jsonmatching the expected tag.- Only merged PRs will trigger a publish — direct commits do not publish.
- Releases are published when a version PR is merged into the branch.
# Enter prerelease mode
npx changeset pre enter canary # or rc
# Exit prerelease mode
npx changeset pre exit
# Apply version bumps and changelog updates
npx changeset version
# Publish packages (CI will handle this normally)
npx changeset publish
npx changeset version: Applies all pending changesets, bumps versions, and updates changelogs.
Let an engineer on the team know if you're unsure which type of release is appropriate or if any .changeset/pre.json state looks incorrect.
This process ensures stable releases are intentional, pre-releases are safe, and GitHub Actions handles the rest automatically.