table of contents
CARGO-PUBLISH(1) | CARGO-PUBLISH(1) |
NAME¶
cargo-publish - Upload a package to the registrySYNOPSIS¶
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 TRIPLEThis 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¶
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 NDisplay 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¶
-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¶
0101
EXAMPLES¶
cargo publish
SEE ALSO¶
cargo(1), cargo-package(1), cargo-login(1)2019-09-05 |