feat(KAN-65): add signed macOS updates and DMG distribution
CI/CD / preconditions (pull_request) Successful in 2s
Native JavaScript checks / Native launcher and release tests (pull_request) Successful in 1m0s
CI/CD / test_and_check_app (pull_request) Successful in 7m2s
CI/CD / Publish immutable image (pull_request) Skipped
macOS checks / Native Rust tests and unsigned build (pull_request) Successful in 1m35s

This commit is contained in:
2026-09-27 21:40:23 +02:00
parent 3e5c316b8f
commit 20f9314659
28 changed files with 2454 additions and 130 deletions
+46 -2
View File
@@ -2,7 +2,7 @@ use crate::locale::en;
use crate::server::{validate_url, Server, DEFAULT_SERVER};
use std::{path::PathBuf, sync::Mutex, time::Duration};
use tauri::{
menu::{MenuBuilder, SubmenuBuilder},
menu::{AboutMetadata, MenuBuilder, MenuItem, SubmenuBuilder},
webview::{NewWindowResponse, PageLoadEvent},
AppHandle, Manager, Url, WebviewUrl, WebviewWindowBuilder, WindowEvent,
};
@@ -247,6 +247,11 @@ fn open_workspace(app: &AppHandle, input: &str) -> Result<(), &'static str> {
fn handle_launcher_action(app: &AppHandle, destination: &Url) {
let result = match destination.path() {
"/action/updates" => {
#[cfg(target_os = "macos")]
crate::updates::show(app);
Ok(())
}
"/action/open" => {
let input = destination
.query_pairs()
@@ -294,6 +299,24 @@ pub fn builder() -> tauri::Builder<tauri::Wry> {
let menu = MenuBuilder::new(app)
.item(
&SubmenuBuilder::new(app, en::APP_NAME)
.about_with_text(
en::ABOUT,
Some(AboutMetadata {
name: Some(en::APP_NAME.into()),
short_version: Some(app.package_info().version.to_string()),
version: app.config().bundle.macos.bundle_version.clone(),
..Default::default()
}),
)
.text("check-updates", en::CHECK_UPDATES)
.item(&MenuItem::with_id(
app,
"install-update",
en::INSTALL_UPDATE,
false,
None::<&str>,
)?)
.separator()
.text("server-settings", en::SERVER_SETTINGS)
.separator()
.quit()
@@ -318,7 +341,21 @@ pub fn builder() -> tauri::Builder<tauri::Wry> {
)
.build()?;
app.set_menu(menu)?;
#[cfg(target_os = "macos")]
crate::updates::setup(app.handle())?;
app.on_menu_event(|app, event| {
#[cfg(target_os = "macos")]
match event.id().as_ref() {
"check-updates" => {
crate::updates::check(app, true);
return;
}
"install-update" => {
crate::updates::show(app);
return;
}
_ => {}
}
if event.id().as_ref() == "server-settings" {
show_launcher(app);
} else if let Some(script) = match event.id().as_ref() {
@@ -363,6 +400,8 @@ pub fn builder() -> tauri::Builder<tauri::Wry> {
if payload.event() == PageLoadEvent::Finished {
let app = window.app_handle().clone();
update_launcher(&app);
#[cfg(target_os = "macos")]
crate::updates::refresh(&app);
std::thread::spawn(move || {
let handle = app.clone();
let _ = app.run_on_main_thread(move || {
@@ -482,7 +521,10 @@ mod tests {
#[test]
fn remote_pages_cannot_invoke_native_commands() {
let app = tauri::test::mock_builder().build(context()).unwrap();
let builder = tauri::test::mock_builder();
#[cfg(target_os = "macos")]
let builder = builder.plugin(tauri_plugin_updater::Builder::new().build());
let app = builder.build(context()).unwrap();
let window = WebviewWindowBuilder::new(
&app,
"workspace-1",
@@ -491,6 +533,8 @@ mod tests {
.build()
.unwrap();
for command in [
"plugin:updater|check",
"plugin:updater|download_and_install",
"plugin:window|close",
"plugin:webview|create_webview_window",
"plugin:path|resolve_directory",