Skip to content

Publishing crates

Publishing targets a publish registry configured as a cargo registry (see Getting started for the .cargo/config.toml setup). CI can publish without a stored token at all: see Trusted publishing.

Terminal window
cargo publish --registry acme

Haven records who published what: the publishing identity is stored with the version and shown on the crate page, and the publish lands in the audit log.

Some rule failures can never be fixed on the version they arrive with: the VCS state and the declared license are frozen into the tarball at package time, and an untrusted publisher needs owner trust, not a different tarball. For those rules the policy can (and for vcs and license, by default does) reject the publish outright: cargo prints the reason as an error, nothing is stored, and the version number stays free. Fix the problem, or get trusted, and publish the same version again. See the Policy rules reference.

If the registry has a policy, the accepted version may start out held: stored, visible to owners on the crate page and in the registry’s Held tab, but not resolvable by consumers until it promotes. The crate page lists exactly which rules are holding it.

Held does not break your own release pipeline: for a short while after the publish (about ten minutes, sliding while in use, half an hour at most), the token that published keeps seeing that exact version in the index and can download it. Cargo’s post-publish availability check passes, and a workspace release can build and publish crates that depend on the one just held. Everyone else, including other tokens of the same org, sees the version only once it promotes.

Version numbers are immutable. If a version is accepted but held by a rule that can never pass for that tarball (a permanent hold, possible when the rule’s reject toggle is off), that version number is spent: only an owner waiver can ship it, and a fixed release needs the next version number. The publish response and the Held tab both say so explicitly.

Terminal window
cargo yank --version 1.2.3 --registry acme
cargo yank --version 1.2.3 --undo --registry acme

Yanking works as on crates.io: existing lockfiles keep resolving, new resolutions skip the yanked version. Both actions are audited.

Terminal window
cargo search demo --registry acme

Search is scoped to the one registry, same as the search box on the registry page.

cargo owners is not supported. Access is managed through registry owners, package owners, and grants on the Haven API and UI, not through cargo’s owner commands. A crate can also be created before its first publish so that access is in place before any version exists.