fix(actions):调整Github Action。
This commit is contained in:
		
							
								
								
									
										68
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										68
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							| @@ -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 | ||||
|             }) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user