Publishing to crates.io #
The tang binary is published as the tangled-cli package. It depends on the
public tangled-api and tangled-config workspace crates. xtask is not
published.
Prerequisites #
- Rust 1.88 or newer
- A crates.io account with ownership of
tangled-api,tangled-config, andtangled-cli - A crates.io API token stored as the
CARGO_REGISTRY_TOKENrepository secret - A clean working copy with the
mainbookmark at the release commit
All three published packages share one workspace version. Update
workspace.package.version in Cargo.toml, the internal dependency
requirements, and CHANGELOG.md for a release.
Preflight #
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
cargo xtask codegen --check
cargo publish --workspace --dry-run
cargo package -p tangled-cli --list
cargo publish --workspace packages and verifies the publishable workspace
crates in dependency order using a temporary local registry. This lets the
first release dry run before the internal dependencies exist on crates.io.
Review each package archive before publishing. In particular, verify that the README and both license files are present and that no credentials or local configuration files are included.
Publish #
Push the release commit to main. After the regular checks pass, the final
step in .tangled/workflows/ci.yml runs scripts/publish-crates.sh, which
checks crates.io and publishes each missing workspace crate in dependency order
using CARGO_REGISTRY_TOKEN. Versions that already exist are skipped, so rerunning
the workflow is safe.
After the workflow succeeds, verify installation from the registry in a clean temporary directory:
cargo install tangled-cli --version 0.1.0
tang --version