feat: add desktop updater and release automation

This commit is contained in:
lbl
2026-08-22 10:00:24 +08:00
parent da72670154
commit 60a4403f0e
42 changed files with 1374 additions and 257 deletions
+2
View File
@@ -24,3 +24,5 @@ serde.workspace = true
serde_json.workspace = true
toml.workspace = true
anyhow.workspace = true
tauri-plugin-updater = "2"
tauri-plugin-process = "2"
@@ -11,6 +11,8 @@
"core:window:allow-unmaximize",
"core:window:allow-is-maximized",
"core:window:allow-start-dragging",
"opener:allow-open-url"
"opener:allow-open-url",
"process:allow-restart",
"updater:default"
]
}
+3 -1
View File
@@ -245,6 +245,8 @@ pub fn run() {
open_web_url
])
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
show_main_window(app);
}))
@@ -260,7 +262,7 @@ pub fn run() {
let config_path = data_dir.join(WEB_ACCESS_CONFIG);
let config = load_web_config(&config_path);
save_web_config(&config_path, &config)?;
let service = tauri::async_runtime::block_on(VntService::new(None))?;
let service = tauri::async_runtime::block_on(VntService::new_desktop(None))?;
let mut web = WebRuntime {
config,
cancellation: None,
+13 -1
View File
@@ -25,11 +25,12 @@
}
],
"security": {
"csp": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' asset: data:; connect-src 'self' ipc: http://ipc.localhost http://127.0.0.1:*"
"csp": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' asset: data:; connect-src 'self' ipc: http://ipc.localhost http://127.0.0.1:* https://api.github.com"
}
},
"bundle": {
"active": true,
"createUpdaterArtifacts": true,
"targets": "all",
"icon": [
"icons/32x32.png",
@@ -45,5 +46,16 @@
"wix": { "language": "zh-CN" },
"nsis": { "displayLanguageSelector": false }
}
},
"plugins": {
"updater": {
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEE3MTQzQjc3NTJGQjBGRTEKUldUaEQvdFNkenNVcHdwd0pRNEhDV1lTdkMzTDZLa1V3WGllMDRoMmxBNDdobi8wclN1dmo3cFoK",
"endpoints": [
"https://github.com/vnt-dev/vnt/releases/latest/download/latest.json"
],
"windows": {
"installMode": "passive"
}
}
}
}