GitHub Releases are the distribution authority. cargo-dist 0.32.0 builds four
archives, per-archive and unified SHA-256 checksums, a shell installer, source
tarball, and GitHub attestations. It does not build or push a Homebrew formula:
phall1/homebrew-tap renders Formula/phig.rb itself from tools/phig.json.
A phig-release dispatch updates it as soon as the GitHub Release lists its
archives; a fifteen-minute poll is the backup if the dispatch is skipped.
release-please (.github/workflows/release-please.yml, configured in
.github/release-please/) turns releases into a single PR merge:
- Conventional commits land on
main(feat:,fix:,perf:, ...). - release-please opens (and keeps up to date) a release PR that bumps
Cargo.toml,Cargo.lock,tests/fixtures/version.json, andCHANGELOG.md. Features bump the minor version, fixes bump the patch. - Merge the release PR. That is the whole release decision.
.github/workflows/release-tag.ymlpushes thevX.Y.Ztag on the merged release PR usingRELEASE_PLEASE_TOKEN.- The tag push triggers cargo-dist's Release workflow (archives, checksums,
shell installer, attestations, GitHub Release) and
.github/workflows/publish-crates.yml(cargo publish --locked). - When the Release workflow finishes,
.github/workflows/notify-tap.ymldispatchesphig-releasetophall1/homebrew-taponce the Darwin ARM archive is listed, soFormula/phig.rbupdates immediately. The tap still re-resolves every fifteen minutes if the dispatch is skipped or delayed.
Do not push a manual version tag while the automation is healthy: a release touchpoint outside a release PR skips review, and the tag workflow may race the crates.io publish. If a manual release is genuinely needed, follow the manual path below and expect the two tag-push workflows to publish automatically.
There are two important constraints behind this design:
- Tags pushed with the default
GITHUB_TOKENdo not trigger further workflow runs, so tag creation must use a real token (RELEASE_PLEASE_TOKEN) for cargo-dist and the crates.io publish to fire at all. skip-github-release: truekeeps release-please from creating the tag or a GitHub Release itself; cargo-dist stays the single creator of the GitHub Release on the tag push.- Because release-please does not create the release, it also never relabels
the merged release PR. It will not open the next release PR while a merged
one still carries
autorelease: pending, sorelease-tagflips that label toautorelease: taggedafter pushing the tag. If release-please logs "untagged, merged release PRs outstanding", relabel that PR by hand:gh pr edit N --remove-label "autorelease: pending" --add-label "autorelease: tagged".
The phall1/phig repository must have Actions enabled. GitHub's generated
GITHUB_TOKEN creates releases and attestations. The tap still reads this
repository's public releases under its own token and never trusts a checksum
from the dispatch payload. Private vulnerability reporting should be enabled.
Three repository secrets are used by the automated path:
RELEASE_PLEASE_TOKEN— a personal access token (classic withrepo, or fine-grained withContents: Read and write) used by release-please to open release PRs and byrelease-tagto push the version tag. A PAT is required because tags created withGITHUB_TOKENdo not trigger downstream workflows.CARGO_REGISTRY_TOKEN— a crates.io API token forpublish-crates. Prefer a granular token scoped tophig-cliwith an expiry over a full-account token.HOMEBREW_TAP_TOKEN— a token that canrepository_dispatchonphall1/homebrew-tap. If it is unset, Formula/phig.rb still updates on the tap's fifteen-minute poll; the secret only buys immediacy.
-
Merge conventional-commit changes to
main. Prefer the commit typesfeat:,fix:,perf:, andchore:;docs:/test:/ci:/build:commits are hidden from the generated changelog. -
When a release PR titled
chore(main): release X.Y.Zis open, merge it. Do not merge two release PRs back to back; each merge tags immediately. -
Wait for the tag-push workflows. Verify the GitHub Release and the crates.io publish:
gh release view vX.Y.Z --repo phall1/phig gh release download vX.Y.Z --repo phall1/phig --dir /tmp/phig-release (cd /tmp/phig-release && shasum -a 256 -c phig-cli-aarch64-apple-darwin.tar.xz.sha256) gh attestation verify /tmp/phig-release/phig-cli-aarch64-apple-darwin.tar.xz \ --repo phall1/phig cargo search phig-cli --limit 1 -
Confirm the Notify Homebrew tap workflow ran (or wait up to fifteen minutes for the poll), then
brew update && brew install phall1/tap/phigandphig update --checkin a clean home. -
If a workflow failed, see Failure and recovery; never push a second tag for the same version.
Use this path when the automated path cannot (workflow breakage, first-time
runoff, a prerelease that must stay out of crates.io). A manual cut is a
prepared commit on main, then a tag; the release-tag and publish-crates
workflows still fire on the tag push, so keep Cargo.toml at the intended
version in the commit you tag.
-
Update
CHANGELOG.md, setCargo.tomlto the release version, and refreshCargo.lock. -
Run the complete local gate:
just check cargo deny check shellcheck install.sh scripts/*.sh cargo build --release --locked dist generate --check dist plan cargo package --locked cargo publish --dry-run --allow-dirty scripts/benchmark.sh /tmp/phig-benchmark 1000 --jsonOn an ARM64 Mac, rehearse the real native archive and installer. The local manifest must be saved under
target/distribbefore the global installer is generated, or the embedded checksum may describe an older archive:mkdir -p target/distrib local_manifest="$(mktemp)" global_manifest="$(mktemp)" dist build --allow-dirty --artifacts=local --target=aarch64-apple-darwin \ --output-format=json >"$local_manifest" cp "$local_manifest" target/distrib/aarch64-apple-darwin-dist-manifest.json dist build --allow-dirty --artifacts=global --output-format=json \ >"$global_manifest" cp "$global_manifest" target/distrib/global-dist-manifest.json rm -f "$local_manifest" "$global_manifest" prefix="$(mktemp -d)" PHIG_CLI_UNMANAGED_INSTALL="$prefix/bin" \ PHIG_CLI_DOWNLOAD_URL="file://$PWD/target/distrib" \ sh target/distrib/phig-cli-installer.sh "$prefix/bin/phig" version --json
-
Test
install.sh,phig update --check, the PTY selector, and the primary views on macOS and Linux CI. Reviewgit diffand ensure the tree is clean. -
Merge the release commit to
mainand wait for CI. cargo-dist PRs validate the release plan (pr-run-mode = "plan"). Tags build all four target archives. Complete the local rehearsal above before tagging.
The local benchmark script gates warm snapshot p95 at 500 ms by default, which
a warm shared dev machine can exceed regardless of release content. When that
happens, compare the same fixture against the previous release tag's binary
(the current release should not be slower) and re-run with CI's gates,
--snapshot-p95-ms 1000 --first-frame-p95-ms 1500; CI's Linux gate is the
release gate.
Every PR and push to main runs format, strict Clippy, documentation tests,
shell lint, dependency policy, crate packaging, and all-feature tests on
ubuntu-latest and macos-latest. The performance regression gate and a
release build run only on Linux. macOS checks the 12.0 deployment floor on the
debug binary (MACOSX_DEPLOYMENT_TARGET applies to every profile). Local
just check is useful fast feedback; Actions also validates the pinned
toolchain on both operating systems.
cargo-dist's generated Release workflow validates the plan on every PR and
builds all four target archives on version tags. Apple artifact jobs use
macos-latest; Linux artifact jobs stay on ubuntu-22.04 so the glibc 2.31
floor stays real. Regenerate the workflow with dist generate after changing
dist settings.
The local Beads pre-push hook performs issue bookkeeping; it does not run Rust
tests. Its default timeout is 300 seconds. BEADS_HOOK_TIMEOUT=15 git push
limits that bookkeeping wait without suppressing Actions.
The version tag must exactly match the Cargo package version:
git tag -s v1.1.1 -m 'phig 1.1.1'
git push origin v1.1.1A signed tag is preferred; an annotated tag is acceptable only when signing is
unavailable and the release record documents that exception. Tag publication
starts .github/workflows/release.yml. Do not manually create a competing
release.
After the workflow succeeds:
gh release view v1.1.1 --repo phall1/phig
gh release download v1.1.1 --repo phall1/phig --dir /tmp/phig-release
(cd /tmp/phig-release && shasum -a 256 -c phig-cli-aarch64-apple-darwin.tar.xz.sha256)
gh attestation verify /tmp/phig-release/phig-cli-aarch64-apple-darwin.tar.xz \
--repo phall1/phigTest both public onboarding routes in clean temporary homes:
env HOME="$(mktemp -d)" PATH="/usr/bin:/bin:/usr/sbin:/sbin" \
/bin/sh -c 'curl --proto "=https" --tlsv1.2 -LsSf https://raw.githubusercontent.com/phall1/phig/main/install.sh | sh'
brew update
brew install phall1/tap/phig
phig version
phig update --checkThe tap updates from the phig-release dispatch as soon as the GitHub Release
lists its archives, and the fifteen-minute poll is the backup. Once either has
run, verify Formula/phig.rb in the tap points to the new release and that its
CI is healthy. The crates.io route publishes through publish-crates on the same tag
push; on a manual cut, confirm it in the run logs:
gh run list --workflow publish-crates --limit 1
cargo search phig-cli --limit 1
CARGO_HOME="$(mktemp -d)" cargo install phig-cli --version 1.1.1 --lockedThe release is not complete while the README's Cargo command is unavailable. Publishing to crates.io and pushing a tag are irreversible external actions; each requires maintainer authority.
Never move or replace a published version tag. cargo-dist may leave a visible
GitHub Release with incomplete assets when a tag workflow fails; do not assume it
remains a draft. Stop onboarding, mark the release incomplete, fix the workflow,
and rerun the failed jobs against the same immutable tag. If consumers could
have installed a broken artifact or the tagged source itself is wrong, preserve
the record and publish a patch version instead. A tap that has not caught up is
not a release failure and never blocks one; if it stays stale, run the tap's own
Update packages workflow and read its log. Do not hand-edit the formula or its
checksums.
Release assets are built from tagged source with the root rust-toolchain.toml
pinning Rust 1.88.0; cargo-dist and rustup honor that repository override on each
native runner. They are not claimed bit-for-bit reproducible across different
host machines. .cargo/config.toml pins MACOSX_DEPLOYMENT_TARGET=12.0, and
cargo-dist pins the Linux installer floor to glibc 2.31; both are release-plan
invariants.