From b0eef9e8d269b607ce557b50e7c9950b2387b332 Mon Sep 17 00:00:00 2001 From: Rewrite0 Date: Fri, 31 May 2024 16:05:52 +0800 Subject: [PATCH] fix: ci pnpm version --- .github/workflows/build.yml | 34 ++++++++++++++++++++++------------ webui/package.json | 3 ++- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76b90700..4e60a0ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,23 +81,33 @@ jobs: runs-on: ubuntu-latest needs: [ test, version-info ] if: ${{ needs.version-info.outputs.release == 1 || needs.version-info.outputs.dev == 1 }} - strategy: - matrix: - node-version: [ 18 ] steps: - name: Checkout uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - name: Install Node.js + uses: actions/setup-node@v4 with: - version: 8 + node-version: 20 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - uses: pnpm/action-setup@v4 + name: Install pnpm with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - cache-dependency-path: webui/pnpm-lock.yaml + version: 9 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Install dependencies run: cd webui && pnpm install @@ -247,7 +257,7 @@ jobs: run: | echo ${{ needs.version-info.outputs.version }} echo "VERSION='${{ needs.version-info.outputs.version }}'" >> module/__version__.py - + - name: Copy requirements.txt working-directory: ./backend run: @@ -267,7 +277,7 @@ jobs: echo "version=🌟${{ needs.version-info.outputs.version }}" >> $GITHUB_OUTPUT echo "pre_release=false" >> $GITHUB_OUTPUT fi - + - name: Release id: release uses: softprops/action-gh-release@v1 diff --git a/webui/package.json b/webui/package.json index a5f55ee4..8fdf87d1 100644 --- a/webui/package.json +++ b/webui/package.json @@ -65,5 +65,6 @@ "vite-plugin-pwa": "^0.16.4", "vitest": "^0.30.1", "vue-tsc": "^1.6.4" - } + }, + "packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0" }