table of contents
CARGO-PUBLISH(1) | CARGO-PUBLISH(1) |
NAME¶
cargo-publish - Upload a package to the registry
SYNOPSIS¶
cargo publish [OPTIONS]
DESCRIPTION¶
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:
This command requires you to be authenticated with either the --token option or using cargo-login(1).
See the reference <https://doc.rust-lang.org/cargo/reference/publishing.html> for more details about packaging and publishing.
OPTIONS¶
Publish Options¶
--dry-run
--token TOKEN
Cargo config <https://doc.rust-lang.org/cargo/reference/config.html> environment variables can be used to override the tokens stored in the credentials file. The token for crates.io may be specified with the CARGO_REGISTRY_TOKEN environment variable. Tokens for other registries may be specified with environment variables of the form CARGO_REGISTRIES_NAME_TOKEN where NAME is the name of the registry in all capital letters.
--no-verify
--allow-dirty
--index INDEX
--registry REGISTRY
Compilation Options¶
--target TRIPLE
This may also be specified with the build.target config value <https://doc.rust-lang.org/cargo/reference/config.html>.
Note that specifying this flag makes Cargo run in a different mode where the target artifacts are placed in a separate directory. See the build cache <https://doc.rust-lang.org/cargo/guide/build-cache.html> documentation for more details.
--target-dir DIRECTORY
Feature Selection¶
The feature flags allow you to control the enabled features for the "current" package. The "current" package is the package in the current directory, or the one specified in --manifest-path. If running in the root of a virtual workspace, then the default features are selected for all workspace members, or all features if --all-features is specified.
When no feature options are given, the default feature is activated for every selected package.
--features FEATURES
--all-features
--no-default-features
Manifest Options¶
--manifest-path PATH
--frozen, --locked
These may be used in environments where you want to assert that the Cargo.lock file is up-to-date (such as a CI build) or want to avoid network access.
--offline
Beware that this may result in different dependency resolution than online mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.
May also be specified with the net.offline config value <https://doc.rust-lang.org/cargo/reference/config.html>.
Miscellaneous Options¶
-j N, --jobs N
Display Options¶
-v, --verbose
-q, --quiet
--color WHEN
May also be specified with the term.color config value <https://doc.rust-lang.org/cargo/reference/config.html>.
Common Options¶
+TOOLCHAIN
-h, --help
-Z FLAG...
ENVIRONMENT¶
See the reference <https://doc.rust-lang.org/cargo/reference/environment-variables.html> for details on environment variables that Cargo reads.
EXIT STATUS¶
0
101
EXAMPLES¶
cargo publish
SEE ALSO¶
2019-09-05 |