cargoPublish
cargoPublish :: AttrSet → Effect
Deploys package to crates.io, the Rust community’s crate repository.
Example:
effects.cargoPublish {
secretName = "cargo-api-token";
src = ./.;
}
Example secret:
"cargo-api-token": {
"kind": "Secret",
"data": {
"token": "..."
},
"condition": {
"and": [
{ "isOwner": "my-github-org" },
{ "isRepo": "my-site-repo" }
]
}
}
Parameters
secretName
The secret that will be looked up in secrets.json
.
The data
field must contain a "token"
field, with a string value that is a Cargo API token. To make one, navigate to API tokens and use New Token.
extraPublishArgs
Extra arguments to pass to the cargo publish
invocation.
src
Example: src = ./.;
Path to the source code of the package to publish.
src
is unpacked by the Nixpkgs unpackPhase
.
manifestPath
String containing the path to a Cargo.toml
, default: Cargo.toml
. Relative paths are relative to the unpacked src
.
A store path subpath could be passed instead, bypassing unpackPhase
.
registryURL
Optional registry to publish to. Defaults to cargo’s default behavior, which is to publish to package.publish
or crates.io.
If you use an alternate registry or private registry, you are recommended to store this information in Cargo.toml
.
Note that this must be the backing git repository URL, not a web or API URL.