src/doc/man/cargo-publish.md
{{*set command="publish"}}
{{set actionverb="Publish"}}
{{~set multitarget=true}}
cargo-publish --- Upload a package to the registry
cargo publish [options]
This command will create a distributable, compressed .crate file with the
source code of the package in the current directory and upload it to a
registry. The default registry is https://crates.io. This performs the
following steps:
package.publish key in the manifest for restrictions on
which registries you are allowed to publish to..crate file by following the steps in {{man "cargo-package" 1}}.This command requires you to be authenticated using {{man "cargo-login" 1}}
or environment variables of the registry.token
and registries.<name>.token config fields.
See the reference for more details about packaging and publishing.
{{#options}}
{{#option "--dry-run" }}
Perform all checks without uploading.
{{/option}}
{{#option "--no-verify" }}
Don't verify the contents by building them.
{{/option}}
{{#option "--allow-dirty" }}
Allow working directories with uncommitted VCS changes to be packaged.
{{/option}}
{{> options-index }}
{{#option "--registry registry"}}
Name of the registry to publish to. Registry names are defined in Cargo
config files. If not specified, and there is a
package.publish field in
Cargo.toml with a single registry, then it will publish to that registry.
Otherwise it will use the default registry, which is defined by the
registry.default config key
which defaults to crates-io.
{{/option}}
{{/options}}
{{> section-package-selection }}
{{#options}}
{{> options-target-triple }}
{{> options-target-dir }}
{{/options}}
{{> section-features }}
{{#options}}
{{> options-manifest-path }}
{{> options-locked }}
{{/options}}
{{#options}} {{> options-jobs }} {{> options-keep-going }} {{/options}}
{{#options}} {{> options-display }} {{/options}}
{{> section-options-common }}
{{> section-environment }}
{{> section-exit-status }}
Publish the current package:
cargo publish
{{man "cargo" 1}}, {{man "cargo-package" 1}}, {{man "cargo-login" 1}}