mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Extract changelog text into the annotation
This commit is contained in:
parent
030d43d68c
commit
7a55f50adf
2
justfile
2
justfile
|
@ -72,7 +72,7 @@ release +args: (_run-tool "release" args)
|
||||||
|
|
||||||
_run-tool +tool:
|
_run-tool +tool:
|
||||||
(cd tools && cargo build)
|
(cd tools && cargo build)
|
||||||
tools/target/debug/tools {{tool}}
|
"$CARGO_TARGET_DIR/debug/tools" {{tool}}
|
||||||
|
|
||||||
_build-rom folder name:
|
_build-rom folder name:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
|
@ -69,16 +69,16 @@ pub fn release(matches: &clap::ArgMatches) -> Result<(), Error> {
|
||||||
.success());
|
.success());
|
||||||
}
|
}
|
||||||
|
|
||||||
// assert!(Command::new("just")
|
assert!(Command::new("just")
|
||||||
// .arg("ci")
|
.arg("ci")
|
||||||
// .current_dir(&root_directory)
|
.current_dir(&root_directory)
|
||||||
// .status()
|
.status()
|
||||||
// .map_err(|_| Error::JustCiFailed)?
|
.map_err(|_| Error::JustCiFailed)?
|
||||||
// .success());
|
.success());
|
||||||
|
|
||||||
let changelog_text = update_changelog(&root_directory, version)?;
|
let changelog_text = update_changelog(&root_directory, version)?;
|
||||||
|
|
||||||
println!("Content of changelog:\n\n{changelog_text}");
|
println!("Content of changelog:\n{changelog_text}");
|
||||||
|
|
||||||
if !dry_run {
|
if !dry_run {
|
||||||
execute_git_command(
|
execute_git_command(
|
||||||
|
@ -92,7 +92,7 @@ pub fn release(matches: &clap::ArgMatches) -> Result<(), Error> {
|
||||||
"-a",
|
"-a",
|
||||||
&version.to_string(),
|
&version.to_string(),
|
||||||
"-m",
|
"-m",
|
||||||
&format!("v{version}"),
|
&format!("#v{version}\n{changelog_text}"),
|
||||||
],
|
],
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
@ -184,9 +184,10 @@ fn update_changelog(root_directory: &Path, new_version: &Version) -> Result<Stri
|
||||||
.find(UNRELEASED_HEADER)
|
.find(UNRELEASED_HEADER)
|
||||||
.ok_or(Error::FailedToParseChangelog)?
|
.ok_or(Error::FailedToParseChangelog)?
|
||||||
+ UNRELEASED_HEADER.len();
|
+ UNRELEASED_HEADER.len();
|
||||||
let unreleased_bit_end = changelog_content
|
let unreleased_bit_end = changelog_content[unreleased_bit_start..]
|
||||||
.find("\n## [") // the start of the next entry
|
.find("\n## [") // the start of the next entry
|
||||||
.ok_or(Error::FailedToParseChangelog)?;
|
.ok_or(Error::FailedToParseChangelog)?
|
||||||
|
+ unreleased_bit_start;
|
||||||
|
|
||||||
let change_content = changelog_content[unreleased_bit_start..unreleased_bit_end].to_owned();
|
let change_content = changelog_content[unreleased_bit_start..unreleased_bit_end].to_owned();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue