docs/RELEASING.md
Releasing
This guide covers cutting an SDK release from reviewed main source, recovering from failures and the rules the release tooling enforces.
Use npm registry metadata for published versions and distribution tags
Cut a release
- Record SDK changes with
pnpm changesetfrom projects/ while developing them. Select the public package and compatibility bump, and write caller-relevant notes rather than an edited-file list - Run Release version PR with
source_ref: mainand the readinesschannel. It opens arelease/version-VERSIONpull request and dispatches Check on that branch. Review the SDK version, changelog and consumed fragments, then merge after Check passes - After the merge, Check runs on
main. When it passes and the push changed the SDK version to one npm lacks, it dispatches Release prepare for that exact commit. Review the version, channel, release notes and candidate SHA256 in the preparation summary - Run the
gh workflow run release-publish.ymlcommand printed in that summary, or dispatch Release publish frommainwith the same preparation run ID and checksum. It publishes the retained tarball, installs it from npm on both supported Node versions, announces the GitHub release and deploys the Docs preview - Confirm the result in the run summaries.
For a downloaded candidate,
pnpm release:statusreports whether npm serves the reviewed bytes and the current distribution tags
Every step can be rerun with the same inputs. Publication reads npm before uploading and never uploads a version twice
Keep .github/workflows/ unchanged on main from preparation until Release publish has announced the GitHub release.
GitHub refuses to create a release whose source commit has workflow files that differ from main unless the token has the Workflows permission, and the release App does not have it
Nightly builds
Nightly builds need no manual step.
Every day at 01:00 UTC, Release prepare builds main as the next nightly version and starts Release publish itself, without a checksum review.
Publication then runs the same checks as any release and announces a GitHub prerelease that carries the docs snapshot
A day whose SDK content matches the previous nightly publishes nothing.
It also publishes nothing when the content matches the published RC or Stable of the source version and no nightly on that line was published after it.
Pending Changesets notes appear as unreleased changes in the nightly's release notes and docs changelog, and they stay pending for the next RC or Stable.
To publish a nightly sooner, dispatch Release prepare from main with nightly selected. A nightly always builds the commit the workflow runs from and ignores source_ref
A nightly version is CORE-nightly.YYYYMMDD.N, such as 1000.0.0-nightly.20261019.16.
The YYYYMMDD part is the UTC date of the Release prepare run's preparation step and N is that run's number.
The date comes first so builds sort by day, and the run number then keeps them from ever repeating.
Overlapping nightly runs get different versions, because each run number is different.
Nightly versions published before this format use CORE-nightly.N. They stay valid and sort below every dated nightly of the same core, and every nightly sorts below the RC of its core.
A nightly run is superseded when the newest nightly on its line, published after its preparation, has the same content. When a higher nightly on its line already exists, any nightly published after its preparation with the same content supersedes it, and the newest matching one is reported. The run's Release publish step succeeds without publishing, prints the superseding version and skips the registry install, announcement and docs preview jobs. This covers overlapping runs on one commit, such as the daily schedule and a manual dispatch. The fingerprint reads share a one-minute budget that is checked between reads, and each read can take longer.
When no such nightly matches and a later one exists, the run fails with the newer version error. When only earlier ones exist, the run publishes. A candidate whose own version is already on npm is confirmed instead.
When a pending major or minor note is removed, the next nightly's version can drop below the newest nightly. It then publishes under a staging tag such as nightly-1000-1, while the nightly tag and /docs/nightly/ keep the higher build until a later nightly passes it. The dist-tag runbook can point nightly at the newer build
When a step fails
| Message | Meaning | Action |
|---|---|---|
npm publication is unconfirmed | The upload outcome is unknown | Rerun Release publish with the same inputs. It reads npm first |
npm serves different bytes for VERSION than the reviewed candidate | npm already has this version with other content | Never republish. Inspect the registry version and release a new version through Changesets |
npm serves VERSION, but the TAG tag does not point to it | The bytes are published, the distribution tag is not | Correct the tag with the dist-tag runbook, then rerun Release publish |
npm could not install ... from the registry | A registry install check failed after publication | Inspect the install log. The GitHub release stays unannounced until a rerun passes |
Published baseline changed since review | Another version on the same channel and line was published after preparation. A nightly still publishes when that version is an earlier nightly with different content | Prepare a new candidate from current main |
Nightly content matches VERSION | A nightly on the same line with the same content was published after preparation, at a lower or higher version. This is a successful no-op, not a failure, and the run's install, announcement and docs jobs are skipped | None. The next nightly publishes newer source |
Nightly fingerprint reads on line LINE ... exceeded 60 seconds | Reading the content of the nightly builds published after preparation took longer than its one-minute budget | Rerun Release publish with the same candidate, or prepare a new nightly |
A newer version is already published | A higher version with different content exists on the same channel and line, so this candidate is out of date | For a nightly, nothing is needed because the newer nightly already carries later source. Otherwise prepare a new candidate from current main |
Candidate source is not reachable from main | The candidate was prepared from unmerged source | Merge the source, then prepare from main |
Candidate does not match the externally reviewed checksum | The checksum input differs from the candidate | Copy the checksum from the preparation summary |
Preparation workflow commit is not reachable from main | Release prepare ran from a branch | Run Release prepare from main |
Preparation is not a successful manual or scheduled run of this repository's release-prepare workflow | The run ID is wrong, or the run failed or was still running after 5 minutes | Use the ID of a successful Release prepare run |
GitHub rejected the OPERATION with HTTP 4xx | GitHub refused the request, so nothing changed. A 403 on release creation can also mean workflow files changed on main after preparation | Fix the cause, such as App permissions or tag rules, then rerun Release publish. For workflow changes, revert them on main, rerun Release publish, then push them again |
GitHub release creation is unconfirmed, asset deletion is unconfirmed or asset contents are unconfirmed | A network or server failure left the outcome uncertain | Rerun Release publish. Reconciliation reads back after uncertain writes and replaces incomplete expected assets |
Publish pending changes as a release candidate before stable | Stable was selected from an RC source that has new changes | Run Release version PR with channel: rc, publish that RC, then select Stable |
VERSION is a new major version or epoch | A big release was selected for Stable without a published RC | Run Release version PR with channel: rc, publish that RC, then select Stable. See release stages |
Release candidate VERSION is pending | An unreleased RC blocks every other Stable at or above its version | Publish that RC as Stable first, or release a fix below it |
Stable content differs from VERSION | An RC of this version is published, and the source changed after the newest one | Publish the current content as a new RC first. See release baselines |
No pending Changesets fragments or readiness promotion | Nothing describes a new release | Add a fragment or select a promoting channel |
The source branch moved after version preparation | New commits arrived during Release version PR | Rerun Release version PR |
Check run N did not pass or The exact-source Check gate timed out | Release prepare or Docs preview found no passing Check for the source | Fix or rerun Check, then rerun the blocked workflow |
GitHub OIDC configuration is incomplete, refusing token fallback | The publisher has no OIDC token | Confirm id-token: write, the package environment and npm trusted publishing |
Unchanged publishable content on a nightly or RC is not a failure. Release version PR opens no pull request and Release prepare retains no candidate in that case
Reference
Dependency update notes
After Check passes for its current head, the dependency release-note workflow adds a patch Changeset to a same-repository Dependabot sdk-runtime pull request before merge, covering exact stable patch and minor upgrades of ws and neverthrow.
Development-only updates, existing release notes, mixed source changes, added or removed dependencies, major upgrades, zero-major minor upgrades, ranges and prereleases remain manual
Only reviewed default-branch code runs with write access. The completed Check is verified through the GitHub API, without consuming its artifacts or outputs. The dependency branch supplies manifest and file metadata through the API, with no checkout, dependency installation or execution. The workflow adds only the release note through an atomic expected-head commit, refusing concurrent branch commits or rewinds, and dispatches Check for the resulting head. Reruns preserve edited or removed notes and do not repeat an existing Check dispatch, including failed runs. A rerun can resume an interrupted Check dispatch only when the current head is the automatic note-only child of the checked commit and its note still matches the generated content
The resulting PR still requires review, passing checks and any workflow approval GitHub requests for automation-created updates. For a routine runtime update, wait for the release-note workflow and verify its Changeset before approving or merging. A failed or missing release-note workflow leaves the note as a manual task. The workflow does not version or publish the SDK
Registry publication contract
The canonical SDK manifest remains private. The stageRelease package script creates a separate public npm package directory and sdk.tgz tarball. Never publish from the SDK checkout
Package preparation copies compiled JavaScript, declarations, maps, sources, license and consumer guidance into a new directory.
It creates the public npm package directory and verifies the matching sdk.tgz inventory
The staged npm manifest receives the reviewed release version and retains Effect as a required peer range.
The prerequisite check requires a caret range of a stable version and an exact stable development dependency in the same major, at or above the range's lowest version, and rejects an exact, prerelease or optional peer.
Release commands that read or change registries enforce it, and the release tooling tests run it in pnpm check
Candidate schema 1 binds the package inventory, staged manifest and tarball checksums, source commit and checked documentation snapshot checksum into one reviewed candidate.
Validation rereads the staged directory and tarball before publication.
Publication, verification, status and the GitHub announcement download the tarball npm serves, check it against the registry's SHA-512 integrity and compare its SHA-256 with the candidate's sdk.tgz
Version and content rules
Epoch Semantic Versioning defines compatibility and readiness separately.
A version PR selects RC or Stable. Nightly versions exist only in their candidates and are never committed. Each new prerelease counter starts at zero.
The release wrapper retains the cycle's stable starting version in projects/.changeset/pre.json as releaseBase, with null for the initial 1000.0.0 cycle.
Pending and archived Changesets together determine the target's compatibility impact, while only pending notes enter a new preview's changelog. Stable collects the complete cycle's notes.
Before the Stable version PR, edit or delete archived notes in projects/.changeset/pre/ that later changes in the cycle superseded, so the Stable changelog never announces an API that the same release removes.
Make packaged text changes for a Stable that follows an RC, such as the README release status or the homepage URL, before the final RC
Source versioning is not atomic. After an interruption, reconcile the manifest, prerelease state, archived notes and changelog before retrying. Missing or invalid prerelease state fails closed
An explicit higher epoch is a multiple of 1000 and requires a major fragment. There are no permanent readiness branches. Occasional other release lines use an explicitly selected source branch
Content fingerprints ignore package-version fields and changelog bookkeeping, not arbitrary SDK bytes. Changed publishable bytes on the RC channel require a pending fragment. Promotion to RC alone does not bypass the unchanged-content guard. Stable instead follows the release stages
Changesets owns projects/sdk/CHANGELOG.md. The website renders it, and GitHub uses its exact version section for RC and Stable release notes. Nightly release notes list the pending notes instead.
Website, test and release-tooling changes that do not alter the published SDK need no fragment
Release stages
The size of a release decides whether Stable needs an RC first:
- Small release: A patch or minor release within the same epoch and major version. It can go straight to Stable from a Stable source version, with no RC
- Big release: A new major version, which is a breaking change, or a new epoch. It must be published as an RC first. Stable then promotes that RC from an RC source version with no pending notes
A maintainer decides when a published RC is ready to become Stable. There is no fixed waiting period
A pending RC is the newest published RC above the newest published Stable. While one exists, the only Stable at or above its version that can be published is the RC's own version. Stables below it stay free, such as a fix on an older line. Whenever an RC of the same version is published, Stable must match the newest one byte for byte by content fingerprint
Nightly builds are exempt from these rules.
A nightly needs no RC, is never blocked by a pending RC and has no content to match.
A nightly version carries the UTC date of its preparation step and the run number, and it must sort above every published nightly of its core in either form.
Release version PR and RC or Stable preparation read every published version with the selected source's release tooling, so once a dated nightly is published, the source must include dated nightly support.
If a higher nightly on the same line publishes first, the lower run is superseded and succeeds without publishing when any nightly of its line published after its preparation has the same content. Otherwise the lower run fails with the newer version error.
A nightly publishes under the nightly tag without moving latest or rc
Release baselines
Each nightly and RC compares against the previous npm version on the same channel and major.minor line.
The first one on a channel and line has none. The tooling reads that from the registry version list, so it needs no extra input.
Stable compares against the newest published RC of the same version and must match its content. A small Stable with no RC of its version has no baseline.
A failed registry lookup, including a missing package, always stops the release
Workflows
| Workflow | Trigger | Inputs and result |
|---|---|---|
| Check | Pull requests, pushes to main, manual and version-branch dispatches | Runs SDK, website and release tooling, workflow lint, browser and two-version consumer jobs in parallel. The check job requires all of them, or reuses an earlier passing run for identical content |
| Release version PR | Manual | source_ref, channel and optional epoch and line. Opens the version pull request |
| Release prepare | Daily for a nightly, dispatched by Check after a version change on main, or manual | source_ref, optional line and nightly. Retains the candidate artifact for 90 days. Prints the publish command, or starts Release publish for a nightly |
| Release publish | Manual, or started by a nightly Release prepare | preparation_run_id and candidate_checksum. Publishes, checks registry installs, announces and deploys the Preview |
| Docs preview | Called by Release publish, or manual | Always builds main and deploys only the Preview target |
Only Release publish writes to npm, and no push or tag publishes a package.
Release publish checks out its own workflow commit, so its tooling never comes from the candidate source.
The candidate commit is only the tag target and must be reachable from main
Release version PR builds the version change in a read-only job, then a separate job opens the pull request.
Pull request events for pull requests created or updated with GITHUB_TOKEN are not guaranteed, so that job also dispatches Check on the version branch
Identical content needs one full Check. The first job of every Check run compares the checked-out git tree with other push and dispatched Check runs in this repository.
The newest conclusive matching run by completion time decides, regardless of its run ID. When it passed, the check jobs are skipped and the required check job passes with a summary that links that run.
An unfinished matching attempt is awaited for up to 40 minutes only when it started before the current attempt, so matching runs never wait for each other. A failed or uncertain lookup runs the full Check.
Pull request runs never serve as evidence, because they check a merge commit rather than the recorded branch head.
A release therefore runs the full Check once, in the Check dispatched on the version branch. The version pull request run and the main push run after merging reuse it while main has not moved
Release prepare reuses the newest successful main-push Check for the exact source, waiting while it runs. A main-push Check that reused identical content counts as successful. Only a verified absence of such a run falls back to full workspace, browser and declared-minimum-Node checks. Preparation always builds fresh output, snapshots the documentation and installs the candidate's actual tarball before retaining it
Check on main dispatches Release prepare only when its own run passes. A newer push cancels an older Check, so dispatch Release prepare manually if a version change was superseded
A nightly Release prepare starts Release publish from its last job, so Release publish waits up to 5 minutes for the preparation run to finish before trusting it
Publication
Publication first reads npm. An existing version with the reviewed bytes succeeds without uploading, and one with other bytes fails. Otherwise it verifies the published baseline, submits the tarball once with npm OIDC and polls for up to 20 minutes until npm serves the reviewed bytes and the expected distribution tag points to the version. Transient registry failures during polling do not trigger another upload
Two registry install jobs then install the exact version from npm on the development Node version and the declared minimum, Node.js 24.15.0, and import every entry point the installed package exports. Only after both pass does the release App create a short-lived, repository-scoped token for the GitHub announcement
GitHub reconciliation polls delayed release, asset, tag and latest visibility for one minute per check. HTTP 4xx responses are definite rejections and stop reconciliation. Network failures and 5xx responses are uncertain and lead to readback, never a repeated write. A rerun deletes an incomplete expected asset, confirms its absence and uploads the reviewed bytes. Uploaded assets are never replaced. Source, release notes and asset-content conflicts stop reconciliation
Provider output is logged with token-like values redacted
npm distribution tags
The channel tags are nightly, rc and latest for Stable.
Recovery accepts a newer channel-tag version on the same major.minor line only when npm still serves the candidate's reviewed bytes. It never moves the channel tag backward.
Older release lines publish under a line-specific staging tag, such as nightly-1000-0, and still require that tag for recovery
No stable version exists yet, so latest points to a release candidate that the maintainer moved there by hand. Release publish never moves it for previews.
The first stable release moves it to 1000.0.0
Trusted publishing cannot change tags, so tag corrections need an interactive npm login with two-factor authentication:
| 1 | npm dist-tag ls @neontechspace/fluxerly |
| 2 | npm dist-tag add @neontechspace/fluxerly@VERSION TAG |
| 3 | npm dist-tag rm @neontechspace/fluxerly TAG |
The latest tag cannot be removed, only pointed at another version.
Confirm the correction with pnpm release:status, then rerun Release publish if it stopped at the tag check
Local commands
Run these from projects/. The status, verify and publish commands require --checksum REVIEWED_SHA256
| Command | Purpose |
|---|---|
pnpm release:plan --channel CHANNEL | Show the source-only version proposal without comparing registry bytes. A nightly plan also reads the registry version list and requires --date YYYYMMDD and --number RUN, with no default, so a plan never silently uses another day |
pnpm release:inspect CANDIDATE_DIRECTORY | Check local candidate contents only |
pnpm release:status CANDIDATE_DIRECTORY --checksum SHA256 | Report published, missing or different for the served bytes, plus the distribution tags |
pnpm release:verify CANDIDATE_DIRECTORY --checksum SHA256 | Fail unless npm serves the reviewed bytes |
pnpm release:publish CANDIDATE_DIRECTORY --checksum SHA256 | Publish through GitHub OIDC only, used by Release publish |
Never treat a checksum taken only from an untrusted replacement candidate as external review
External setup
The protected package environment needs no npm token secret.
Configure npm trusted publishing for release-publish.yml in that environment.
Release authentication requires GitHub OIDC and strips inherited registry tokens with an isolated token-free npm configuration
Workflows use the automatic GITHUB_TOKEN for repository reads, version pull requests, Check dispatches and artifacts. Do not add a GH_TOKEN or GITHUB_TOKEN secret.
Allow GitHub Actions to create pull requests
Create the private Fluxerly Release GitHub App under NeonTechSpace, with Contents write, mandatory Metadata read and no webhooks, installed only on Fluxerly.js.
In the package environment, set the RELEASE_APP_CLIENT_ID variable and RELEASE_APP_PRIVATE_KEY secret. Keep the key out of repository secrets, source, artifacts and logs.
Permit only main to enter package and keep administrator bypass disabled
For v* tags, use a creation-restriction ruleset whose only bypass actor is the release App, and a separate update and deletion ruleset with no bypass actors.
These rules constrain credentials, not one workflow. Administrators who can edit rules, workflows or environments can change the boundary
Use documentation maintenance for the Preview hostname, Cloudflare access and website environment.
Local tests establish the checked planning, staging and recovery boundaries, not live provider success