From 029491e4a5a21e4df76d820527b990fd189474f8 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Thu, 10 Oct 2024 18:07:13 +0800 Subject: [PATCH] ci: use pnpm --- .github/workflows/publish.yml | 17 ++++++++--------- .github/workflows/test.yml | 21 +++++++++------------ 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5f72fc5..5748399 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,24 +11,23 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v3 - - name: Setup node - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 20 + node-version-file: '.node-version' check-latest: true - cache: 'npm' + cache: 'pnpm' registry-url: 'https://registry.npmjs.org' - - name: Install dependencies - run: npm install -g npm && npm install + - uses: pnpm/action-setup@v4 + - run: npm install -g npm && pnpm install - name: Publish run: | if git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+$"; then - npm publish --provenance --access public + pnpm publish --provenance --access public elif git log -1 --pretty=%B | grep "^release: [0-9]\+\.[0-9]\+\.[0-9]\+"; then - npm publish --tag next --provenance --access public + pnpm publish --tag next --provenance --access public else echo "Not a release, skipping publish" fi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aa7cf0c..56698d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,20 +11,17 @@ jobs: node-version: [16, 18, 20, 22] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} check-latest: true - cache: 'npm' + cache: 'pnpm' registry-url: 'https://registry.npmjs.org' - - name: Install dependencies - run: npm install - - name: Lint - if: matrix.node-version == 22 - run: npm run lint - - name: Test - run: npm run test - - name: Build - run: npm run build + - uses: pnpm/action-setup@v4 + - run: pnpm install + - if: matrix.node-version == 22 + run: pnpm run lint + - run: pnpm run test + - run: pnpm run build