chore: version bump and build update

This commit is contained in:
zhom
2025-05-31 11:07:59 +04:00
parent eaa1a823db
commit 6a3407796d
8 changed files with 30 additions and 9 deletions
+19 -2
View File
@@ -47,8 +47,19 @@ impl AppAutoUpdater {
/// Check if running a nightly build based on environment variable
pub fn is_nightly_build() -> bool {
// If STABLE_RELEASE env var is set at compile time, it's a stable build
// Otherwise, it's a nightly build
option_env!("STABLE_RELEASE").is_none()
if option_env!("STABLE_RELEASE").is_some() {
return false;
}
// Also check if the current version starts with "nightly-"
let current_version = Self::get_current_version();
if current_version.starts_with("nightly-") {
return true;
}
// If STABLE_RELEASE is not set and version doesn't start with "nightly-",
// it's still considered a nightly build (dev builds, main branch builds, etc.)
true
}
/// Get current app version from build-time injection
@@ -594,6 +605,10 @@ mod tests {
// This will depend on whether STABLE_RELEASE is set during test compilation
let is_nightly = AppAutoUpdater::is_nightly_build();
println!("Is nightly build: {is_nightly}");
// The result should be true for test builds since STABLE_RELEASE is not set
// unless the test is run in a stable release environment
assert!(is_nightly || option_env!("STABLE_RELEASE").is_some());
}
#[test]
@@ -672,6 +687,7 @@ mod tests {
browser_download_url: "https://example.com/x64.dmg".to_string(),
size: 12345,
},
AppReleaseAsset {
name: "Donut.Browser_0.1.0_aarch64.dmg".to_string(),
browser_download_url: "https://example.com/aarch64.dmg".to_string(),
@@ -687,3 +703,4 @@ mod tests {
assert!(url.contains(".dmg"));
}
}