What comes after `cargo package`?

I need to maintain a private registry as part of my devops pipeline, and so I'd like to separate the packaging and publishing steps.

After I run cargo package I get a *.crate file and as part of my pipeline I'm able to publish these *.crate files as artifacts to my internal devops system.

Next, I want to be able to "release" these .crate files, but I can't seem to find the appropriate command to do so. When I pass the path to the .crate file to --package w/ cargo publish it seems like it's still trying to find the Cargo.toml to build.

Is uploading just a .crate to a private registry not supported?

I don't remember the specific extension for .crate (even though browsing the cargo manual), but it's mere compressed tarball.

At lease, this work, so it's tar.gz I believe.

# replace `ouch d` for your own decompression tool
ouch d -f tar.gz xxx.crate

I don’t think there’s a way to publish a pre-packaged tarball.

However, you can create your own client or cargo sub command for uploading the tarballs. It will require a custom tool instead of cargo publish, but apart from that it can work like any other package when served by the registry afterwards.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.