axodotdev / cargo-dist

📦 shippable application packaging
https://axodotdev.github.io/cargo-dist/
Apache License 2.0
1.47k stars 66 forks source link

make cargo-dist opt-in for binaries #1113

Closed NicholasLYang closed 3 months ago

NicholasLYang commented 3 months ago

Hi, we're looking to adopt cargo-dist for releasing Turborepo. However, we share a repository with other projects, and therefore have multiple binaries in the workspace. I noticed that you can opt-out for a binary by setting publish = false or dist = false. I was wondering if there's a way to instead make cargo dist opt-in by default, so you have to explicitly annotate publish = true. That way if someone adds a new binary but forgets to annotate it, we won't publish it by accident.

Gankra commented 3 months ago

Indeed, you can! If you set

[workspace.metadata.dist]
dist = false

Then that setting gets inherited by every package, so they have to manually override it with

[package.metadata.dist]
dist = true
NicholasLYang commented 3 months ago

Awesome, thanks!