xtask: Don't wait after ruma-macros release
Current versions of Cargo do this as part of `cargo publish`.
This commit is contained in:
parent
093c231792
commit
db6acae8a8
@ -161,22 +161,19 @@ impl Package {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Publish this package on crates.io.
|
/// 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);
|
println!("Publishing {} {} on crates.io…", self.name, self.version);
|
||||||
let _dir = pushd(self.manifest_path.parent().unwrap())?;
|
let _dir = pushd(self.manifest_path.parent().unwrap())?;
|
||||||
|
|
||||||
if self.is_published(client)? {
|
if self.is_published(client)? {
|
||||||
if ask_yes_no("This version is already published. Skip this step and continue?")? {
|
if !ask_yes_no("This version is already published. Skip this step and continue?")? {
|
||||||
Ok(false)
|
return Err("Release interrupted by user.".into());
|
||||||
} else {
|
|
||||||
Err("Release interrupted by user.".into())
|
|
||||||
}
|
}
|
||||||
} else {
|
} else if !dry_run {
|
||||||
if !dry_run {
|
|
||||||
cmd!("cargo publish").run()?;
|
cmd!("cargo publish").run()?;
|
||||||
}
|
}
|
||||||
Ok(true)
|
|
||||||
}
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
use std::{
|
use std::io::{stdin, stdout, BufRead, Write};
|
||||||
io::{stdin, stdout, BufRead, Write},
|
|
||||||
thread::sleep,
|
|
||||||
time::Duration,
|
|
||||||
};
|
|
||||||
|
|
||||||
use clap::Args;
|
use clap::Args;
|
||||||
use isahc::{
|
use isahc::{
|
||||||
@ -152,14 +148,7 @@ impl ReleaseTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(m) = macros {
|
if let Some(m) = macros {
|
||||||
let published = m.publish(&self.http_client, self.dry_run)?;
|
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.package.publish(&self.http_client, self.dry_run)?;
|
self.package.publish(&self.http_client, self.dry_run)?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user