diff options
author | Mikhail Rakhmanov <[email protected]> | 2020-06-13 07:42:15 +0100 |
---|---|---|
committer | Mikhail Rakhmanov <[email protected]> | 2020-06-13 07:42:15 +0100 |
commit | 16bbf4ab7f132e6e5e5318dccdef9a5d71afdd7f (patch) | |
tree | 4b79fa8c046be56b02427ba843e70cdf3ac05767 /xtask/src/lib.rs | |
parent | eeb8b9e236796da8734ba81a49164864497f7226 (diff) | |
parent | b56ad148db0c69eb279c225f45d324b4e80e7367 (diff) |
Merge branch 'master' into keyword_completion
# Conflicts:
# docs/user/generated_features.adoc
Diffstat (limited to 'xtask/src/lib.rs')
-rw-r--r-- | xtask/src/lib.rs | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 874957885..747654c1f 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | pub mod not_bash; | 5 | pub mod not_bash; |
6 | pub mod install; | 6 | pub mod install; |
7 | pub mod release; | ||
7 | pub mod dist; | 8 | pub mod dist; |
8 | pub mod pre_commit; | 9 | pub mod pre_commit; |
9 | 10 | ||
@@ -19,7 +20,7 @@ use walkdir::{DirEntry, WalkDir}; | |||
19 | 20 | ||
20 | use crate::{ | 21 | use crate::{ |
21 | codegen::Mode, | 22 | codegen::Mode, |
22 | not_bash::{date_iso, fs2, pushd, pushenv, rm_rf, run}, | 23 | not_bash::{fs2, pushd, pushenv, rm_rf, run}, |
23 | }; | 24 | }; |
24 | 25 | ||
25 | pub use anyhow::{bail, Context as _, Result}; | 26 | pub use anyhow::{bail, Context as _, Result}; |
@@ -153,58 +154,6 @@ pub fn run_pre_cache() -> Result<()> { | |||
153 | Ok(()) | 154 | Ok(()) |
154 | } | 155 | } |
155 | 156 | ||
156 | pub fn run_release(dry_run: bool) -> Result<()> { | ||
157 | if !dry_run { | ||
158 | run!("git switch release")?; | ||
159 | run!("git fetch upstream --tags --force")?; | ||
160 | run!("git reset --hard tags/nightly")?; | ||
161 | run!("git push")?; | ||
162 | } | ||
163 | |||
164 | let website_root = project_root().join("../rust-analyzer.github.io"); | ||
165 | let changelog_dir = website_root.join("./thisweek/_posts"); | ||
166 | |||
167 | let today = date_iso()?; | ||
168 | let commit = run!("git rev-parse HEAD")?; | ||
169 | let changelog_n = fs2::read_dir(changelog_dir.as_path())?.count(); | ||
170 | |||
171 | let contents = format!( | ||
172 | "\ | ||
173 | = Changelog #{} | ||
174 | :sectanchors: | ||
175 | :page-layout: post | ||
176 | |||
177 | Commit: commit:{}[] + | ||
178 | Release: release:{}[] | ||
179 | |||
180 | == New Features | ||
181 | |||
182 | * pr:[] . | ||
183 | |||
184 | == Fixes | ||
185 | |||
186 | == Internal Improvements | ||
187 | ", | ||
188 | changelog_n, commit, today | ||
189 | ); | ||
190 | |||
191 | let path = changelog_dir.join(format!("{}-changelog-{}.adoc", today, changelog_n)); | ||
192 | fs2::write(&path, &contents)?; | ||
193 | |||
194 | for &adoc in ["manual.adoc", "generated_features.adoc", "generated_assists.adoc"].iter() { | ||
195 | let src = project_root().join("./docs/user/").join(adoc); | ||
196 | let dst = website_root.join(adoc); | ||
197 | fs2::copy(src, dst)?; | ||
198 | } | ||
199 | |||
200 | let tags = run!("git tag --list"; echo = false)?; | ||
201 | let prev_tag = tags.lines().filter(|line| is_release_tag(line)).last().unwrap(); | ||
202 | |||
203 | println!("\n git log {}..HEAD --merges --reverse", prev_tag); | ||
204 | |||
205 | Ok(()) | ||
206 | } | ||
207 | |||
208 | fn is_release_tag(tag: &str) -> bool { | 157 | fn is_release_tag(tag: &str) -> bool { |
209 | tag.len() == "2020-02-24".len() && tag.starts_with(|c: char| c.is_ascii_digit()) | 158 | tag.len() == "2020-02-24".len() && tag.starts_with(|c: char| c.is_ascii_digit()) |
210 | } | 159 | } |