releases: Add build number to Nightly builds (#42990)

- **Remove semantic_version crate and use semver instead**
- **Update upload-nightly**


Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Piotr Osiewicz
2025-11-24 13:34:04 +01:00
committed by GitHub
co-authored by Conrad Irwin
parent a0fa5d57c1
commit 2d55c088cc
91 changed files with 372 additions and 419 deletions
+19 -18
View File
@@ -10,11 +10,12 @@ use futures::{
channel::mpsc::{Sender, UnboundedReceiver, UnboundedSender},
select_biased,
};
use gpui::{App, AppContext as _, AsyncApp, SemanticVersion, Task};
use gpui::{App, AppContext as _, AsyncApp, Task};
use parking_lot::Mutex;
use paths::remote_server_dir_relative;
use release_channel::{AppCommitSha, AppVersion, ReleaseChannel};
use release_channel::{AppVersion, ReleaseChannel};
use rpc::proto::Envelope;
use semver::Version;
pub use settings::SshPortForwardOption;
use smol::{
fs,
@@ -515,15 +516,10 @@ impl SshRemoteConnection {
ssh_default_system_shell,
};
let (release_channel, version, commit) = cx.update(|cx| {
(
ReleaseChannel::global(cx),
AppVersion::global(cx),
AppCommitSha::try_global(cx),
)
})?;
let (release_channel, version) =
cx.update(|cx| (ReleaseChannel::global(cx), AppVersion::global(cx)))?;
this.remote_binary_path = Some(
this.ensure_server_binary(&delegate, release_channel, version, commit, cx)
this.ensure_server_binary(&delegate, release_channel, version, cx)
.await?,
);
@@ -534,15 +530,10 @@ impl SshRemoteConnection {
&self,
delegate: &Arc<dyn RemoteClientDelegate>,
release_channel: ReleaseChannel,
version: SemanticVersion,
commit: Option<AppCommitSha>,
version: Version,
cx: &mut AsyncApp,
) -> Result<Arc<RelPath>> {
let version_str = match release_channel {
ReleaseChannel::Nightly => {
let commit = commit.map(|s| s.full()).unwrap_or_default();
format!("{}-{}", version, commit)
}
ReleaseChannel::Dev => "build".to_string(),
_ => version.to_string(),
};
@@ -609,7 +600,12 @@ impl SshRemoteConnection {
);
if !self.socket.connection_options.upload_binary_over_ssh
&& let Some(url) = delegate
.get_download_url(self.ssh_platform, release_channel, wanted_version, cx)
.get_download_url(
self.ssh_platform,
release_channel,
wanted_version.clone(),
cx,
)
.await?
{
match self
@@ -631,7 +627,12 @@ impl SshRemoteConnection {
}
let src_path = delegate
.download_server_binary_locally(self.ssh_platform, release_channel, wanted_version, cx)
.download_server_binary_locally(
self.ssh_platform,
release_channel,
wanted_version.clone(),
cx,
)
.await
.context("downloading server binary locally")?;
self.upload_local_server_binary(&src_path, &tmp_path_gz, delegate, cx)
+7 -16
View File
@@ -6,9 +6,10 @@ use anyhow::{Context, Result, anyhow, bail};
use async_trait::async_trait;
use collections::HashMap;
use futures::channel::mpsc::{Sender, UnboundedReceiver, UnboundedSender};
use gpui::{App, AppContext as _, AsyncApp, SemanticVersion, Task};
use release_channel::{AppCommitSha, AppVersion, ReleaseChannel};
use gpui::{App, AppContext as _, AsyncApp, Task};
use release_channel::{AppVersion, ReleaseChannel};
use rpc::proto::Envelope;
use semver::Version;
use smol::{fs, process};
use std::{
ffi::OsStr,
@@ -62,13 +63,8 @@ impl WslRemoteConnection {
connection_options.distro_name,
connection_options.user
);
let (release_channel, version, commit) = cx.update(|cx| {
(
ReleaseChannel::global(cx),
AppVersion::global(cx),
AppCommitSha::try_global(cx),
)
})?;
let (release_channel, version) =
cx.update(|cx| (ReleaseChannel::global(cx), AppVersion::global(cx)))?;
let mut this = Self {
connection_options,
@@ -94,7 +90,7 @@ impl WslRemoteConnection {
.context("failed detecting platform")?;
log::info!("Remote platform discovered: {:?}", this.platform);
this.remote_binary_path = Some(
this.ensure_server_binary(&delegate, release_channel, version, commit, cx)
this.ensure_server_binary(&delegate, release_channel, version, cx)
.await
.context("failed ensuring server binary")?,
);
@@ -157,15 +153,10 @@ impl WslRemoteConnection {
&self,
delegate: &Arc<dyn RemoteClientDelegate>,
release_channel: ReleaseChannel,
version: SemanticVersion,
commit: Option<AppCommitSha>,
version: Version,
cx: &mut AsyncApp,
) -> Result<Arc<RelPath>> {
let version_str = match release_channel {
ReleaseChannel::Nightly => {
let commit = commit.map(|s| s.full()).unwrap_or_default();
format!("{}-{}", version, commit)
}
ReleaseChannel::Dev => "build".to_string(),
_ => version.to_string(),
};