Docs

Integrating

Bring shipcrate into an existing project, release process or notification system.

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:

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:

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:

  1. Sync only from shipcrate releases. shipcrate sync refreshes shipcrate’s own files (scripts/, tests/shipcrate/, .githooks/, updater/) and records SHIPCRATE_VERSION in release.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.
  2. Beta first. If shipcrate’s code or the updater changed since the last stable release, release.sh asks for a beta of that version first (X.Y.Z-beta.1). Only testers with the beta channel on get it.
  3. Prove the update path. sh scripts/update-path-test.sh X.Y.Z downloads 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.sh asks for a pass on the exact commit you release.
  4. Roll out slowly. Those releases roll out over SAFE_ROLLOUT_DAYS (7 by default). scripts/yank.sh stays ready if something goes wrong.
  5. Keep the old download names. release.sh refuses a release that drops a file name the last release had, so older updaters, installers and Homebrew keep working.
  6. 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.

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.

  1. Add repository secrets RELEASE_WEBHOOK_URL (https) and, recommended, RELEASE_WEBHOOK_SECRET.
  2. The release workflow (or release.sh for local builds) calls scripts/notify.sh after publishing.
  3. 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:

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:

--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:

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:

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:

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.

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:

  1. Marks v1.4.0 as [YANKED] with a warning at the top of its notes.
  2. Makes v1.3.2 “latest” again, with "yanked": ["1.4.0"] in its latest.json.
  3. Copies on 1.4.0 are told the version was pulled. upgrade moves them to 1.3.2 as a normal verified install, checksum included.
  4. 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.