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
+8 -6
View File
@@ -22,7 +22,7 @@ use futures::{
};
use gpui::{
App, AppContext as _, AsyncApp, BackgroundExecutor, BorrowAppContext, Context, Entity,
EventEmitter, FutureExt, Global, SemanticVersion, Task, WeakEntity,
EventEmitter, FutureExt, Global, Task, WeakEntity,
};
use parking_lot::Mutex;
@@ -31,6 +31,7 @@ use rpc::{
AnyProtoClient, ErrorExt, ProtoClient, ProtoMessageHandlerSet, RpcError,
proto::{self, Envelope, EnvelopedMessage, PeerId, RequestMessage, build_typed_envelope},
};
use semver::Version;
use std::{
collections::VecDeque,
fmt,
@@ -71,14 +72,14 @@ pub trait RemoteClientDelegate: Send + Sync {
&self,
platform: RemotePlatform,
release_channel: ReleaseChannel,
version: Option<SemanticVersion>,
version: Option<Version>,
cx: &mut AsyncApp,
) -> Task<Result<Option<String>>>;
fn download_server_binary_locally(
&self,
platform: RemotePlatform,
release_channel: ReleaseChannel,
version: Option<SemanticVersion>,
version: Option<Version>,
cx: &mut AsyncApp,
) -> Task<Result<PathBuf>>;
fn set_status(&self, status: Option<&str>, cx: &mut AsyncApp);
@@ -1506,9 +1507,10 @@ mod fake {
},
select_biased,
};
use gpui::{App, AppContext as _, AsyncApp, SemanticVersion, Task, TestAppContext};
use gpui::{App, AppContext as _, AsyncApp, Task, TestAppContext};
use release_channel::ReleaseChannel;
use rpc::proto::Envelope;
use semver::Version;
use std::{path::PathBuf, sync::Arc};
use util::paths::{PathStyle, RemotePathBuf};
@@ -1663,7 +1665,7 @@ mod fake {
&self,
_: RemotePlatform,
_: ReleaseChannel,
_: Option<SemanticVersion>,
_: Option<Version>,
_: &mut AsyncApp,
) -> Task<Result<PathBuf>> {
unreachable!()
@@ -1673,7 +1675,7 @@ mod fake {
&self,
_platform: RemotePlatform,
_release_channel: ReleaseChannel,
_version: Option<SemanticVersion>,
_version: Option<Version>,
_cx: &mut AsyncApp,
) -> Task<Result<Option<String>>> {
unreachable!()
+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(),
};