This commit is contained in:
Aleksey Kladov 2020-07-07 18:12:22 +02:00
parent 695f1a9af8
commit faa65d7856
2 changed files with 19 additions and 1 deletions

View file

@ -17,7 +17,7 @@ use xtask::{
install::{ClientOpt, InstallCmd, ServerOpt},
not_bash::pushd,
pre_commit, project_root,
release::ReleaseCmd,
release::{PromoteCmd, ReleaseCmd},
run_clippy, run_fuzzer, run_pre_cache, run_rustfmt, Result,
};
@ -105,6 +105,11 @@ FLAGS:
args.finish()?;
ReleaseCmd { dry_run }.run()
}
"promote" => {
let dry_run = args.contains("--dry-run");
args.finish()?;
PromoteCmd { dry_run }.run()
}
"dist" => {
let nightly = args.contains("--nightly");
let client_version: Option<String> = args.opt_value_from_str("--client")?;

View file

@ -69,3 +69,16 @@ Release: release:{}[]
Ok(())
}
}
pub struct PromoteCmd {
pub dry_run: bool,
}
impl PromoteCmd {
pub fn run(self) -> Result<()> {
run!("git switch release")?;
run!("git fetch upstream")?;
run!("git reset --hard upstream/release")?;
Ok(())
}
}