From f9763c53f014ee0d8d79c1a75c1a0c06443b9833 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sun, 23 Apr 2023 12:22:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20feat(ci):=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=89=93=E5=8C=85&=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 50 +++++++++++++++++++++++++++++++++++++ src-tauri/tauri.conf.json | 4 +-- 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..8dcaffbf --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +name: Publish Release +on: + push: + branches: + - master + tags: + - v* + +jobs: + publish-tauri: + permissions: + contents: write + strategy: + fail-fast: false + matrix: + platform: [windows-latest] + + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + - name: setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install Rust stable + uses: dtolnay/rust-toolchain@stable + - name: Restore Cargo dependencies + uses: actions/cache@v3 + with: + path: | + ~/src-tauri/.cargo/bin/ + ~/src-tauri/.cargo/registry/index/ + ~/src-tauri/.cargo/registry/cache/ + ~/src-tauri/.cargo/git/db/ + ~/src-tauri/target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('src-tauri/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + - name: Install frontend dependencies + run: npm install + - uses: tauri-apps/tauri-action@dev + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} + TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} + with: + tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version + releaseName: v__VERSION__-alpha + releaseBody: See the assets to download this version and install. + releaseDraft: true + prerelease: false diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index f36daac7..5c63d57a 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -49,9 +49,9 @@ "csp": null }, "updater": { - "active": false, + "active": true, "dialog": true, - "endpoints": ["https://github.com/BTMuli/Tauri.Genshin/latest/releases/download/updater/update.json"], + "endpoints": ["https://github.com/BTMuli/Tauri.Genshin/blob/master/latest.json"], "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEU5OEE2RkU0QUZCMTMzMUEKUldRYU03R3Y1RytLNlI4bytTRDhpYTNTL2lTOUVZeWQwOTAxNHBock8zY3FrdVliR2kvdHhoN2IK" }, "windows": [