Releasing Stainless
On this page
Releases are maintainer-only. Stainless uses a hybrid release: the browser is built and packaged on a dedicated macOS build host, and a tag-triggered GitHub Actions workflow re-verifies the uploaded draft and publishes it.
Hosted runners cannot build Chromium (standard macos-26 runners have 3 CPUs, 7 GB of memory,
14 GB of disk and a 6-hour job limit, while a Stainless build needs 100+ GB and hours of
compilation), so CI never compiles the browser. It verifies what the build host uploaded.
flowchart LR
A["scripts/release.sh VERSION<br/>(build host)"] -->|bump PR, checks, merge| B[main]
B --> C["build, test, package<br/>at the merged commit"]
C --> D[draft prerelease<br/>+ annotated tag]
D -->|tag push| E["release.yml<br/>(hosted runner)"]
E -->|verified| F[published prerelease]
F --> G["release.sh verifies<br/>tag and asset digests"]
Requirements
#- A dedicated macOS build host or VM with its own GUI session and no forwarded personal
keyboard input.
testandpackagelaunch AppKit helpers and the full browser smoke; see native GUI-test isolation. The script refuses to build without--isolated-host. - Everything in the build guide: Apple Silicon, full Xcode,
the Chromium cache (
./tools/stainless bootstrapdone once) and free disk. ghauthenticated for github.com with permission to push branches and tags, open and merge pull requests and create releases instainless-browser/stainless.cargo-audit(cargo install cargo-audit --locked) andpython3.- A Git remote (default
origin) whose fetch and single push URL both point togithub.com/stainless-browser/stainless. Run the script from an up-to-datemaincheckout: it refuses to run when its own files differ from the release base.
Release a version
#Preview the plan first. A dry run creates no branch, PR, build, tag or release:
./scripts/release.sh --dry-run 0.1.0-preview.9
Then release on the build host:
./scripts/release.sh --isolated-host 0.1.0-preview.9
| Option | Meaning |
|---|---|
-n, --dry-run | Show the plan only |
--isolated-host | Confirm the dedicated build host; required when a build will run |
--keep-artifacts | Keep other Chromium revision caches and older dist/ packages after the release |
--jobs N | Chromium build parallelism, 1 to 64 (default 8) |
--remote R, --base B | Release remote and base branch (defaults origin, main) |
STAINLESS_CACHE_DIR is passed through to ./tools/stainless. Waits are bounded by
STAINLESS_RELEASE_CHECKS_TIMEOUT (600 s for PR checks to appear),
STAINLESS_RELEASE_MERGE_TIMEOUT (1800 s), STAINLESS_RELEASE_RUN_TIMEOUT (600 s for the
release workflow to appear), STAINLESS_RELEASE_STOP_GRACE (30 s between SIGTERM and SIGKILL
when stopping a step) and STAINLESS_RELEASE_POLL_INTERVAL (10 s).
Versions
#Stainless only implements the preview channel, so versions have the form
MAJOR.MINOR.PATCH-preview.N (SemVer 2.0.0) and an
optional leading v is accepted. Build metadata is rejected because the product manifest
cannot carry it. The tag is stainless-preview-vVERSION.
The script compares versions by SemVer precedence. It rejects a version older than the
release base or a published release, and warns before any work when the version skips values,
for example 0.1.0-preview.4 to 0.1.0-preview.8 (previews 5 to 7 were never published) or
0.1.0 to 0.3.0. Warnings never change the requested version. A new version increments
product.build by one, keeping updater builds monotonic.
What the script does
#- Preflight. Validates the version, tools,
ghauthentication, remote identity, the script's freshness againstorigin/mainand existing PR, tag, draft and package state. One release runs at a time per repository (lock in the Git common directory). - Bump PR (only when
maindoes not already carry the version). In a temporary worktree from freshorigin/mainit setsproduct.version/product.buildinchromium/manifest.json, runssecurity-statusandcargo audit, commitsrelease: VERSION(unsigned, no editor), pushesrelease/VERSIONand opens a ready PR. It showsgh pr checks --watch, requires every check to pass and the head to be unchanged, then runsgh pr merge --auto --squash --match-head-commit. gh merges immediately when the PR is clean, or enables auto-merge when repository rules still block it; the script waits for the actual merge and uses its merge commit. It never bypasses repository rules. - Build and package in a temporary detached worktree at the release commit:
security-status,cargo audit --deny warnings,test,build --jobs Nandpackage.testruns beforebuildbecause it rebuilds the updater UI whose hashbuildrecords. The package moves todist/VERSIONin your checkout. - Stage.
./tools/stainless publish dist/VERSIONre-verifies the package (checksums, clean source revision equal to the release commit, license and security policy, current Chromium stable, RustSec) and uploads it to a draft prerelease targeting that commit. - Tag. Creates and pushes the annotated
stainless-preview-vVERSIONtag at the release commit. It never force-pushes or moves a tag. - Release CI. Finds the
release.ymlrun for that tag and commit and showsgh run watch. On failure it prints the failed-step log and run URL. - Verify. Requires a published prerelease, the remote tag at the release commit and
every asset name, size and
sha256digest to matchSHA256SUMS. - Clean up, unless
--keep-artifactsis given. See cleanup.
Cleanup
#Processes. Every long step (./tools/stainless and cargo audit) runs as its own process
group with normal interrupt handling. xtask has no signal handler, so its smoke helpers
(fixture servers, ChromeDriver, the browser) and build tools are stopped as a group:
- On Ctrl-C or SIGTERM the script sends SIGTERM to the step's group and every descendant,
waits up to
STAINLESS_RELEASE_STOP_GRACEseconds, then sends SIGKILL to whatever remains. Press Ctrl-C twice to force it immediately. - When a step finishes but leaves processes running in its group, the script lists and stops them the same way.
- Only SIGKILL of the script itself bypasses this; then stop leftover processes manually.
Files. Owned worktrees (including their Rust target/ output) and the temporary work
directory are removed on every exit; a run killed outright is cleaned up by the next run.
Kept: dist/VERSION, the local tag and the current revision's Chromium cache, which keeps
the next build incremental.
After the release is verified, the script also removes, in the build cache
(STAINLESS_CACHE_DIR, default ~/Library/Caches/StainlessBuild) and your checkout:
- Chromium checkouts and build output of other revisions (
chromium/REVISION, 50 to 100+ GB each) and their lock files. dist/packages older than the released version. Newer local candidates and anything that is not a package stay. Published packages remain downloadable from GitHub Releases.- Temporary directories that interrupted
packageruns left in the cache ordist/.
It never touches depot_tools, the pinned Rust toolchain, other sessions' cache directories
or anything outside these paths. A revision whose coordinator lock is held, or any path a
running process uses as its working directory, has on its command line or has mounted, is kept
and reported. Temporary directories are removed only when no Stainless build or package holds
any lock on that cache. The dry run lists what would be removed without taking locks.
Cleanup problems are warnings: the release is already published by then. Pass
--keep-artifacts, for example while comparing two Chromium revisions, to skip it.
Release CI
#release.yml runs only for pushed
stainless-preview-v* tags, on a hosted macos-26 runner with contents: write limited to
that job. Runs for the same tag never cancel each other. It:
- Requires an annotated tag on
mainthat matches the source manifest version. - Requires a staged prerelease; a draft must target the tagged commit.
- Downloads every asset and runs
./tools/stainless verify-release:SHA256SUMSand no unlisted assets, the update feed, a clean build from the tagged commit, the packaged license andSECURITY.md, current Mac Stable Chromium andcargo audit. - Checks the uploaded asset digests reported by GitHub against
SHA256SUMS. - Publishes the draft as a prerelease and confirms the tag still points to the commit.
Trust boundary. CI proves that the published assets are exactly the files the build host
recorded in SHA256SUMS, built from a clean checkout of the tagged commit, and that the
Chromium pin and Rust dependencies are current at publication. It does not rebuild or
re-smoke the browser, so it cannot prove the binaries are reproducible, and previews remain
unsigned and unnotarized. The build host and the maintainer's GitHub credentials stay in the
trust base.
Recover from a failure
#Fix the cause and rerun the same command. The script reconstructs state from GitHub and
dist/VERSION; tag, draft and package must agree on one release commit.
| Stopped at | Rerun behavior |
|---|---|
| Validation, before the PR | Nothing was pushed; starts again |
| PR checks failed or merge refused | The PR stays open; fix it there (or merge it per repository rules), then rerun to resume the same PR |
| Build, test or package failed | The merged bump is reused; rebuilds at the same commit (Chromium output in the cache is incremental) |
| Staging failed with a partial draft | Inspect gh release view TAG, delete only that unpublished draft, then rerun |
| Release workflow failed | The draft stays unpublished; rerun to rerun the failed jobs once and watch them. If the fix needs new source, release a new version |
| Already published | Verifies the release, tag and digests, publishes nothing, then runs the cleanup |
The script refuses conflicting state instead of overwriting it: a tag pointing elsewhere, a
package from another commit (move dist/VERSION aside), several or closed bump PRs, a local
release/VERSION branch without a PR, or a release that appears during the build.
Manual equivalent
#Without the script, from a clean checkout of the release commit on the build host:
./tools/stainless security-status && cargo audit --deny warnings
./tools/stainless test
./tools/stainless build --jobs 8
./tools/stainless package
./tools/stainless publish dist/VERSION # uploads a draft only
git tag -a stainless-preview-vVERSION -m "release: VERSION" && git push origin stainless-preview-vVERSION
Homebrew
#Decision (2026-11-18): publish Stainless as a cask in
mbianchidev/homebrew-tap. The tap is the
only writer: its hourly updater picks the highest published stainless-preview-v* prerelease,
checks the asset against this release's SHA256SUMS and opens the bump PR there. This
repository holds no tap credentials and the release ends at published, checksummed assets.
The cask keeps macOS quarantine and is not available until
mbianchidev/homebrew-tap#41 merges.
After publishing
#Publication is not a Phase 1 completion claim. Record actual clean-host download and install, baseline browsing and installed N-to-N+1 update and recovery evidence as described in the Phase 1 contract and the update verification procedure.
The release tooling is covered by tests/release_script_test.py (run by
./tools/stainless test and CI), which exercises the script against a synthetic Git remote,
GitHub CLI and build tools.