Skip to content

Commit a19a33f

Browse files
committed
update workflows to work with new pnpm
1 parent 8ffcf19 commit a19a33f

File tree

2 files changed

+43
-16
lines changed

2 files changed

+43
-16
lines changed

.github/workflows/main.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,29 @@ on:
77
jobs:
88
build:
99
runs-on: ubuntu-latest
10+
container:
11+
image: node:18
1012
steps:
11-
- uses: actions/checkout@v3
12-
- uses: pnpm/action-setup@v2
13-
with:
14-
version: 7
15-
- uses: actions/setup-node@v3
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Enable Corepack
17+
id: pnpm-setup
18+
run: |
19+
corepack enable
20+
corepack prepare pnpm@latest --activate
21+
pnpm config set script-shell "/usr/bin/bash"
22+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
23+
24+
- name: pnpm Cache
25+
uses: buildjet/cache@v3
1626
with:
17-
node-version: 16.x
18-
cache: "pnpm"
27+
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
28+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
29+
restore-keys: |
30+
${{ runner.os }}-pnpm-store-
31+
32+
- name: Install packages
33+
run: pnpm install --frozen-lockfile
1934

20-
- run: pnpm install --frozen-lockfile
2135
- run: pnpm run lint && pnpm run build

.github/workflows/publish.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,30 @@ jobs:
1414
publish:
1515
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1616
runs-on: ubuntu-latest
17+
container:
18+
image: node:18
1719
steps:
18-
- uses: actions/checkout@v3
19-
- uses: pnpm/action-setup@v2
20-
with:
21-
version: 7
22-
- uses: actions/setup-node@v3
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Enable Corepack
24+
id: pnpm-setup
25+
run: |
26+
corepack enable
27+
corepack prepare pnpm@latest --activate
28+
pnpm config set script-shell "/usr/bin/bash"
29+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
30+
31+
- name: pnpm Cache
32+
uses: buildjet/cache@v3
2333
with:
24-
node-version: 16.x
25-
cache: "pnpm"
34+
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
35+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
36+
restore-keys: |
37+
${{ runner.os }}-pnpm-store-
2638
27-
- run: pnpm install --frozen-lockfile
39+
- name: Install packages
40+
run: pnpm install --frozen-lockfile
2841
- name: Create Release Pull Request or Publish
2942
id: changesets
3043
uses: changesets/action@v1

0 commit comments

Comments
 (0)