diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfe2050e..ad555c0c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,7 @@ jobs: tagName: ${{ github.ref_name }} releaseName: Splitwave ${{ github.ref_name }} releaseDraft: true - prerelease: false + prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }} args: ${{ matrix.args }} linux: @@ -106,7 +106,7 @@ jobs: tagName: ${{ github.ref_name }} releaseName: Splitwave ${{ github.ref_name }} releaseDraft: true - prerelease: false + prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }} args: --bundles appimage,deb,rpm # linuxdeploy bundles libwayland/libpipewire/libspa; on newer Mesa they @@ -211,5 +211,5 @@ jobs: tagName: ${{ github.ref_name }} releaseName: Splitwave ${{ github.ref_name }} releaseDraft: true - prerelease: false + prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }} args: --bundles nsis diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 9c38f698..b1a01d75 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -6284,6 +6284,7 @@ dependencies = [ "tracing", "tracing-subscriber", "ts-rs", + "url", "vst3", "webpki-roots 0.26.11", "webrtc", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 46e124a4..8a237552 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -70,6 +70,7 @@ tauri-plugin-os = "2" tauri-plugin-autostart = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" +url = "2" thiserror = "1" cpal = "0.15" rtrb = "0.3" diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 2739d6ec..c0c289bd 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -533,8 +533,8 @@ pub async fn stop_pipeline(state: State<'_, AppState>, app: AppHandle) -> AppRes // Updater errors serialize Display-only, hiding reqwest's cause; unwind source()+Debug. #[tauri::command] -pub async fn diagnose_update_error(app: AppHandle) -> String { - let report = match configured_updater(&app) { +pub async fn diagnose_update_error(app: AppHandle, endpoint: Option) -> String { + let report = match configured_updater(&app, endpoint.as_deref()) { Ok(updater) => match updater.check().await { Ok(Some(u)) => format!("check succeeded; update {} is available", u.version), Ok(None) => "check succeeded; no update available".to_string(), @@ -563,14 +563,21 @@ fn updater_tls_config() -> rustls::ClientConfig { .with_no_client_auth() } -fn configured_updater(app: &AppHandle) -> Result { +fn configured_updater( + app: &AppHandle, + endpoint: Option<&str>, +) -> Result { use tauri_plugin_updater::UpdaterExt; #[cfg(target_os = "linux")] - let builder = app + let mut builder = app .updater_builder() .configure_client(|b| b.tls_backend_preconfigured(updater_tls_config())); #[cfg(not(target_os = "linux"))] - let builder = app.updater_builder(); + let mut builder = app.updater_builder(); + if let Some(ep) = endpoint { + let url = url::Url::parse(ep).map_err(|e| e.to_string())?; + builder = builder.endpoints(vec![url]).map_err(|e| e.to_string())?; + } builder.build().map_err(|e| e.to_string()) } @@ -588,9 +595,12 @@ pub struct UpdateMetadata { /// Mirrors `plugin:updater|check` but with bundled roots wired into the HTTP /// client; the plugin's own `check` command can't be configured. #[tauri::command] -pub async fn check_for_updates(app: AppHandle) -> Result, String> { +pub async fn check_for_updates( + app: AppHandle, + endpoint: Option, +) -> Result, String> { use tauri::Manager; - let updater = configured_updater(&app)?; + let updater = configured_updater(&app, endpoint.as_deref())?; let Some(update) = updater.check().await.map_err(|e| e.to_string())? else { return Ok(None); }; diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 318e46a3..e7ceb043 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -259,6 +259,17 @@ pub fn run() { } } + if let Ok(dir) = handle.path().app_data_dir() { + let current = dir.join("pipelines.json"); + let backup = dir.join("pipelines.backup-v1.json"); + if current.exists() && !backup.exists() { + if let Ok(bytes) = std::fs::read(¤t) { + let _ = std::fs::write(&backup, bytes); + info!(path = %backup.display(), "created automatic pre-1.2.0 pipeline backup"); + } + } + } + #[cfg(target_os = "linux")] if let Err(error) = audio::virtual_device::restore(&handle) { tracing::error!(%error, "failed to restore PipeWire virtual devices"); diff --git a/src/lib/components/layout/header.svelte b/src/lib/components/layout/header.svelte index 666db648..ac8b7710 100644 --- a/src/lib/components/layout/header.svelte +++ b/src/lib/components/layout/header.svelte @@ -1,5 +1,6 @@