diff --git a/.github/workflows/publish-to-auto-release.yml b/.github/workflows/publish-to-auto-release.yml index 02ff9ec..2dada7d 100644 --- a/.github/workflows/publish-to-auto-release.yml +++ b/.github/workflows/publish-to-auto-release.yml @@ -77,6 +77,8 @@ jobs: - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} with: tagName: v${{ env.VERSION }} releaseName: v${{ env.VERSION }} diff --git a/.github/workflows/test-build-only.yml b/.github/workflows/test-build-only.yml index 37d3709..6ae55c5 100644 --- a/.github/workflows/test-build-only.yml +++ b/.github/workflows/test-build-only.yml @@ -50,5 +50,7 @@ jobs: - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} with: args: ${{ matrix.args }} diff --git a/package-lock.json b/package-lock.json index 075f686..a3d6716 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@tauri-apps/plugin-os": "^2.2.1", "@tauri-apps/plugin-shell": "^2.2.1", "@tauri-apps/plugin-store": "^2.2.0", + "@tauri-apps/plugin-updater": "^2.7.0", "@tauri-apps/plugin-upload": "^2.2.1", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -1520,6 +1521,15 @@ "@tauri-apps/api": "^2.0.0" } }, + "node_modules/@tauri-apps/plugin-updater": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-updater/-/plugin-updater-2.7.0.tgz", + "integrity": "sha512-oBug5UCH2wOsoYk0LW5LEMAT51mszjg11s8eungRH26x/qOrEjLvnuJJoxVVr9nsWowJ6vnpXKS+lUMfFTlvHQ==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@tauri-apps/api": "^2.0.0" + } + }, "node_modules/@tauri-apps/plugin-upload": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-upload/-/plugin-upload-2.2.1.tgz", diff --git a/package.json b/package.json index 02158d0..38eb331 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@tauri-apps/plugin-os": "^2.2.1", "@tauri-apps/plugin-shell": "^2.2.1", "@tauri-apps/plugin-store": "^2.2.0", + "@tauri-apps/plugin-updater": "^2.7.0", "@tauri-apps/plugin-upload": "^2.2.1", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index b6839e8..f39e9b7 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -90,6 +90,15 @@ version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "arrayvec" version = "0.7.6" @@ -835,6 +844,17 @@ dependencies = [ "serde", ] +[[package]] +name = "derive_arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "derive_more" version = "0.99.19" @@ -1111,6 +1131,18 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + [[package]] name = "flate2" version = "1.1.1" @@ -2173,6 +2205,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.9.0", "libc", + "redox_syscall", ] [[package]] @@ -2265,6 +2298,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minisign-verify" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6367d84fb54d4242af283086402907277715b8fe46976963af5ebf173f8efba3" + [[package]] name = "miniz_oxide" version = "0.8.8" @@ -2569,6 +2608,18 @@ dependencies = [ "objc2-foundation 0.2.2", ] +[[package]] +name = "objc2-osa-kit" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ac59da3ceebc4a82179b35dc550431ad9458f9cc326e053f49ba371ce76c5a" +dependencies = [ + "bitflags 2.9.0", + "objc2 0.6.0", + "objc2-app-kit", + "objc2-foundation 0.3.0", +] + [[package]] name = "objc2-quartz-core" version = "0.2.2" @@ -2683,6 +2734,20 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "osakit" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "732c71caeaa72c065bb69d7ea08717bd3f4863a4f451402fc9513e29dbd5261b" +dependencies = [ + "objc2 0.6.0", + "objc2-foundation 0.3.0", + "objc2-osa-kit", + "serde", + "serde_json", + "thiserror 2.0.12", +] + [[package]] name = "pango" version = "0.18.3" @@ -4117,6 +4182,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tar" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "target-lexicon" version = "0.12.16" @@ -4414,6 +4490,38 @@ dependencies = [ "tracing", ] +[[package]] +name = "tauri-plugin-updater" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82da763248e635d60ee4aed56c862290e523acc838d83097171f9a544708387" +dependencies = [ + "base64 0.22.1", + "dirs", + "flate2", + "futures-util", + "http", + "infer", + "log", + "minisign-verify", + "osakit", + "percent-encoding", + "reqwest", + "semver", + "serde", + "serde_json", + "tar", + "tauri", + "tauri-plugin", + "tempfile", + "thiserror 2.0.12", + "time", + "tokio", + "url", + "windows-sys 0.59.0", + "zip", +] + [[package]] name = "tauri-plugin-upload" version = "2.2.1" @@ -5860,6 +5968,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "xattr" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" +dependencies = [ + "libc", + "rustix 1.0.5", +] + [[package]] name = "xdg-home" version = "1.3.0" @@ -6026,6 +6144,19 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "zip" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dcb24d0152526ae49b9b96c1dcf71850ca1e0b882e4e28ed898a93c41334744" +dependencies = [ + "arbitrary", + "crc32fast", + "crossbeam-utils", + "indexmap 2.9.0", + "memchr", +] + [[package]] name = "zkn-client" version = "0.1.0-dev" @@ -6042,6 +6173,7 @@ dependencies = [ "tauri-plugin-shell", "tauri-plugin-single-instance", "tauri-plugin-store", + "tauri-plugin-updater", "tauri-plugin-upload", "time", ] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index d9a5aeb..7b8d5c6 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -33,4 +33,5 @@ tauri-plugin-store = "2" [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] tauri-plugin-single-instance = "2" +tauri-plugin-updater = "2" diff --git a/src-tauri/capabilities/desktop.json b/src-tauri/capabilities/desktop.json new file mode 100644 index 0000000..47424fa --- /dev/null +++ b/src-tauri/capabilities/desktop.json @@ -0,0 +1,6 @@ +{ + "identifier": "desktop-capability", + "platforms": ["macOS", "windows", "linux"], + "windows": ["main"], + "permissions": ["updater:default"] +} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index b3af4cf..5b9d48d 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -26,6 +26,7 @@ pub fn run() { } } })) + .plugin(tauri_plugin_updater::Builder::new().build()) .plugin(tauri_plugin_store::Builder::new().build()) .plugin( tauri_plugin_log::Builder::new() diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index b4b4de7..523ce0a 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -22,6 +22,7 @@ }, "bundle": { "active": true, + "createUpdaterArtifacts": true, "targets": ["deb", "rpm", "appimage", "nsis", "app", "dmg"], "icon": [ "icons/32x32.png", @@ -30,5 +31,13 @@ "icons/icon.icns", "icons/icon.ico" ] + }, + "plugins": { + "updater": { + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDNGMjNBNTM3MjA2QzY1QjMKUldTelpXd2dONlVqUDc4TW4xK3owUkJJOXdleW1lNkR2MVlRcExtL1lpcjVhVW5HS3Rmb0hOM3gK", + "endpoints": [ + "https://github.com/ZeroKnowledgeNetwork/client/releases/latest/download/latest.json" + ] + } } }