xtask: Push release commit after cargo publish, together with tag

This commit is contained in:
Jonas Platte 2021-04-17 19:07:52 +02:00
parent 6581eb8606
commit 976b1b8090
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -137,7 +137,11 @@ impl ReleaseTask {
self.package.publish(&self.http_client)?;
let branch = cmd!("git rev-parse --abbrev-ref HEAD").read()?;
if publish_only {
println!("Pushing to remote repository…");
cmd!("git push {remote} {branch}").run()?;
println!("Crate published successfully!");
return Ok(());
}
@ -151,9 +155,9 @@ impl ReleaseTask {
return Ok(());
}
println!("Pushing tag to remote repository…");
println!("Pushing to remote repository…");
if cmd!("git ls-remote --tags {remote} {tag}").read()?.is_empty() {
cmd!("git push {remote} {tag}").run()?;
cmd!("git push {remote} {branch},{tag}").run()?;
} else if !ask_yes_no("This tag has already been pushed. Skip this step and continue?")? {
return Ok(());
}
@ -251,9 +255,6 @@ impl ReleaseTask {
println!("Creating commit…");
cmd!("git commit -a -m {message}").read()?;
println!("Pushing commit…");
cmd!("git push").read()?;
Ok(())
}