diff --git a/.github/workflows/github-actions-builder.yml b/.github/workflows/github-actions-builder.yml index 2db36fa2..c1c13adc 100644 --- a/.github/workflows/github-actions-builder.yml +++ b/.github/workflows/github-actions-builder.yml @@ -3,6 +3,7 @@ on: push: branches: - production + workflow_dispatch: {} jobs: publish-tauri: @@ -28,6 +29,11 @@ jobs: shell: bash run: | echo "VERSION_JSON=$(jq -c . < version.json)" >> $GITHUB_ENV + - name: "Set TAURI_PRIVATE_KEY env variable for signing" + shell: bash, + run: | + export TAURI_PRIVATE_KEY="${{ secrets.TAURI_PRIVATE_KEY }}" + export TAURI_KEY_PASSWORD="${{ secrets.TAURI_KEY_PASSWORD }}" - name: install pnpm uses: pnpm/action-setup@v3 with: @@ -51,61 +57,18 @@ jobs: ${{ runner.os }}-pnpm-store- - name: install frontend dependencies run: pnpm install --no-frozen-lockfile # change this to npm or pnpm depending on which one you use - - if: matrix.platform == 'ubuntu-latest' - run: pnpm tauri build --target x86_64-unknown-linux-gnu - - if: matrix.platform == 'ubuntu-latest' - uses: "softprops/action-gh-release@v2" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - tag_name: "v${{fromJson(env.VERSION_JSON).version}}" - name: "${{fromJson(env.VERSION_JSON).version}}" - generate_release_notes: true - files: | - src-tauri/target/x86_64-unknown-linux-gnu/release/**/*.deb - src-tauri/target/x86_64-unknown-linux-gnu/release/**/*.AppImage - if: matrix.platform == 'macos-latest' run: rustup target add x86_64-apple-darwin - - if: matrix.platform == 'macos-latest' - run: pnpm tauri build --target x86_64-apple-darwin - if: matrix.platform == 'macos-latest' run: rustup target add aarch64-apple-darwin - - if: matrix.platform == 'macos-latest' - run: pnpm tauri build --target aarch64-apple-darwin - - if: matrix.platform == 'macos-latest' - uses: "softprops/action-gh-release@v2" + - uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - tag_name: "v${{fromJson(env.VERSION_JSON).version}}" - name: "${{fromJson(env.VERSION_JSON).version}}" - generate_release_notes: true - files: | - src-tauri/target/*/release/bundle/macos/*.app - src-tauri/target/*/release/bundle/dmg/*.dmg - - if: matrix.platform == 'windows-latest' - run: pnpm tauri build - - if: matrix.platform == 'windows-latest' - uses: "softprops/action-gh-release@v2" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - tag_name: "v${{fromJson(env.VERSION_JSON).version}}" - name: "${{fromJson(env.VERSION_JSON).version}}" - generate_release_notes: true - files: | - src-tauri/target/x86_64-pc-windows-msvc/release/**/*.msi - # publish dist as zip when building on ubuntu - # first, zip the dist - - if: matrix.platform == 'ubuntu-latest' - run: zip -r built_code.zip dist - # then, publish the zip file - - if: matrix.platform == 'ubuntu-latest' - uses: "softprops/action-gh-release@v2" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - tag_name: "v${{fromJson(env.VERSION_JSON).version}}" - name: "${{fromJson(env.VERSION_JSON).version}}" - generate_release_notes: true - files: built_code.zip \ No newline at end of file + tagName: 'v__VERSION__' # the action automatically replaces \_\_VERSION\_\_ with the app version. + releaseName: 'v__VERSION__' + releaseBody: 'Release of v__VERSION__' + releaseDraft: true + prerelease: false + args: ${{ matrix.settings.args }} + tauriScript: "pnpm tauri" diff --git a/.gitignore b/.gitignore index 8657af87..b737c769 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,5 @@ vite.config.js.timestamp-* vite.config.ts.timestamp-* raise.code-workspace recc.md -__pycache__/ \ No newline at end of file +__pycache__/ +.tauri/ \ No newline at end of file diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 2a2b0c94..318e3304 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1784,6 +1784,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minisign-verify" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" + [[package]] name = "miniz_oxide" version = "0.7.2" @@ -3298,6 +3304,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f078117725e36d55d29fafcbb4b1e909073807ca328ae8deb8c0b3843aac0fed" dependencies = [ "anyhow", + "base64 0.21.7", "bytes", "cocoa", "dirs-next", @@ -3313,6 +3320,7 @@ dependencies = [ "http", "ignore", "indexmap 1.9.3", + "minisign-verify", "objc", "once_cell", "open", @@ -3337,12 +3345,14 @@ dependencies = [ "tauri-utils", "tempfile", "thiserror", + "time", "tokio", "url", "uuid", "webkit2gtk", "webview2-com", "windows 0.39.0", + "zip", ] [[package]] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 6b011417..325a06ed 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" tauri-build = { version = "1.4.0", features = [] } [dependencies] -tauri = { version = "1.6.0", features = ["app-all", "dialog-all", "fs-all", "http-all", "os-all", "path-all", "process-relaunch", "protocol-all", "reqwest-client", "shell-open", "window-maximize", "window-set-fullscreen"] } +tauri = { version = "1.6.0", features = [ "updater", "app-all", "dialog-all", "fs-all", "http-all", "os-all", "path-all", "process-relaunch", "protocol-all", "reqwest-client", "shell-open", "window-maximize", "window-set-fullscreen"] } serde_json = "1.0" tiktoken-rs = "0.4.0" base64 = "0.21.0" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 7459728a..6e1a8276 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -96,7 +96,13 @@ "csp": null }, "updater": { - "active": false + "active": true, + "endpoints": ["https://sv.risuai.xyz/hub/update"], + "dialog": false, + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDU2ODMzOTIxMDMxOTY1MUYKUldRZlpSa0RJVG1EVmx5Vm1WYlhFM29HMEJrUTRrYmg5dDQ0RFpvdUphNDdxQmVlWXJHVmV5TEYK", + "windows": { + "installMode": "passive" + } }, "windows": [ {