From e7c481afa62058f2707a0eaf8c184596fbfeb05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 13 Mar 2023 08:40:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(actions):=E8=B0=83=E6=95=B4Github=20Action?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 68 ++++++++++++++++------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d839a0..8740126 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,19 +41,17 @@ jobs: runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # 安装 Node.js - name: Setup node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 16 # 安装 Rust - - name: Install Rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable + - name: Install Rust nightly + uses: dtolnay/rust-toolchain@nightly # 使用 Rust 缓存,加快安装速度 - uses: Swatinem/rust-cache@v1 @@ -64,39 +62,33 @@ jobs: sudo apt-get update sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf - # 安装PNPM - - uses: pnpm/action-setup@v2 - name: Install pnpm - id: pnpm-install - with: - version: 7 - run_install: false - - # 获取PNPM缓存路径 - - name: Get pnpm store directory - id: pnpm-cache - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - # 设置PNPM缓存 - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - # 安装依赖 - - name: Install dependencies - run: pnpm install - - # 执行构建,以及推送 github release - - name: Install app dependencies and build it - run: pnpm tauri build + - name: install frontend dependencies + run: pnpm install # change this to npm or pnpm depending on which one you use - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}' + tauriScript: pnpm + releaseId: ${{ needs.create-release.outputs.release_id }} + + publish-release: + permissions: + contents: write + runs-on: ubuntu-20.04 + needs: [create-release, build-tauri] + + steps: + - name: publish release + id: publish-release + uses: actions/github-script@v6 + env: + release_id: ${{ needs.create-release.outputs.release_id }} + with: + script: | + github.rest.repos.updateRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: process.env.release_id, + draft: false, + prerelease: false + })