Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/auto_update_ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ gpui.workspace = true
http_client.workspace = true
markdown_preview.workspace = true
release_channel.workspace = true
semver.workspace = true
serde.workspace = true
serde_json.workspace = true
smol.workspace = true
Expand Down
4 changes: 3 additions & 1 deletion crates/auto_update_ui/src/auto_update_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ pub fn notify_if_app_was_updated(cx: &mut App) {
let should_show_notification = should_show_notification.await?;
if should_show_notification {
cx.update(|cx| {
let version = updater.read(cx).current_version();
let mut version = updater.read(cx).current_version();
version.build = semver::BuildMetadata::EMPTY;
version.pre = semver::Prerelease::EMPTY;
let app_name = ReleaseChannel::global(cx).display_name();
show_app_notification(
NotificationId::unique::<UpdateNotification>(),
Expand Down
12 changes: 10 additions & 2 deletions crates/release_channel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,19 @@ impl AppVersion {
} else {
pkg_version.parse().expect("invalid version in Cargo.toml")
};
let mut pre = String::from(RELEASE_CHANNEL.dev_name());

if let Some(build_id) = build_id {
version.pre = semver::Prerelease::new(&build_id).expect("Invalid build identifier");
pre.push('.');
pre.push_str(&build_id);
}

if let Some(sha) = commit_sha {
version.build = semver::BuildMetadata::new(&sha.0).expect("Invalid build metadata");
pre.push('.');
pre.push_str(&sha.0);
}
if let Ok(build) = semver::BuildMetadata::new(&pre) {
version.build = build;
}

version
Expand Down
Loading