This document defines the manual release procedure. Pull-request CI never receives crates.io credentials.
The library and CLI use independent versions:
zstdscopeversions the public Rust parser API and inspection model;zstdscope-cliversions command-line behavior and the CLI JSON wire contract.
For project release v0.3.0, publish only zstdscope-cli 0.3.0. The library remains zstdscope 0.2.0 because its parser implementation and public Rust API are unchanged.
- Start from the latest
mainand confirm the worktree is clean. - Confirm the release-preparation PR is merged and
mainCI is green. - Confirm
CHANGELOG.md, README files, package manifests, andCargo.lockdescribe the intended package versions. - Confirm the target package version does not already exist on crates.io.
- Authenticate locally with a least-privilege crates.io token using Cargo's supported credential mechanism.
Do not reuse or overwrite a published crate version or an existing Git tag.
Run from the repository root:
cargo fmt --check
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo test --workspace --all-features --locked
RUSTDOCFLAGS="-D warnings" cargo doc -p zstdscope --all-features --no-deps --locked
cargo test -p zstdscope --no-default-features --locked
rustup target add wasm32-unknown-unknown
cargo check -p zstdscope --target wasm32-unknown-unknown --no-default-features --locked
cargo package -p zstdscope --list --locked
cargo publish -p zstdscope --dry-run --locked
cargo package -p zstdscope-cli --list --locked
cargo publish -p zstdscope-cli --dry-run --lockedThe core dry-run remains a regression gate even when the release publishes only the CLI.
rm -rf target/package /tmp/zstdscope-install
cargo package -p zstdscope-cli --locked
package_dir="$(find target/package -maxdepth 1 -type d -name 'zstdscope-cli-*' -print -quit)"
test -n "$package_dir"
cargo install --path "$package_dir" --locked --root /tmp/zstdscope-install
/tmp/zstdscope-install/bin/zstdscope --version
printf '\x28\xb5\x2f\xfd\x00\x00\x01\x00\x00' > /tmp/minimal.zst
/tmp/zstdscope-install/bin/zstdscope inspect /tmp/minimal.zst
/tmp/zstdscope-install/bin/zstdscope inspect /tmp/minimal.zst --jsonFor v0.3.0, the version command must print:
zstdscope 0.3.0
The JSON output must contain:
{
"schema_version": 1
}Reconfirm the exact package contents and then publish:
cargo publish -p zstdscope-cli --dry-run --locked
cargo publish -p zstdscope-cli --lockedWait for crates.io index propagation, then verify the registry entry:
cargo info zstdscope-cli@0.3.0Install from crates.io into a clean root and repeat the smoke checks:
rm -rf /tmp/zstdscope-crates-io-install
cargo install zstdscope-cli --version 0.3.0 --locked --root /tmp/zstdscope-crates-io-install
/tmp/zstdscope-crates-io-install/bin/zstdscope --version
/tmp/zstdscope-crates-io-install/bin/zstdscope inspect /tmp/minimal.zst
/tmp/zstdscope-crates-io-install/bin/zstdscope inspect /tmp/minimal.zst --jsonTag the exact verified main commit; do not create a release from an unmerged branch commit.
git switch main
git pull --ff-only origin main
git status --short
git tag -a v0.3.0 -m "ZstdScope v0.3.0"
git push origin v0.3.0Create a non-prerelease GitHub Release named ZstdScope v0.3.0. Use the v0.3.0 section of CHANGELOG.md as the release notes and explicitly state:
zstdscope-cli 0.3.0is published on crates.io;zstdscoperemains at0.2.0because its Rust API and parser behavior are unchanged;- CLI JSON schema version 1 is a breaking change from the source-built v0.2 CLI output.
After creating the release, verify that the tag targets the expected main commit and that the repository's latest-release page resolves to v0.3.0.
- If validation fails before publication, fix the repository and repeat all affected gates.
- If crates.io publication fails before acceptance, correct the local cause and retry the same version only when crates.io confirms it was not published.
- If a published crate is critically broken, do not overwrite it. Consider yanking it, prepare a new patch version, document the reason, and preserve the original tag and release history.