9 releases (4 breaking)
|0.5.3||Jun 16, 2019|
|0.5.2||Jun 16, 2019|
|0.5.1||Dec 30, 2018|
|0.4.1||Dec 26, 2018|
|0.1.0||Dec 23, 2018|
#329 in Cargo plugins
129 downloads per month
Use at your own risk.
This tool scans the current workspace, builds every package as if it was published and publishes the ones that do not exist yet on crates.io. If at any point the validation fails it will stop.
Validation consists of two phases:
- Package & normalize all packages; replace version dependencies for crates that will be published with paths and try building every package.
- If the first pass succeeds, publish all packages in the correct order. This will verify a second time, and should ideally never fail. However, it's better to be safe.
If an error is only detected in phase 2 (which should not happen), half of the workspace will be published (and build
successfully), the other half won't be on
crates.io. This is definitely better than having broken packages on
cargo install cargo-publish-all cargo-publish-all
Note that you need to confirm the "publishing plan" by entering "y". If you don't want this, specify
Since this tool is still in its early phase, it may not always work as expected. Thus, you can use
to make sure it behaves as expected, without pushing to crates.io:
Note: This will always fail for the second crate, which is a known issue. You can still see what it would do, though. This should be improved in the future.
Showing more output
cargo-publish-all will hide all output except errors and high-level status messages since the output
will become quite big. You can change that using the
There is a docker image for using
cargo-publish-all. It can be accessed using
Note that you should have an environment variable
CRATES_IO_TOKEN defined (and protected!).
crates.io: image: registry.gitlab.com/torkleyy/cargo-publish-all:latest stage: deploy script: - cargo-publish-all --token $CRATES_IO_TOKEN --yes only: refs: - master
This will allow everybody with write access to trigger a push to crates.io. Also note that secret varibles are not masked and can be revealed by merging a changed script.
cargo-publish-all --help cargo-publish-all 0.2 Thomas Schaller <firstname.lastname@example.org> Upload workspace packages to crates.io USAGE: cargo-publish-all [FLAGS] [OPTIONS] FLAGS: --allow-dirty Allow dirty working directories to be packaged --dry-run Perform all checks without uploading -h, --help Prints help information --manifest-path Path to Cargo.toml -V, --version Prints version information --verbose Show more output --yes Confirm publishing without interaction OPTIONS: --token <TOKEN> Token to use when uploading
$ cargo-publish-all Resolving workspace Fetching crates.io versions Skipping crate `nitric-lock-internals`, version already published Skipping crate `nitric`, version already published Verifying workspace Verifying nitric-lock-internals Verifying nitric-lock Verifying nitric Summary: nitric-lock-internals: 0.0.1 (skipped) nitric-lock: 0.0.1 nitric: 0.0.1 (skipped) Continue? [y/N] y Publishing workspace Skipping nitric-lock-internals Publishing nitric-lock Skipping nitric
The high-level behavior can be described as follows:
Publishes every unpublished crate of the current workspace, provided all members of the workspace will build when pulled from crates.io.
This means you can simply run this on CI and it will publish crates as soon as the version number is bumped.
Note: the following properties should be tested in the future
cargo-publish-alla second time should have no effect
cargo-publish-allfor a single-crate workspace is equivalent to
- Proper logging, no use of
- show how versions are bumped (
- bumping older versions (how to display this?)
- try merging this into Cargo
- maybe too opinionated?