Integrating shipcrate into an existing project
Already have a release process?
Run shipcrate init --dry-run first: it lists what it would write and never overwrites without asking.
Take only the parts you want. They’re independent:
| Want | Take |
|---|---|
| Just the safety net | scripts/check.sh, .githooks/, scripts/install-hooks.sh, .github/workflows/ci.yml, tests/shipcrate/ |
| Checksums + provenance on your existing releases | scripts/manifest.sh and the attest-upload job in release.yml (it attests whatever you publish) |
| Update checks only | updater/<your language> plus a latest.json in each release (scripts/manifest.sh writes it) |
All settings live in release.conf. Point BUILD_CMD, ARTIFACT and VERSION_CMD at your existing build.
Already releasing with dist, GoReleaser or your own workflow?
shipcrate adds to your pipeline instead of replacing it. shipcrate init notices dist (dist-workspace.toml or dist
settings in Cargo.toml), GoReleaser, or a workflow run by tags or releases, and then:
- writes no second release workflow (and no second CI if one already runs on pushes or pull requests);
- keeps your file names:
ASSETinrelease.conftakes{target}(macos-arm64),{triple}(aarch64-apple-darwin) and{tag}(v1.2.0). With dist it’s set for you (NAME-{triple}.tar.xz), with the targets from dist’s config;shipcrate planchecks the names against your last release; - leaves a Homebrew tap that dist manages alone;
-
adds
.github/workflows/shipcrate-manifest.yml: when your release is published, it waits for those files, checks them against your pipeline’s own.sha256files, and addslatest.json(signed if signed updates are on) andSHA256SUMS, updates the beta channel and calls your webhook. Then update notices, rollout, yank, required updates and announcements work as usual. - GoReleaser: the archive
name_template(one line or a>-block) becomesASSET; platforms come fromgoos/goarch; Windows keeps.tar.gzunlessformat_overridessays zip (thenASSET_WINDOWSis empty); abrews:tap is left alone; the checksums are checked against GoReleaser’schecksums.txt. - Published only to npm or PyPI (no files on the GitHub release):
ASSET='none', solatest.jsoncarries update notices only and the updaters tell users thenpm/pipxcommand.
The updaters install a .tar.gz, .tar.xz or .zip with the program at the top or one folder down (how dist
packs it), or the program itself with no archive (ASSET='mycli-{os}-{uarch}'). Name placeholders: {target},
{triple}, {tag}, {version}, {os}, {arch}, {uarch} (x86_64), {goos}, {Goos} (Darwin), {goarch}.
--no-adopt uses shipcrate’s own release workflow instead. ES-module Node packages ("type": "module") get the
updater as update-check.cjs.
Will shipcrate get in the way of your release tool?
It’s built not to, and tested on real projects that use dist, GoReleaser, release-please, release-plz, semantic-release and their own workflows (only new files are added; the sandbox checks every run):
| What your tool does | What shipcrate does next to it |
|---|---|
| builds, names and uploads the files | nothing: ASSET just points at your names (plan checks them) |
| creates tags and releases (release-please, release-plz, semantic-release, changesets) | never tags or publishes; release.sh only plans |
| owns the Homebrew tap / Scoop bucket | leaves it alone |
its own updater (dist’s NAME-update) |
update notices tell users to run that |
| git hooks (husky, lefthook, pre-commit) | install-hooks.sh doesn’t take them over; it tells you the one line to add |
git describe --tags for versions |
no extra tags: the beta channel lives on the shipcrate-channel branch |
your scripts/ files with the same names |
kept as yours, never run or replaced; shipcrate’s copy goes beside it as scripts/shipcrate-NAME.sh |
a tracked dist/ folder |
not added to .gitignore; only shipcrate’s own files are written there |
Files shipcrate adds: release.conf, scripts/, tests/shipcrate/, updater/, .github/workflows/shipcrate-manifest.yml,
and a CHANGELOG.md/SECURITY.md only if you don’t have one. Before anything: shipcrate audit (read-only) and
shipcrate init --dry-run.
Mac apps that already use Sparkle
Sparkle stays your updater: init sees SUFeedURL (or Sparkle in the Xcode project) and adds no second updater.
shipcrate still adds checksums, provenance, an SBOM, latest.json for your own servers and the webhook, the audit and
plan. Its update controls map onto Sparkle’s appcast, which you publish as today:
| shipcrate | in your Sparkle appcast item |
|---|---|
| timed rollout over N days | <sparkle:phasedRolloutInterval> (seconds per step; Sparkle rolls out in 7 steps) |
required update (min-version) |
<sparkle:minimumAutoupdateVersion> or <sparkle:criticalUpdate sparkle:version="…"/> |
| beta channel | <sparkle:channel>beta</sparkle:channel> plus allowedChannels in the app |
| yank | remove the bad item from the appcast (Sparkle then offers the newest remaining one) |
Your appcast items stay signed with your own Sparkle key (sign_update / generate_appcast); shipcrate never needs it.
See how a project ships today: shipcrate audit
shipcrate audit [DIR] is read-only and works on any repo, with or without shipcrate. It reports the release
pipeline it finds, what users download (checksums, signatures, provenance, SBOM), whether installed copies hear about
updates, release workflow hardening (least-privilege permissions, pinned actions, script injection), dependency
advisories (cargo audit, govulncheck, npm audit, pip-audit when installed), and exactly what adopting shipcrate would
add or change. --md prints it as Markdown.
Your own installer, updater and release script stay yours
shipcrate adds to what a project already has and never replaces it silently. shipcrate sync and
shipcrate doctor list your own pieces and explain what shipcrate’s version would change:
- Installer: yours is kept.
shipcrate sync --show install.shshows the difference (shipcrate’s checks the signed manifest, SHA-256 and provenance, and keeps the old copy for rollback). - Take shipcrate’s version anyway:
shipcrate sync --take scripts/release.sh(repeatable) replaces just that file, with no question, so it also works for agents and scripts. Your version stays in git history. - Updater copy: yours is kept. Diff it against
updater/and take the changes when you choose. - Release script: yours is kept. Call
scripts/release.shfrom it to get the safety rules. - Signed updates (Ed25519): off until you choose.
sh scripts/keygen.shexplains what changes (your app also checks your signature, so a compromised GitHub account or mirror can’t push an update; the cost is keeping the key safe) and asks before doing anything.
Your brand on the update notice
Mac apps: set a theme once at startup. Security, required-update and pulled-version notices keep urgent
(red by default) so they always stand out.
Updater.theme = UpdaterTheme(accent: .blue, cornerRadius: 6, icon: "sparkles", updateLabel: "New version")
CLIs: a template for the normal “new version” line, and an optional color (never with NO_COLOR or without a
terminal). Edit NOTICE_TEMPLATE / NOTICE_COLOR at the top of the updater, or call theme() (Node, Python):
update.theme({ template: "✨ {binary} {version} is out (you have {current}) · run {command}", color: "cyan" });
Placeholders: {binary} {version} {current} {command} {page}. Security, required and pulled-version notices keep
their fixed wording, so users always recognise them.
The updater as a package (instead of a copied file)
The same updater code is also built as packages, so updater fixes can arrive through your package manager:
const update = require("shipcrate-update"); // npm
update.configure({ repo: "owner/mycli", binary: "mycli" });
await update.notify(version);
import shipcrate_update as update # PyPI: shipcrate-update
update.configure(repo="owner/mycli", binary="mycli")
update.notify(__version__)
// crate: shipcrate-updater. Creates `mod update` in your crate, with your values as constants.
shipcrate_updater::updater!(repo: "owner/mycli", binary: "mycli", env: "MYCLI", token: "mycli", public_key: "");
update::notify(env!("CARGO_PKG_VERSION"));
env names the environment variables (MYCLI_NO_UPDATE_CHECK, MYCLI_CHANNEL); public_key turns on signed
updates. The API is the one in the copied files. Maintainers build them with sh tools/build-packages.sh.
Keep the workflows in step with release.conf
shipcrate workflows compares .github/workflows/ with what release.conf generates today (after you change
TARGETS or BUILD_WHERE, say). --write [FILE] regenerates them; your edits stay in git history. To have CI fail
when they drift (learned from dist generate --check), add a step:
- uses: simarpreetsingh-019/shipcrate@v1
with: { command: workflows, args: "--check" }
It’s opt-in on purpose: if you edit your workflows by hand, leave the check out and compare with shipcrate workflows.
Updating shipcrate in a live app (6 rules)
The updater is the one part of an app that can’t fix itself, so changes to it go out carefully:
- Sync only from shipcrate releases.
shipcrate syncrefreshes shipcrate’s own files (scripts/,tests/shipcrate/,.githooks/,updater/) and recordsSHIPCRATE_VERSIONinrelease.conf. It refuses a development copy of shipcrate. Your settings, workflows, installers and your copy of the updater are never overwritten: it lists them for you to compare. - Beta first. If shipcrate’s code or the updater changed since the last stable release,
release.shasks for a beta of that version first (X.Y.Z-beta.1). Only testers with the beta channel on get it. - Prove the update path.
sh scripts/update-path-test.sh X.Y.Zdownloads the last stable release, builds the new one locally, and lets the old copy update itself (checksum, signature, swap, runs), all on this machine.release.shasks for a pass on the exact commit you release. - Roll out slowly. Those releases roll out over
SAFE_ROLLOUT_DAYS(7 by default).scripts/yank.shstays ready if something goes wrong. - Keep the old download names.
release.shrefuses a release that drops a file name the last release had, so older updaters, installers and Homebrew keep working. - Experiment elsewhere. Try new shipcrate versions on a test project (
shipcrate new rust-cli /tmp/try) or shipcrate’s examples, not on the live app.
Each rule has an escape hatch for when you really mean it: --skip-beta, --skip-update-test,
--full-rollout, --allow-renamed-assets.
Already have a notification system?
shipcrate doesn’t replace it. There are three places to connect it, so use whichever fits.
1. Your app shows the notice (client side)
The updaters find the update. Your code decides how to show it.
- Swift:
Updater.shared.onUpdateAvailable = { release in MyNotifications.post(release) }. The built-inUpdateButtonis optional: leave it out of your UI if you don’t want it. - Rust:
if let Some(l) = update::check(VERSION) { my_notify(&l.version, l.security, &l.page) } - Python:
if (l := update_check.check(__version__)): my_notify(l) - Node:
const l = await update.check(version); if (l) myNotify(l);
check() keeps the same rules as the built-in notice: at most once a day, interactive use only, the opt-out env
var. l.security tells you to make the notice louder.
2. Your servers push it (server side)
Each release can POST its latest.json to your push service, which then sends to APNs, FCM, email or an in-app inbox.
- Add repository secrets
RELEASE_WEBHOOK_URL(https) and, recommended,RELEASE_WEBHOOK_SECRET. - The release workflow (or
release.shfor local builds) callsscripts/notify.shafter publishing. - Your endpoint checks
X-Shipcrate-Signature: sha256=<hex HMAC-SHA256 of the raw body>, using a constant-time compare, then fans out to your channels.
Example check in Python:
import hmac, hashlib
ok = hmac.compare_digest(request.headers["X-Shipcrate-Signature"],
"sha256=" + hmac.new(SECRET, request.body, hashlib.sha256).hexdigest())
A failed webhook never undoes a release. It prints a warning, and you can re-send it with sh scripts/notify.sh.
Test your receiver before a real release. shipcrate webhook test --url https://your-host/shipcrate (or
sh scripts/webhook-test.sh) sends the same messages a release, a security release, an announcement and a yank
would. With RELEASE_WEBHOOK_SECRET set, each is sent signed (must be accepted), wrongly signed and unsigned
(both must be refused). Nothing is released. --print EVENT shows a sample body, and --postman FILE writes a
Postman collection with the same samples and signing, if your team tests APIs there.
A dashboard instead of commands: shipcrate ui opens a local page with the live release, rollout, beta
channel and downloads, and buttons for checks, previews, the webhook test, rollout, announcements and yank (each
of the last three shows the exact command and asks first). It runs only on your machine and needs the one-time
key in the address it prints, so other websites and programs can’t press its buttons.
Working demo: examples/notify-receiver is a small Node server with no dependencies that verifies the signature and forwards each release to Slack, Discord or your own push gateway. Run it locally in two minutes, then deploy it behind HTTPS.
3. Your servers poll
https://github.com/OWNER/REPO/releases/latest/download/latest.json always points at the newest release. Poll it
from a cron job, or mirror it to your CDN and point clients there:
- CLI:
<NAME>_UPDATE_MANIFEST=https://updates.example.com/latest.json - Swift:
Updater.manifestURL = …and add the host toUpdater.allowedHosts - Installer:
MANIFEST_URL=… sh install.sh
Clients still check every download against the manifest’s SHA-256. Only HTTPS is accepted.
Send a message to every user (no release needed)
sh scripts/announce.sh "Planned maintenance Sunday 02:00 UTC" --level warning --url https://status.example.com
sh scripts/announce.sh "Please update: 1.x stops syncing in March" --below 2.0.0
sh scripts/announce.sh --clear
The message goes into the newest release’s latest.json, after you confirm. Every installed app and CLI shows it
once, at its next daily check:
- CLIs print one line:
ℹ️,⚠️ NOTICEor⚠️ SECURITY NOTICE. - Swift apps show
AnnouncementBanner, or call youronAnnouncement. - Your webhook receives it with
X-Shipcrate-Event: announcement, so your push servers can send it out right away.
--below 2.0.0 limits it to versions older than 2.0.0. Announcements are text only: clients strip control
characters, keep only https links, and never download or run anything because of a message. A new release clears
the current announcement.
Require an update (minimum version)
sh scripts/min-version.sh 1.4.0 # copies older than 1.4.0 must update (asks first)
sh scripts/min-version.sh --show # what release.conf and the live release say
sh scripts/min-version.sh --clear
sh scripts/release.sh 1.5.0 --min-version 1.4.0 # or set it with a release
For a security fix or a server/API change that old copies can’t work with. Copies below the minimum:
- get
⚠️ UPDATE REQUIRED: app 1.3.2 is no longer supported (minimum 1.4.0)at every check (CLIs), or a red “Update required” button and a critical alert (Swift apps); - are offered the update whatever the staged or timed rollout says.
It’s saved as MIN_VERSION in release.conf (commit it) so every later release keeps it, and written into the live
latest.json and the beta channel right away. The minimum can’t be newer than the live release. For one bad release,
yank.sh is the better tool: it moves its copies back to a good version.
GitHub immutable releases
With immutable releases
turned on, a published release’s files can’t change, and that includes latest.json. shipcrate notices
(IMMUTABLE_RELEASES='auto' in release.conf asks GitHub; on or off to decide yourself) and then:
- writes the editable copies of
latest.jsonandbeta.jsonto ashipcrate-channelbranch (just those files, no history from your code), so rollout, announcements, yank, required updates and the beta channel keep working; - puts
"live": "https://raw.githubusercontent.com/OWNER/REPO/shipcrate-channel/latest.json"in each release’s ownlatest.json. The updaters follow it once, only to that exact branch of this repo, and check its signature too. A mirror or your own manifest URL is never redirected; - keeps the Sigstore bundles and SBOM as a workflow artifact when they can’t be attached after publishing (the provenance and SBOM attestations are on GitHub either way).
shipcrate plan and doctor show which mode a project is in. Copies installed before you turned it on keep reading
the older release’s file until the next release, which carries the pointer.
Beta first, then everyone
Beta channel. Release a pre-release version: sh scripts/release.sh 1.4.0-beta.1. It’s published as a GitHub
pre-release and to the beta manifest (releases/download/channel/beta.json). Stable users and Homebrew don’t see it.
Users opt in with:
- CLI:
<NAME>_CHANNEL=beta - Swift app:
Updater.channel = "beta"(put a toggle in your settings)
Beta users also get every stable release, so they’re never left behind.
Staged rollout. Release to a slice of users, watch, then widen:
sh scripts/release.sh 1.4.0 --rollout 10 # 10% of installed copies see the update notice
sh scripts/rollout.sh 50
sh scripts/rollout.sh 100 # everyone; Homebrew is bumped now
Each copy picks a random number from 0 to 99 once and keeps it on the user’s machine. A copy gets the notice when its
number is below the percentage. Nothing is sent or tracked. Security releases (--security) ignore the percentage,
and a user who runs upgrade themselves always gets the newest version.
Timed rollout. shipcrate release 1.4.0 --rollout-days 7 (or shipcrate rollout 0 --days 7) grows the share
from 0% to 100% over seven days, on each client, from the publish date. You don’t run any follow-up commands, and
shipcrate rollout 100 ends it early.
Signed updates
shipcrate keygen turns them on: every latest.json gets a latest.json.sig (Ed25519). The Swift, Rust, Python
and Node updaters check it with the built-in public key before trusting any version or checksum, so even someone
who could change files on GitHub or your mirror can’t push an update. Verification uses no extra dependencies
(CryptoKit, Node crypto, and small RFC 8032 verifiers in Rust and Python), and it costs nothing.
Keep the private key safe (a password manager is fine). It lives in ~/.config/shipcrate/ and the
SHIPCRATE_SIGNING_KEY repository secret, never in the repository.
Version and changelog from commits
shipcrate changelog reads your commits since the last release and suggests the next version: feat: gives a
minor, fix: a patch, and feat!: or BREAKING CHANGE: a major (a minor before 1.0). It groups them under
Added, Fixed, Changed and Security. --write adds the section to CHANGELOG.md, and shipcrate release auto
uses the suggested version.
How many people downloaded it?
shipcrate stats
This shows each release’s downloads per platform, beta vs stable, and update checks. There’s no tracking and nothing in your app: shipcrate reads the counts GitHub keeps for every release file.
- Archive downloads (e.g.
mytool-macos-arm64.tar.gzof 1.4.0) = installs and upgrades of that version. latest.json/beta.jsondownloads = update checks. Each copy checks at most once a day, so the daily growth is roughly the number of copies in use (stable vs beta).- Counts are running totals, and they restart when a manifest is re-uploaded (by announce, rollout or yank).
Set
STATS_SNAPSHOTS='on'inrelease.confand runshipcrate sync: it adds a daily Stats workflow (only then, so no Actions minutes are used while it’s off) that saves them to astatsbranch; thenshipcrate stats --history stats.csvshows growth per day, e.g. how fast a rollout is being picked up. - Not counted: unique people (two Macs count as two), Homebrew taps, and your own mirrors (use their logs).
Leave out your own downloads. GitHub only keeps one number per file, so it can’t separate your downloads from anyone else’s. Instead, set a zero point:
shipcrate stats --baseline # today's counts are treated as yours; from now on only newer downloads show
shipcrate stats --baseline-clear # back to full totals
The zero point is saved on your machine (~/.config/shipcrate/stats/), and GitHub isn’t changed. Run --baseline
again after your own testing to move it. Better still, don’t count yourself in the first place: test updates
against a local manifest (shipcrate notify-test, shipcrate demo, or <NAME>_UPDATE_MANIFEST=http://127.0.0.1:8000/latest.json)
instead of GitHub.
Any repository works, even one not set up with shipcrate: shipcrate stats --repo owner/name.
Rolling back a bad release
| Who | Command | What happens |
|---|---|---|
| One user | mytool upgrade --rollback |
Swaps back the previous binary the upgrade kept |
| You, for everyone | sh scripts/yank.sh 1.4.0 [--to 1.3.2] [--reason "…"] |
See below |
| You, fixing forward | sh scripts/release.sh 1.4.1 |
The normal path once you have a fix |
yank.sh, after you confirm:
- Marks
v1.4.0as [YANKED] with a warning at the top of its notes. - Makes
v1.3.2“latest” again, with"yanked": ["1.4.0"]in itslatest.json. - Copies on 1.4.0 are told the version was pulled.
upgrademoves them to 1.3.2 as a normal verified install, checksum included. - Sends Homebrew and the beta channel back to 1.3.2, and calls your webhook with
X-Shipcrate-Event: yank.
Nothing is deleted: the 1.4.0 files stay downloadable, and the git tag stays where it is.
latest.json format (schema 1)
{
"schema": 1, "name": "msh", "version": "0.3.0", "tag": "v0.3.0",
"published": "2026-11-20T10:00:00Z", "security": false,
"page": "https://github.com/OWNER/REPO/releases/tag/v0.3.0",
"notes": "## What's new\n…",
"announcement": { "id": "20261120T090000Z", "level": "info", "message": "…", "url": "https://…", "below": "" },
"rollout": 25,
"yanked": ["0.2.9"],
"min_version": "0.2.0",
"assets": {
"macos-arm64": { "name": "msh-macos-arm64.tar.gz", "url": "https://github.com/…", "sha256": "…" },
"linux-x64": { "name": "msh-linux-x64.tar.gz", "url": "https://github.com/…", "sha256": "…" }
}
}
The asset keys are targets: macos-arm64, macos-x64, linux-x64, linux-arm64, windows-x64, windows-arm64, plus
macos (an app) or any (one platform-independent build). Clients look for <os>-<arch> first, then <os>, then any.