A safer version of cargo publish.
cargo safe-publish performs the following steps to make your publication process more secure:
cargo safe-publishuses thegixto perform additionally git checks to verify that only expected files are included in your published cratecargo safe-publishsplit up the actual publication process into a call tocargo publish --dry-runandcargo publish --no-verify. The former command performs the verification build to make sure that the published source code is actually be able compile. After thiscargoaborts the publication process.cargo safe-publishthen removes the compressed.cratefile. Finallycargo publish --no-verifywill recreate the compressed.cratefile and upload it without a verification build. This removes the possibility for build scripts to overwrite that file.cargo safe-publishre-downloads the published crate, right after the publication process and compares the published content. It will report any difference it detect
See the announcement blog post for details.
cargo safe-publish can be installed as pre-build binary via cargo binstall cargo-safe-publish or via the following scripts:
Linux/MacOS:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/weiznich/cargo-safe-publish/releases/latest/download/cargo-safe-publish-installer.sh | shWindows:
powershell -ExecutionPolicy Bypass -c "irm https://github.com/weiznich/cargo-safe-publish/releases/latest/download/cargo-safe-publish-installer.ps1 | iex"Alternatively you can build it from source via cargo install --locked cargo-safe-publish.
Licensed under GPL-2 or later