Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sam0x17 committed Dec 6, 2024
1 parent 8fdfb73 commit dec011f
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions scripts/release_notes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ fn main() {
.iter()
.find(|tag| tag.starts_with("v") && tag.ends_with("-pre-release"))
.expect("could not find a valid testnet tag!"),
Network::Devnet => &"origin/devnet".to_string(),
Network::Devnet => &"devnet-ready".to_string(),
};
println!("Previous release tag: {}", previous_tag);

let branch = env::var("BRANCH").unwrap_or(
match network {
Network::Mainnet => "testnet",
Network::Testnet => "devnet",
Network::Devnet => "devnet",
Network::Mainnet => "origin/testnet",
Network::Testnet => "origin/devnet",
Network::Devnet => "origin/devnet",
}
.to_string(),
);
Expand All @@ -83,25 +83,24 @@ fn main() {
"Generating release notes for all merges since {}...",
previous_tag,
);
let merges = eval(
format!(
"git log --merges --pretty=format:'%s' {}..{}",
branch, previous_tag,
),
false,
)
.unwrap()
.split("\n")
.map(|s| s.trim().to_string())
.filter(|s| {
!s.is_empty()
&& s.starts_with("Merge pull request #")
&& !s.ends_with("from opentensor/devnet-ready")
&& !s.ends_with("from opentensor/testnet-ready")
&& !s.ends_with("from opentensor/devnet")
&& !s.ends_with("from opentensor/testnet")
})
.collect::<Vec<String>>();
let cmd = format!(
"git log --merges --pretty=format:'%s' {}..{}",
branch, previous_tag,
);
println!("$ {}", cmd);
let merges = eval(cmd, false)
.unwrap()
.split("\n")
.map(|s| s.trim().to_string())
.filter(|s| {
!s.is_empty()
&& s.starts_with("Merge pull request #")
&& !s.ends_with("from opentensor/devnet-ready")
&& !s.ends_with("from opentensor/testnet-ready")
&& !s.ends_with("from opentensor/devnet")
&& !s.ends_with("from opentensor/testnet")
})
.collect::<Vec<String>>();

println!("");
println!("Filtered merges:\n{}", merges.join("\n"));
Expand Down

0 comments on commit dec011f

Please sign in to comment.