Release and automation workflows
The release and automation system validates the CLI on pull requests, offers safe preview packages, and publishes the main package through a changeset-based release flow. GitHub Actions coordinates these stages so that source changes pass build and type checks before they can become a public npm release. See CLI and public API for the product surface that these workflows deliver.
Continuous integration validation
Pull request checks give one required view of build health and test health. The build check confirms that the CLI can compile and pass TypeScript checks, while the test check also runs lint and the test suite across supported Node.js versions.
The pull request workflow starts both reusable checks and then exposes their combined result as all-pr-checks. This gives branch protection and merge automation one stable status to inspect without hiding the result of either check.
flowchart TD
PR[Pull request] --> Build[Build and type check]
PR --> Test[Test and lint across Node versions]
Build --> All[All PR checks]
Test --> All
All --> Merge[Merge decision]
The test matrix includes Node.js 22.12.0, Node.js 26, the current release, and the active long-term support release. Each job uses the shared setup action before it builds the project and runs the combined test command. This makes the compatibility range explicit while keeping the test steps the same for every version.
References: .github/…/pull-requests.yml• L1-21 .github/…/typescript-build.yml• L1-27 .github/…/typescript-test.yml• L1-39
Shared workflow setup
The shared dependency setup action gives every workflow the same package manager, Node.js setup, and dependency install behavior. This keeps local package resolution and CI package resolution aligned while allowing the test workflow to vary the Node.js version.
The action uses the repository's pnpm version and enables pnpm caching through the Node.js setup. Its default Node.js target is the current long-term support release. Workflows can supply another version when they need a compatibility check.
References: .github/…/action.yml• L1-25 package.json• L5-6 package.json• L75-79
Preview package publication
The preview publication workflow builds pull request code and sends it to pkg.pr.new. This produces installable package snapshots for review without changing the normal npm release line.
The workflow runs for every pull request and can also run by manual request. It does not replace the pull request checks. Instead, it adds a package-level way to test the exact proposed build before merge.
References: .github/…/publish-pkg-pr-new.yml• L1-28
Changeset release flow
Changesets are release notes that state which package needs a version change and which release level applies. A pending changeset therefore carries both the release intent and the change summary used by the release process.
The current pending changesets request a minor release for stricter project-name package validation, a patch release for single-pass initialization-script renaming, and a patch release for a zod security update. They show how one release can group changes with different release levels under the same package.
The main branch release workflow separates the normal release path from the canary path. The normal path prepares a version pull request when pending changesets exist, then publishes after that version change reaches main. The canary path publishes a temporary canary version when main contains pending changesets, so consumers can try the next release before the stable version is ready.
flowchart TD
Main[Push to main or manual run] --> Checks[Build, type check, and package validation]
Checks --> Action[Changesets release action]
Action -->|Pending release notes| VersionPR[Version pull request]
VersionPR -->|Merged to main| Stable[Stable npm publication]
Checks --> CanaryCheck[Pending changeset check]
CanaryCheck -->|Yes| Canary[Canary version and npm publication]
The release job checks out full history because version changes depend on the repository history. It validates the built package before npm authentication and uses npm provenance for published artifacts. The package publish command avoids a duplicate upload when that version already exists and defaults to the latest npm tag.
The changeset configuration makes releases public and uses main as the release base. It creates GitHub-based changelog entries and updates internal package dependencies with a patch change. The release action creates the version commit itself because the changeset configuration does not request an automatic commit.
References: .github/…/publish-packages.yml• L1-113 .changeset/config.json• L1-14 .changeset/project-name-schema.md• L1-5 .changeset/single-pass-init-rename.md• L1-6 .changeset/zod-security-update.md• L1-5 package.json• L20-21 package.json• L39-51
Release artifacts
The published artifact is the built CLI package. Its package metadata exposes the compiled module forms and the create-solana-dapp command, while the package file list limits the published contents to the build output.
Stable releases use the public npm package with the latest tag. Canary releases use the canary tag, and preview releases from pull requests use the separate pkg.pr.new service. These channels let users choose between released, early, and review-only code without mixing their version histories.
References: package.json• L1-37 package.json• L47-51 .github/…/publish-packages.yml• L80-113 .github/…/publish-pkg-pr-new.yml• L21-28
Change checklist
When these files or sections are changed, remember to consider these:
- When the minimum Node.js version or package manager version changes, update the shared setup action and the test matrix together so validation still covers the supported runtime.
- When the build output, package entry points, or published file list changes, review package validation and all three publication channels.
- When the release command or npm tag changes, keep the stable and canary commands aligned with the package publish scripts.
- When the changeset base branch or changelog source changes, review the release action inputs and the version pull request behavior.
- When the required pull request checks change, keep the aggregate
all-pr-checksjob aligned with the reusable workflow jobs.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A pull request fails either reusable validation workflow | The aggregate pull request check stays incomplete or fails, so merge automation cannot treat the change as ready | Both reusable checks feed all-pr-checks in .github/…/pull-requests.yml |
The built package does not satisfy publint | The stable or canary release stops before npm publication | The main release paths validate the package after build and type checks |
| A pending changeset is omitted from a main-branch change | The normal release flow has no release intent to turn into a version pull request or publication | Add a package changeset for each releasable change; the workflow ignores only .changeset/README.md |
| The target version already exists on npm | A repeated publish attempt would fail or create an unsafe duplicate release | The package publish script checks npm for the version before publishing |
| A canary release runs without a pending changeset | No canary job starts | The canary job requires the changeset check to report a pending changeset |
Key files
| File | Why to read it |
|---|---|
| .github/…/pull-requests.yml | Defines the pull request entry point and the single aggregate status used for merge decisions. |
| .github/…/typescript-build.yml | Shows the build and type-check contract for the CLI. |
| .github/…/typescript-test.yml | Shows the cross-version test and lint contract. |
| .github/…/action.yml | Defines the shared Node.js, pnpm, cache, and dependency setup. |
| .github/…/publish-packages.yml | Defines stable versioning, stable publication, and canary publication from main. |
| .github/…/publish-pkg-pr-new.yml | Defines review-only package snapshots for pull requests. |
| .changeset/config.json | Defines the release base, public access, changelog source, and dependency version policy. |
| .changeset/project-name-schema.md | Records the pending minor release for project-name validation. |
| .changeset/single-pass-init-rename.md | Records the pending patch release for initialization-script renaming. |
| .changeset/zod-security-update.md | Records the pending patch release for the zod security update. |
| package.json | Defines the CLI package boundary, build output, and commands used by the release workflows. |