xtask: Don't wait after ruma-macros release

Current versions of Cargo do this as part of `cargo publish`.
This commit is contained in:
Jonas Platte 2023-02-02 13:13:36 +01:00
parent 093c231792
commit db6acae8a8
No known key found for this signature in database
GPG Key ID: AAA7A61F696C3E0C
2 changed files with 9 additions and 23 deletions

View File

@ -161,22 +161,19 @@ impl Package {
}
/// Publish this package on crates.io.
pub fn publish(&self, client: &HttpClient, dry_run: bool) -> Result<bool> {
pub fn publish(&self, client: &HttpClient, dry_run: bool) -> Result<()> {
println!("Publishing {} {} on crates.io…", self.name, self.version);
let _dir = pushd(self.manifest_path.parent().unwrap())?;
if self.is_published(client)? {
if ask_yes_no("This version is already published. Skip this step and continue?")? {
Ok(false)
} else {
Err("Release interrupted by user.".into())
if !ask_yes_no("This version is already published. Skip this step and continue?")? {
return Err("Release interrupted by user.".into());
}
} else {
if !dry_run {
cmd!("cargo publish").run()?;
}
Ok(true)
} else if !dry_run {
cmd!("cargo publish").run()?;
}
Ok(())
}
}

View File

@ -1,8 +1,4 @@
use std::{
io::{stdin, stdout, BufRead, Write},
thread::sleep,
time::Duration,
};
use std::io::{stdin, stdout, BufRead, Write};
use clap::Args;
use isahc::{
@ -152,14 +148,7 @@ impl ReleaseTask {
}
if let Some(m) = macros {
let published = m.publish(&self.http_client, self.dry_run)?;
if published && !self.dry_run {
// Crate was published, instead of publishing skipped (because release already
// existed).
println!("Waiting 20 seconds for the release to make it into the crates.io index…");
sleep(Duration::from_secs(20));
}
m.publish(&self.http_client, self.dry_run)?;
}
self.package.publish(&self.http_client, self.dry_run)?;