From 8efaa540380726a0b5723dc317640dfdfb3e208d Mon Sep 17 00:00:00 2001 From: Steven DeMartini Date: Sat, 28 Dec 2024 08:32:32 -0800 Subject: [PATCH] Bump GH Actions versions for checkout, pnpm, & node, and use node 20 Also - clean up and utilize the matrix `node-version` - Use node caching for pnpm dependencies, as is shown in https://github.com/pnpm/action-setup/blob/ac5bf11548bf5e19b8aadb8182072616590fa4a6/README.md#use-cache-to-reduce-installation-time - Rely on the `packageManager` in package.json for the pnpm version, as required by the newer pnpm setup action (https://github.com/pnpm/action-setup/blob/ac5bf11548bf5e19b8aadb8182072616590fa4a6/README.md#install-only-pnpm-with-packagemanager) --- .github/workflows/build-test.yml | 14 +++++++++----- .github/workflows/release.yml | 17 ++++++----------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 7f8bbcb..51fbca2 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -13,16 +13,20 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18] + node-version: [20] steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Setup pnpm - uses: pnpm/action-setup@v2 + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 with: - version: 9 + node-version: ${{ matrix.node-version }} + cache: "pnpm" - run: pnpm install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 945c434..1361637 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,28 +14,23 @@ jobs: permissions: contents: read id-token: write # Needed for https://docs.npmjs.com/generating-provenance-statements - strategy: - matrix: - node-version: [18] needs: [build-test] # Require standard CI steps to pass before publishing steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 # Set up .npmrc file to publish to npm. This also allows NODE_AUTH_TOKEN # to work below. - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: - node-version: "18.x" + node-version: "20.x" registry-url: "https://registry.npmjs.org" - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: 9 - - run: pnpm install - run: pnpm run build