Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(upgrade): print info links for Deno 2 RC releases #25225

Merged
merged 13 commits into from
Aug 30, 2024
Prev Previous commit
Next Next commit
check for blog post
  • Loading branch information
bartlomieju committed Aug 26, 2024
commit 3315a48a06c627d87fe8056a824da4debef1578e
21 changes: 19 additions & 2 deletions cli/tools/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ fn get_minor_version(version: &str) -> &str {
version.rsplitn(2, '.').collect::<Vec<&str>>()[1]
}

fn print_release_notes(current_version: &str, new_version: &str) {
async fn print_release_notes(
current_version: &str,
new_version: &str,
client: &HttpClient,
) {
let Ok(current_semver) = Version::parse_standard(current_version) else {
return;
};
Expand All @@ -256,6 +260,17 @@ fn print_release_notes(current_version: &str, new_version: &str) {
colors::gray("If you find a bug, please report to:"),
colors::bold("https://github.com/denoland/deno/issues/new")
);

// Check if there's blog post entry for this release
let blog_url_str = format!("https://deno.com/blog/v{}", new_version);
let blog_url = Url::parse(&blog_url_str).unwrap();
if client.download(blog_url).await.is_ok() {
log::info!(
"{}\n\n {}\n",
colors::gray("Blog post:"),
colors::bold(blog_url_str)
);
}
return;
}

Expand Down Expand Up @@ -541,7 +556,9 @@ pub async fn upgrade(
print_release_notes(
version::DENO_VERSION_INFO.deno,
&selected_version_to_upgrade.version_or_hash,
);
&client,
)
.await;
}
drop(temp_dir);
return Ok(());
Expand Down