Release automation
Release automation turns approved workspace changes into checked package releases or pull-request canaries. It uses Changesets to describe version intent, Turborepo to validate package work, and npm plus GitHub integrations to publish and announce the result. For the GitHub Actions job details and the wider CI relationship, see CI and release workflows.
Release model
The release model separates stable publication from short-lived canary testing. Stable releases follow changesets on main, while a canary is built from a labeled pull request so reviewers can test the package state before merge.
| Release kind | Starting event | Version source | Result |
|---|---|---|---|
| Stable | Push to main | Pending changesets | Versioned public packages and a changelog-backed GitHub release |
| Canary | release canary label on a pull request targeting main | Current commit and package versions | Public npm packages under the canary tag and install commands on the pull request |
References: .github/…/release.yaml• L1-5 .github/…/release-canary.yaml• L1-7 .changeset/config.json• L3-10
Workspace coordination
The workspace is the set of packages and related projects managed by pnpm. Internal package links use the workspace protocol during development, but release output must contain real package versions so consumers can install it outside this repository. The workspace definition includes publishable packages alongside examples, playgrounds, documentation, and tooling; the release jobs narrow validation to the package area.
Changesets provide the shared record of release intent. Each changeset names affected packages, selects a version change, and supplies release-note text. The Changesets configuration treats the repository as a public package set, uses main as the base branch, updates internal dependencies with a patch when needed, and leaves docs and examples outside the release plan.
A changeset can coordinate one user-facing fix across several packages. For example, the MIME extension update requests patch releases for the shared package and its client integrations, so the stable release flow can publish them as one release plan.
References: pnpm-workspace.yaml• L7-16 .changeset/config.json• L3-17 .changeset/wet-days-happen.md• L1-5 .changeset/accept-mime-extensions.md• L1-11
Stable release flow
The stable flow validates the package set before Changesets either opens or updates the release work and publishes an approved release. After publication, it repairs the lockfile branch when Changesets has changed package metadata, then tells downstream services that a new npm version is available.
The following sequence shows the main stable-release path.
flowchart TD
A[Push to main] --> B[Install workspace dependencies]
B --> C[Build lint test and typecheck packages]
C --> D[Changesets release action]
D --> E{Pending changesets?}
E -- Yes --> F[Version packages and update changelog]
F --> G[Commit release changes]
G --> H[Publish public packages to npm]
H --> I[Sync lockfile branch]
I --> J[Notify Discord and revalidate dashboard tag]
E -- No --> K[Wait for release intent]
The release action owns the version and publish decision. Its commit and pull-request metadata make the release plan visible in GitHub, while its publish command sends the resulting public packages to npm. A successful publication triggers a Discord notice and a dashboard request that refreshes the visible npm tag.
References: .github/…/release.yaml• L26-49 .github/…/release.yaml• L51-95 package.json• L31-35
Canary release flow
The canary flow gives a pull request a testable package build without changing the stable release plan. It selects every non-private package under packages, assigns each package a patch increment with a commit-based canary suffix, and replaces internal workspace links with matching canary versions.
The canary job follows this sequence after a pull request receives the required label.
- Set up the repository and build the package set.
- Authenticate npm for public publishing.
- Publish packages with the
canarydistribution tag. - Comment install commands with the exact canary versions on the pull request.
- Remove the
release canarylabel after the comment is created.
The commit suffix keeps a canary tied to the source revision that produced it. The pull-request comment turns the published versions into a direct test instruction, and label removal prevents the same request from remaining marked as pending after completion.
References: .github/…/release-canary.yaml• L13-36 .github/release-canary.js• L23-56 .github/release-canary.js• L59-109
Package publication boundary
Only public packages are candidates for publication. Package metadata controls this boundary through the private flag and the public npm access setting, so a package can take part in the workspace without becoming an external release.
Before a package is packed, its release metadata must also stop using workspace-only dependency ranges. The package prepack step uses .github/replace-workspace-protocol.ts to replace internal dependency links with the current package versions and remove development-only metadata from the published manifest. This keeps the npm artifact usable by consumers who are not inside the pnpm workspace.
References: packages/…/package.json• L134-159 packages/…/package.json• L28-41 .github/replace-workspace-protocol.ts• L14-55
Related workflow page
The CI and release workflows page explains the GitHub Actions jobs that surround these release paths. Read it next for the full event map, package checks, preview publication, and pull-request policy checks.
References: .github/…/release.yaml• L11-27 .github/…/release-canary.yaml• L13-28
Change checklist
When these files or sections are changed, remember to consider these:
- If package names,
privateflags, or workspace paths change, check both the stable Changesets package set and the canary package discovery rule. - If internal dependency ranges or package publish metadata change, verify that packed manifests still resolve workspace dependencies to released versions.
- If the stable release action, Changesets branch, or lockfile sync step changes, verify that the release commit and generated lockfile remain on the branch consumed by the next release run.
- If the canary version format or npm tag changes, update the pull-request install instructions and any consumers that use the tag.
- If post-release notifications or dashboard refresh calls change, verify their secrets, target URLs, and publication conditions together.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Package validation fails before the stable release action | The release does not proceed to version or publish packages | The stable job runs build, lint, test, and typecheck for the package set first |
| A package remains private or is not included in the workspace package paths | It is not selected for release or canary publication | Keep package discovery, workspace paths, and package visibility metadata aligned |
A published package keeps a workspace: dependency range | Consumers outside the repository may receive an unusable dependency range | The prepack conversion replaces internal ranges with concrete versions |
| Canary publication partially fails across packages | The pull request can show an incomplete set of installable versions | Review the publish result before relying on the generated install block; the script attempts package publishes in parallel |
| Lockfile sync is skipped after package version changes | The release branch can retain dependency state that does not match package metadata | The stable workflow runs a non-frozen install and pushes the sync commit when Changesets reports changes |
| A stable publish succeeds but a notification or dashboard refresh fails | Users may not see the new release notice or current npm tag | Treat the Discord and dashboard calls as post-release signals and inspect their job logs |
Key files
| File | Why to read it |
|---|---|
| .github/…/release.yaml | Defines the stable release trigger, package validation gate, Changesets publication, lockfile repair, and post-release signals. |
| .github/…/release-canary.yaml | Defines the pull-request label trigger and the canary validation, npm authentication, and publish stages. |
| .github/release-canary.js | Shows how public package versions, internal links, npm canaries, pull-request guidance, and label cleanup are coordinated. |
| .changeset/config.json | Defines the release-plan scope, version behavior, public access, and base branch. |
| .changeset/*.md | Shows the input format that records package-level release intent and changelog text. |
| pnpm-workspace.yaml | Defines the workspace boundary that release and package tools operate within. |
| .github/replace-workspace-protocol.ts | Explains the package-manifest conversion required before an artifact leaves the workspace. |
| package.json | Lists the repository-level release tools and the commands used to validate packages. |