Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: configure pnpm version for corepack #1659

Merged
merged 5 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/feature-branch-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ 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
node-version-file: .nvmrc

- name: Delete folder
run: |
Expand All @@ -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
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/feature-branch-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,24 @@ 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
node-version-file: .nvmrc

- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false

- name: Install dependencies
Expand All @@ -56,22 +55,22 @@ 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
timeout: 600
interval: 15

- name: Update deployment status
uses: bobheadxi/deployments@v1
uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1.5.0
if: always()
with:
step: finish
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ 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"
node-version-file: .nvmrc

- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
id: pnpm-install
with:
version: 9
run_install: false

- name: Get pnpm store directory
Expand All @@ -31,7 +30,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') }}
Expand All @@ -49,18 +48,17 @@ 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"
node-version-file: .nvmrc

- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
id: pnpm-install
with:
version: 9
run_install: false

- name: Get pnpm store directory
Expand All @@ -69,7 +67,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') }}
Expand All @@ -93,7 +91,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/
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ 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 }}
target-branch: main

# 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
Expand All @@ -31,17 +31,16 @@ 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
node-version-file: .nvmrc
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
run_install: false
if: ${{ steps.release.outputs.releases_created == 'true' }}

Expand All @@ -52,7 +51,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') }}
Expand All @@ -76,15 +75,15 @@ 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
path: dist/storybook
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
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,6 @@
"path-to-regexp@<0.1.10": ">=0.1.10",
"cookie@<0.7.0": ">=0.7.0"
}
}
},
"packageManager": "[email protected]+sha512.22721b3a11f81661ae1ec68ce1a7b879425a1ca5b991c975b074ac220b187ce56c708fe5db69f4c962c989452eee76c82877f4ee80f474cebd61ee13461b6228"
}