CI and release workflows
The CI and release workflows provide the repository's quality gate and package delivery paths. They validate package changes, exercise selected examples, publish temporary previews for active work, and publish stable or canary package versions when the matching GitHub event occurs.
Workflow system
The workflow system uses GitHub Actions to turn repository events into checks or package operations. Most jobs share one setup action so that local package links, the supported Node and pnpm versions, Bun, and example environment files are prepared in the same way.
The main workflow paths are:
| Path | Main purpose | Trigger |
|---|---|---|
| Continuous integration | Build packages and run tests, lint, format, type, and bundle checks | Pull requests and pushes to main |
| Example checks | Build and test a small set of key examples | Pull requests |
| Package previews | Publish changed packages for pull-request testing | Pushes and pull requests |
| Stable release | Version and publish packages through Changesets | Pushes to main |
| Canary release | Publish all public packages from a labeled pull request | release canary label added to a pull request targeting main |
| Pull-request policy | Check pull-request titles and apply labels | Pull-request open, edit, or sync events |
References: .github/…/ci.yaml• L1-20 .github/…/pkg-pr-new.yaml• L1-8 .github/…/examples.yaml• L1-14 .github/…/release.yaml• L1-16 .github/…/release-canary.yaml• L1-18 .github/…/pr-linter.yaml• L1-13
Shared action setup
The shared setup action creates a common execution base for workflow jobs. It selects the repository's Node version and pnpm cache, installs workspace dependencies, enables Bun, and copies example environment templates so later build and test steps see the same baseline.
The workspace is managed as a pnpm monorepo. Turbo uses the workspace graph to order package work and to pass selected test and service settings into tasks, so a workflow's package filter controls which part of that graph it validates or builds.
References: tooling/…/action.yml• L1-28 pnpm-workspace.yaml• L1-16 turbo.json• L1-55
Continuous integration
Continuous integration is the broad quality gate for package changes. On a pull request or a push to main, it checks that the packages build and that repository-wide style, type, and test rules still hold.
The workflow separates these checks into jobs that can run in parallel:
- Build and test: Builds the packages, installs Chromium for browser tests, and runs the package test command with the required test token.
- Lint: Checks source rules and workspace package consistency.
- Format: Checks Prettier output across the repository.
- Typecheck: Checks the TypeScript task graph.
The workflow cancels older work for the same non-main reference when a newer run starts. This keeps pull-request feedback focused on the latest commit without interrupting the main branch path.
References: .github/…/ci.yaml• L9-83 package.json• L10-29 turbo.json• L19-55
Bundle comparison
Pull requests also receive a client bundle comparison against main. The workflow builds the upload client for both revisions, creates size and treemap artifacts, and then posts or updates one pull-request comment with the gzip-size difference.
This check is a review aid rather than a separate package release. When the upload token is available, the supporting script uploads the treemap files for inspection; without that token, the comment still reports sizes but does not link to treemaps.
The flow compares the two revisions and returns its result as a pull-request comment.
flowchart LR
PR[Pull request] --> Compare[Build PR and main]
Compare --> Artifacts[Create bundle artifacts]
Artifacts --> Report[Compare gzip sizes]
Report --> Comment[Create or update PR comment]
Artifacts -. optional upload token .-> Treemap[Upload treemaps]
Treemap --> Comment
References: .github/…/ci.yaml• L85-148 .github/analyze-bundle.js• L1-15 .github/analyze-bundle.js• L32-49 .github/analyze-bundle.js• L68-143
Example validation
Example validation checks that representative applications can consume the built packages. On pull requests, a matrix builds minimal-appdir, minimal-pagedir, and backend-adapters, then runs each example's available end-to-end tests.
The workflow installs Playwright only for examples that declare it. It stores the backend-adapters Playwright report for later review when the job is not canceled.
References: .github/…/examples.yaml• L7-54
Package preview releases
Package previews make changed package code available before a stable release. The preview workflow compares package paths with origin/main, builds the package set, and publishes only the changed packages through pkg-pr-new with the minimal example templates.
The workflow also includes nuxt when vue changes without a direct Nuxt change. This preserves the preview relationship between those packages and lets reviewers test the affected integration.
References: .github/…/pkg-pr-new.yaml• L1-42
Stable release publication
The stable release workflow publishes packages after changes reach main. It first runs package build, lint, test, and type checks. The Changesets action then turns pending release notes into a versioning release process and publishes the resulting public packages to npm.
Changesets uses main as its base branch and keeps the docs and example packages outside the release set. When a release branch needs a lockfile update, the workflow installs without the frozen-lockfile rule, commits the synchronized lockfile, and pushes that release branch.
After publication, the workflow sends a Discord notice and asks the dashboard to refresh its npm-version banner. These downstream actions run only when packages were published.
The stable path follows this sequence:
flowchart LR
Main[Push to main] --> Checks[Build lint test typecheck]
Checks --> Changesets[Process pending changesets]
Changesets --> Publish[Publish stable packages]
Publish --> Notify[Notify Discord]
Publish --> Refresh[Refresh dashboard version data]
References: .github/…/release.yaml• L1-95 .changeset/config.json• L1-18
Canary release publication
Canary releases provide a coordinated test version for all public packages. A pull request targeting main starts this path only when someone adds the release canary label.
The workflow builds the package set, authenticates npm, and runs the canary script. The script gives each public package a patch-based version with the current commit hash, updates internal workspace dependencies to matching canary versions, and publishes the packages under the canary npm tag.
After publication, it comments on the pull request with install commands for the new versions. It then removes the release label so the same request does not remain marked for another canary run.
sequenceDiagram
participant Maintainer
participant PR as Pull request
participant Actions as GitHub Actions
participant NPM as npm
Maintainer->>PR: Add release canary label
PR->>Actions: Start labeled-event workflow
Actions->>Actions: Build public package set
Actions->>NPM: Publish commit-specific canary versions
Actions->>PR: Post install commands
Actions->>PR: Remove release canary label
References: .github/…/release-canary.yaml• L1-37 .github/release-canary.js• L11-21 .github/release-canary.js• L23-69 .github/release-canary.js• L71-119
Pull-request policy checks
Pull-request policy checks keep review metadata consistent. The title job checks each opened, edited, or synchronized pull request against the repository's semantic title rule. The label job uses path rules to add labels for areas such as docs, examples, SDK code, and framework packages.
The policy workflow runs against pull-request metadata and grants write access only to the label job. The label mappings in .github/labeler.yml define the review areas that can be inferred from changed paths.
References: .github/…/pr-linter.yaml• L1-30 .github/labeler.yml• L1-24
Issue lifecycle maintenance
The scheduled issue workflow reduces unattended issue backlog. It marks inactive issues as stale after 10 days and closes them five days later unless an exempt label protects them; pull requests are excluded from this automatic cycle.
The workflow can also run on demand. It needs issue write permission because it changes issue labels and messages.
References: .github/…/stale-issues.yaml• L1-23
Change checklist
When these files or sections are changed, remember to consider these:
- A change to the shared setup action can alter every workflow's Node, pnpm, cache, dependency, or example-environment behavior.
- A change to package names or workspace links can affect changed-package previews and the canary script's internal version mapping.
- A change to release conditions, labels, or permissions can stop a canary run from starting or prevent it from commenting on the pull request.
- A change to Changesets scope or base-branch rules can change which packages receive stable versions and publication.
- A change to bundle artifact names or paths must stay aligned between the comparison matrix, artifact download, and pull-request comment script.
- A change to label paths must preserve the review labels used by both pull-request policy and canary release workflows.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The package preview diff cannot identify changed package paths | No preview package is published | Keep the comparison refs and package directory layout aligned with the preview workflow |
| A public package has a workspace dependency that is not updated with the canary version set | Canary packages can resolve to an unpublished or mismatched workspace version | Keep package dependency declarations and the canary version mapping consistent |
| Bundle artifact names or locations change in only one comparison stage | The result job cannot compare the PR and main outputs | Treat matrix artifact names and downloaded paths as one contract |
| Release publication succeeds but a required token or webhook is missing | Package publication may complete while notification or dashboard refresh does not | Keep the GitHub, npm, Discord, and dashboard credentials configured for the release environment |
| The canary label is added without the required workflow permissions or token | Publishing or the pull-request comment fails | Preserve npm authentication and GitHub token access for package publication and PR updates |
Key files
| File | Why to read it |
|---|---|
| .github/…/ci.yaml | Primary package quality gate and bundle comparison orchestration |
| .github/…/examples.yaml | Pull-request validation for representative examples |
| .github/…/pkg-pr-new.yaml | Changed-package preview publication path |
| .github/…/release.yaml | Stable version, publication, and downstream notification path |
| .github/…/release-canary.yaml | Event and permission gate for canary publication |
| .github/release-canary.js | Canary version, dependency, npm publication, and pull-request feedback flow |
| .github/…/pr-linter.yaml | Pull-request title and label policy entry point |
| .github/labeler.yml | Path-to-review-label rules |
| tooling/…/action.yml | Shared workflow environment and dependency setup |
| .changeset/config.json | Stable release scope and branch rules |
| .github/analyze-bundle.js | Bundle comparison result and pull-request comment behavior |