xtask: Disallow releasing a macro crate without its parent crate

This commit is contained in:
Jonas Platte 2021-04-17 18:57:19 +02:00
parent 32398d187b
commit 233b473041
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -62,6 +62,18 @@ impl ReleaseTask {
let prerelease = self.version.is_prerelease();
let publish_only = self.package.name == "ruma-identifiers-validation";
if let Some(name) = self.package.name.strip_suffix("-macros") {
return Err(format!(
"Macro crates are always released together with their parent crate.\n\
To release both {main_cr} and {macro_cr}, simply run\n\
\n\
cargo xtask release {main_cr}",
main_cr = name,
macro_cr = self.package.name,
)
.into());
}
println!(
"Starting {} for {}…",
match prerelease {