From a385e9d7f4989140e157ba9540746e5054c9ae0d Mon Sep 17 00:00:00 2001 From: xcmd Date: Mon, 4 Sep 2023 23:16:58 -0700 Subject: [PATCH] Add release GitHub workflow --- .github/workflows/{rust.yaml => build.yaml} | 3 +- .github/workflows/release.yaml | 61 +++++++++++++++++++++ Cargo.lock | 21 +++++++ xcmd-tauri/src-tauri/Cargo.toml | 2 +- xcmd-tauri/src-tauri/tauri.conf.json | 7 ++- xcmd-tauri/src-tauri/tauri.update.json | 23 ++++++++ 6 files changed, 113 insertions(+), 4 deletions(-) rename .github/workflows/{rust.yaml => build.yaml} (98%) create mode 100644 .github/workflows/release.yaml create mode 100644 xcmd-tauri/src-tauri/tauri.update.json diff --git a/.github/workflows/rust.yaml b/.github/workflows/build.yaml similarity index 98% rename from .github/workflows/rust.yaml rename to .github/workflows/build.yaml index c39ccc0..55e6614 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/build.yaml @@ -1,5 +1,4 @@ -name: test - +name: Build on: push: branches: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..e158cf7 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,61 @@ +name: Release +on: + push: + branches: + - gh-release + # push: + # tags: + # - 'v*' + # workflow_dispatch: + +jobs: + release: + permissions: + contents: write + strategy: + fail-fast: false + matrix: + platform: [macos-latest, ubuntu-20.04, windows-latest] + runs-on: ${{ matrix.platform }} + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install dependencies (ubuntu only) + if: matrix.platform == 'ubuntu-20.04' + # You can remove libayatana-appindicator3-dev if you don't use the system tray feature. + run: | + sudo apt-get update --fix-missing + sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev + + - name: Rust setup + uses: dtolnay/rust-toolchain@stable + + - name: Rust cache + uses: swatinem/rust-cache@v2 + + - name: Sync node version and setup cache + uses: actions/setup-node@v3 + with: + node-version: 'lts/*' + cache: npm + cache-dependency-path: '**/package-lock.json' + + - name: Install frontend dependencies + working-directory: xcmd-tauri + run: npm install + + - name: Build the app + uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} + TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} + with: + tagName: test # ${{ github.ref_name }} # This only works if your workflow triggers on new tags. + projectPath: xcmd-tauri + releaseName: 'Cross Commander v__VERSION__' + releaseBody: 'See the assets to download and install this version.' + releaseDraft: true + prerelease: false diff --git a/Cargo.lock b/Cargo.lock index 26085b5..f8ab570 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2912,6 +2912,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[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.3.7" @@ -4893,6 +4899,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fbe522898e35407a8e60dc3870f7579fea2fc262a6a6072eccdd37ae1e1d91e" dependencies = [ "anyhow", + "base64 0.21.2", "bytes", "cocoa", "dirs-next", @@ -4906,6 +4913,7 @@ dependencies = [ "heck 0.4.1", "http", "ignore", + "minisign-verify", "notify-rust", "objc", "once_cell", @@ -4933,12 +4941,14 @@ dependencies = [ "tauri-utils", "tempfile", "thiserror", + "time 0.3.23", "tokio", "url", "uuid", "webkit2gtk", "webview2-com", "windows 0.39.0", + "zip", ] [[package]] @@ -6659,6 +6669,17 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", +] + [[package]] name = "zstd" version = "0.12.4" diff --git a/xcmd-tauri/src-tauri/Cargo.toml b/xcmd-tauri/src-tauri/Cargo.toml index 58fe221..17e18c3 100644 --- a/xcmd-tauri/src-tauri/Cargo.toml +++ b/xcmd-tauri/src-tauri/Cargo.toml @@ -17,7 +17,7 @@ tauri-build = { version = "1.4.0", features = [] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -tauri = { version = "1.4.1", features = ["api-all"] } +tauri = { version = "1.4.1", features = [ "updater", "api-all"] } [features] # by default Tauri runs in production mode diff --git a/xcmd-tauri/src-tauri/tauri.conf.json b/xcmd-tauri/src-tauri/tauri.conf.json index a1762d9..3f4134b 100644 --- a/xcmd-tauri/src-tauri/tauri.conf.json +++ b/xcmd-tauri/src-tauri/tauri.conf.json @@ -56,7 +56,12 @@ "csp": null }, "updater": { - "active": false + "active": true, + "endpoints": [ + + ], + "dialog": true, + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEZDQkZDREVGRkVBQ0RBRDMKUldUVDJxeis3ODIvL0pHRHZkQTlONVpXZzRXNjhGWTdybkZtWFJzdEtHK1NRaVJIaEZuaHVIM3gK" }, "windows": [ { diff --git a/xcmd-tauri/src-tauri/tauri.update.json b/xcmd-tauri/src-tauri/tauri.update.json new file mode 100644 index 0000000..ed53921 --- /dev/null +++ b/xcmd-tauri/src-tauri/tauri.update.json @@ -0,0 +1,23 @@ +{ + "version": "v0.1.0", + "notes": "Initial version", + "pub_date": "2023-09-04T23:41:49.361Z", + "platforms": { + "darwin-x86_64": { + "signature": "Content of app.tar.gz.sig", + "url": "https://github.com/xcmd-io/xcmd/releases/download/v0.1.0/app-x86_64.app.tar.gz" + }, + "darwin-aarch64": { + "signature": "Content of app.tar.gz.sig", + "url": "https://github.com/xcmd-io/xcmd/releases/download/v0.1.0/app-aarch64.app.tar.gz" + }, + "linux-x86_64": { + "signature": "Content of app.AppImage.tar.gz.sig", + "url": "https://github.com/xcmd-io/xcmd/releases/download/v0.1.0/app-amd64.AppImage.tar.gz" + }, + "windows-x86_64": { + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVUVDJxeis3ODIvL0V5Tk5HV1dUNWNrNVpaVTJFbFJPNkQzR2NiR3Q2cXB0ZGdsaFl1R0h6YSttbllVbjNldE1NVXFpRW92Z01xMkZFQnAraG5POVpNYUxQYWJnWnptVXdZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjkzODcwMTEwCWZpbGU6eGNtZF8wLjEuMF94NjRfZW4tVVMubXNpLnppcAp0bHkyRDhVc0dzbHFyajVVYm82N1ltejVReHM5VitJL1pheHpjZEdseCtmRE9RcmNkUHpHZlhjYk9KNWdGNWcyUk1BVTdxTzlBZEZyNXptUytPWnhDQT09Cg==", + "url": "https://github.com/xcmd-io/xcmd/releases/download/v0.1.0/xcmd_0.1.0_x64_en-US.msi" + } + } + }