diff options
-rw-r--r-- | xtask/src/main.rs | 7 | ||||
-rw-r--r-- | xtask/src/release.rs | 13 |
2 files changed, 19 insertions, 1 deletions
diff --git a/xtask/src/main.rs b/xtask/src/main.rs index f7a79362d..f447613d4 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs | |||
@@ -17,7 +17,7 @@ use xtask::{ | |||
17 | install::{ClientOpt, InstallCmd, ServerOpt}, | 17 | install::{ClientOpt, InstallCmd, ServerOpt}, |
18 | not_bash::pushd, | 18 | not_bash::pushd, |
19 | pre_commit, project_root, | 19 | pre_commit, project_root, |
20 | release::ReleaseCmd, | 20 | release::{PromoteCmd, ReleaseCmd}, |
21 | run_clippy, run_fuzzer, run_pre_cache, run_rustfmt, Result, | 21 | run_clippy, run_fuzzer, run_pre_cache, run_rustfmt, Result, |
22 | }; | 22 | }; |
23 | 23 | ||
@@ -105,6 +105,11 @@ FLAGS: | |||
105 | args.finish()?; | 105 | args.finish()?; |
106 | ReleaseCmd { dry_run }.run() | 106 | ReleaseCmd { dry_run }.run() |
107 | } | 107 | } |
108 | "promote" => { | ||
109 | let dry_run = args.contains("--dry-run"); | ||
110 | args.finish()?; | ||
111 | PromoteCmd { dry_run }.run() | ||
112 | } | ||
108 | "dist" => { | 113 | "dist" => { |
109 | let nightly = args.contains("--nightly"); | 114 | let nightly = args.contains("--nightly"); |
110 | let client_version: Option<String> = args.opt_value_from_str("--client")?; | 115 | let client_version: Option<String> = args.opt_value_from_str("--client")?; |
diff --git a/xtask/src/release.rs b/xtask/src/release.rs index 46992c1ca..d2d769099 100644 --- a/xtask/src/release.rs +++ b/xtask/src/release.rs | |||
@@ -69,3 +69,16 @@ Release: release:{}[] | |||
69 | Ok(()) | 69 | Ok(()) |
70 | } | 70 | } |
71 | } | 71 | } |
72 | |||
73 | pub struct PromoteCmd { | ||
74 | pub dry_run: bool, | ||
75 | } | ||
76 | |||
77 | impl PromoteCmd { | ||
78 | pub fn run(self) -> Result<()> { | ||
79 | run!("git switch release")?; | ||
80 | run!("git fetch upstream")?; | ||
81 | run!("git reset --hard upstream/release")?; | ||
82 | Ok(()) | ||
83 | } | ||
84 | } | ||