diff options
Diffstat (limited to 'xtask/src/release.rs')
-rw-r--r-- | xtask/src/release.rs | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/xtask/src/release.rs b/xtask/src/release.rs index dde5d14ee..22bb50467 100644 --- a/xtask/src/release.rs +++ b/xtask/src/release.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use std::fmt::Write; | 1 | mod changelog; |
2 | 2 | ||
3 | use xshell::{cmd, cp, pushd, read_dir, write_file}; | 3 | use xshell::{cmd, cp, pushd, read_dir, write_file}; |
4 | 4 | ||
@@ -38,42 +38,7 @@ impl flags::Release { | |||
38 | let tags = cmd!("git tag --list").read()?; | 38 | let tags = cmd!("git tag --list").read()?; |
39 | let prev_tag = tags.lines().filter(|line| is_release_tag(line)).last().unwrap(); | 39 | let prev_tag = tags.lines().filter(|line| is_release_tag(line)).last().unwrap(); |
40 | 40 | ||
41 | let git_log = cmd!("git log {prev_tag}..HEAD --merges --reverse").read()?; | 41 | let contents = changelog::get_changelog(changelog_n, &commit, prev_tag, &today)?; |
42 | let mut git_log_summary = String::new(); | ||
43 | for line in git_log.lines() { | ||
44 | let line = line.trim_start(); | ||
45 | if let Some(p) = line.find(':') { | ||
46 | if let Ok(pr) = line[..p].parse::<u32>() { | ||
47 | writeln!(git_log_summary, "* pr:{}[]{}", pr, &line[p + 1..]).unwrap(); | ||
48 | } | ||
49 | } | ||
50 | } | ||
51 | |||
52 | let contents = format!( | ||
53 | "\ | ||
54 | = Changelog #{} | ||
55 | :sectanchors: | ||
56 | :page-layout: post | ||
57 | |||
58 | Commit: commit:{}[] + | ||
59 | Release: release:{}[] | ||
60 | |||
61 | == Sponsors | ||
62 | |||
63 | **Become a sponsor:** On https://opencollective.com/rust-analyzer/[OpenCollective] or | ||
64 | https://github.com/sponsors/rust-analyzer[GitHub Sponsors]. | ||
65 | |||
66 | == New Features | ||
67 | |||
68 | {} | ||
69 | |||
70 | == Fixes | ||
71 | |||
72 | == Internal Improvements | ||
73 | ", | ||
74 | changelog_n, commit, today, git_log_summary | ||
75 | ); | ||
76 | |||
77 | let path = changelog_dir.join(format!("{}-changelog-{}.adoc", today, changelog_n)); | 42 | let path = changelog_dir.join(format!("{}-changelog-{}.adoc", today, changelog_n)); |
78 | write_file(&path, &contents)?; | 43 | write_file(&path, &contents)?; |
79 | 44 | ||