From 60d71fbfd2dbad819f300a5e2adb0216d890101e Mon Sep 17 00:00:00 2001 From: Robbert Broersma Date: Mon, 14 Oct 2024 14:11:04 +0200 Subject: [PATCH 1/4] build: configure pnpm version for corepack --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f7337d0f58..d75ebf328d 100644 --- a/package.json +++ b/package.json @@ -100,5 +100,6 @@ "path-to-regexp@<0.1.10": ">=0.1.10", "cookie@<0.7.0": ">=0.7.0" } - } + }, + "packageManager": "pnpm@9.12.2+sha512.22721b3a11f81661ae1ec68ce1a7b879425a1ca5b991c975b074ac220b187ce56c708fe5db69f4c962c989452eee76c82877f4ee80f474cebd61ee13461b6228" } From 7dddaa80fe2c81b00b519636d2e248bee6ae6bca Mon Sep 17 00:00:00 2001 From: Robbert Broersma Date: Fri, 25 Oct 2024 14:28:51 +0200 Subject: [PATCH 2/4] build: use hashes for GitHub Actions --- .github/workflows/feature-branch-cleanup.yml | 6 +++--- .github/workflows/feature-branch-deploy.yml | 14 +++++++------- .github/workflows/lint-test.yml | 18 +++++++++--------- .github/workflows/publish.yml | 14 +++++++------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/feature-branch-cleanup.yml b/.github/workflows/feature-branch-cleanup.yml index 443268703e..b52257468d 100644 --- a/.github/workflows/feature-branch-cleanup.yml +++ b/.github/workflows/feature-branch-cleanup.yml @@ -20,11 +20,11 @@ jobs: echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - name: Check out - uses: actions/checkout@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: ref: gh-pages - - uses: actions/setup-node@v4 + - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 20 @@ -38,7 +38,7 @@ jobs: git push - name: Deactivate deployment - uses: bobheadxi/deployments@v1 + uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1.5.0 if: always() with: step: deactivate-env diff --git a/.github/workflows/feature-branch-deploy.yml b/.github/workflows/feature-branch-deploy.yml index e31ac8addd..e46808a3a2 100644 --- a/.github/workflows/feature-branch-deploy.yml +++ b/.github/workflows/feature-branch-deploy.yml @@ -21,21 +21,21 @@ jobs: echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - name: Check out - uses: actions/checkout@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Create deployment - uses: bobheadxi/deployments@v1 + uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1.5.0 id: deployment with: step: start token: ${{ secrets.GITHUB_TOKEN }} env: demo-${{ env.BRANCH_NAME }} - - uses: actions/setup-node@v4 + - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 20 - - uses: pnpm/action-setup@v4 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 name: Install pnpm id: pnpm-install with: @@ -56,14 +56,14 @@ jobs: touch ./storybook/dist/${{ github.sha }}.txt - name: Pushing to pages branch - uses: JamesIves/github-pages-deploy-action@v4 + uses: JamesIves/github-pages-deploy-action@94f3c658273cf92fb48ef99e5fbc02bd2dc642b2 # v4.6.3 with: branch: gh-pages folder: storybook/dist target-folder: demo-${{ env.BRANCH_NAME }} - name: Wait for GitHub Pages to be deployed - uses: mydea/action-wait-for-api@v2 + uses: mydea/action-wait-for-api@45d9c58e690337a05eb5ae14a1478f29eacbf9db # v2.0.0 with: url: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/demo-${{ env.BRANCH_NAME }}/${{ github.sha }}.txt expected-status: 200 @@ -71,7 +71,7 @@ jobs: interval: 15 - name: Update deployment status - uses: bobheadxi/deployments@v1 + uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1.5.0 if: always() with: step: finish diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 5ac9259d35..816cfeed4f 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -11,15 +11,15 @@ jobs: steps: - name: Check out branch - uses: actions/checkout@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up Node.js version - uses: actions/setup-node@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 id: pnpm-install with: version: 9 @@ -31,7 +31,7 @@ jobs: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT - name: Set up pnpm cache - uses: actions/cache@v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} @@ -49,15 +49,15 @@ jobs: steps: - name: Check out branch - uses: actions/checkout@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Set up Node.js version - uses: actions/setup-node@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: "20" - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 id: pnpm-install with: version: 9 @@ -69,7 +69,7 @@ jobs: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT - name: Set up pnpm cache - uses: actions/cache@v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} @@ -93,7 +93,7 @@ jobs: pnpm run --if-present test - name: "Retain build artifact: Storybook" - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 with: name: storybook path: storybook/dist/ diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 073a092f17..3127f64afb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Create release - uses: googleapis/release-please-action@v4 + uses: googleapis/release-please-action@d1a8f221d7723166f48a584aebba00ef3f6febec # v4.1.4 id: release with: token: ${{ secrets.GITHUB_TOKEN }} @@ -21,7 +21,7 @@ jobs: # The logic below handles the npm publication: - name: Check out branch - uses: actions/checkout@v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: # This is necessary because on.workflow_run always runs on the # default branch, which is 'develop' in our case @@ -31,14 +31,14 @@ jobs: if: ${{ steps.release.outputs.releases_created == 'true' }} - name: Set up Node.js version - uses: actions/setup-node@v4 + uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: node-version: 20 registry-url: "https://registry.npmjs.org" if: ${{ steps.release.outputs.releases_created == 'true' }} - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 id: pnpm-install with: version: 9 @@ -52,7 +52,7 @@ jobs: if: ${{ steps.release.outputs.releases_created == 'true' }} - name: Set up pnpm cache - uses: actions/cache@v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 with: path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} @@ -76,7 +76,7 @@ jobs: # The logic below handles the Storybook deploy: - name: "Restore build artifact: Storybook" - uses: dawidd6/action-download-artifact@v6 + uses: dawidd6/action-download-artifact#bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 with: workflow: "lint-test.yml" name: storybook @@ -84,7 +84,7 @@ jobs: if: ${{ steps.release.outputs.releases_created == 'true' }} - name: Deploy to GitHub Pages - uses: JamesIves/github-pages-deploy-action@v4 + uses: JamesIves/github-pages-deploy-action@94f3c658273cf92fb48ef99e5fbc02bd2dc642b2 # v4.6.3 with: branch: gh-pages folder: dist/storybook From e5c16a06c92f27062b2dc346f69ded9b8308ff08 Mon Sep 17 00:00:00 2001 From: Robbert Broersma Date: Fri, 25 Oct 2024 14:34:07 +0200 Subject: [PATCH 3/4] build: configure Node.js version for GitHub Actions in nvmrc --- .github/workflows/feature-branch-cleanup.yml | 2 +- .github/workflows/feature-branch-deploy.yml | 2 +- .github/workflows/lint-test.yml | 4 ++-- .github/workflows/publish.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/feature-branch-cleanup.yml b/.github/workflows/feature-branch-cleanup.yml index b52257468d..a7963ae81f 100644 --- a/.github/workflows/feature-branch-cleanup.yml +++ b/.github/workflows/feature-branch-cleanup.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: - node-version: 20 + node-version-file: .nvmrc - name: Delete folder run: | diff --git a/.github/workflows/feature-branch-deploy.yml b/.github/workflows/feature-branch-deploy.yml index e46808a3a2..1bb711374e 100644 --- a/.github/workflows/feature-branch-deploy.yml +++ b/.github/workflows/feature-branch-deploy.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: - node-version: 20 + node-version-file: .nvmrc - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 name: Install pnpm diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 816cfeed4f..53b25c7b92 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Node.js version uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: - node-version: "20" + node-version-file: .nvmrc - name: Install pnpm uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 @@ -54,7 +54,7 @@ jobs: - name: Set up Node.js version uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: - node-version: "20" + node-version-file: .nvmrc - name: Install pnpm uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3127f64afb..e969166d07 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Node.js version uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: - node-version: 20 + node-version-file: .nvmrc registry-url: "https://registry.npmjs.org" if: ${{ steps.release.outputs.releases_created == 'true' }} From b3b4a3d03a37707fd4890d6cebec7e166887fccc Mon Sep 17 00:00:00 2001 From: Robbert Broersma Date: Fri, 25 Oct 2024 14:35:42 +0200 Subject: [PATCH 4/4] ci: use corepack version of pnpm in GitHub Actions --- .github/workflows/feature-branch-deploy.yml | 1 - .github/workflows/lint-test.yml | 2 -- .github/workflows/publish.yml | 1 - 3 files changed, 4 deletions(-) diff --git a/.github/workflows/feature-branch-deploy.yml b/.github/workflows/feature-branch-deploy.yml index 1bb711374e..c8dce14917 100644 --- a/.github/workflows/feature-branch-deploy.yml +++ b/.github/workflows/feature-branch-deploy.yml @@ -39,7 +39,6 @@ jobs: name: Install pnpm id: pnpm-install with: - version: 9 run_install: false - name: Install dependencies diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 53b25c7b92..8651c8fe33 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -22,7 +22,6 @@ jobs: uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 id: pnpm-install with: - version: 9 run_install: false - name: Get pnpm store directory @@ -60,7 +59,6 @@ jobs: uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 id: pnpm-install with: - version: 9 run_install: false - name: Get pnpm store directory diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e969166d07..0392719ca2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -41,7 +41,6 @@ jobs: uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 id: pnpm-install with: - version: 9 run_install: false if: ${{ steps.release.outputs.releases_created == 'true' }}