修复 GitHub Actions: 使用 pnpm 替代 npm

This commit is contained in:
farion1231
2025-08-06 23:36:43 +08:00
parent 76eeae3b77
commit 849118c3b2

View File

@@ -21,15 +21,33 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Build application
run: |
npm run build
npm run dist
pnpm run build
pnpm run dist
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}