Skip to content

Commit 5476da7

Browse files
authored
chore: update to pnpm 7.1.0 and install version from packageManager field in ci (#336)
1 parent 5b60976 commit 5476da7

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ jobs:
2727
- uses: actions/setup-node@v3
2828
with:
2929
node-version: ${{ matrix.node }}
30-
- run: npm i -g pnpm@7
30+
- name: install pnpm
31+
shell: bash
32+
run: |
33+
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json)
34+
echo installing pnpm version $PNPM_VER
35+
npm i -g pnpm@$PNPM_VER
3136
- uses: actions/setup-node@v3
3237
with:
3338
node-version: ${{ matrix.node }}
@@ -65,7 +70,12 @@ jobs:
6570
- uses: actions/setup-node@v3
6671
with:
6772
node-version: ${{ matrix.node }}
68-
- run: npm i -g pnpm@7
73+
- name: install pnpm
74+
shell: bash
75+
run: |
76+
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json)
77+
echo installing pnpm version $PNPM_VER
78+
npm i -g pnpm@$PNPM_VER
6979
- uses: actions/setup-node@v3
7080
with:
7181
node-version: ${{ matrix.node }}

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ jobs:
2525
- uses: actions/setup-node@v3
2626
with:
2727
node-version: ${{ matrix.node }}
28-
- run: npm i -g pnpm@7
28+
- name: install pnpm
29+
shell: bash
30+
run: |
31+
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json)
32+
echo installing pnpm version $PNPM_VER
33+
npm i -g pnpm@$PNPM_VER
2934
- uses: actions/setup-node@v3
3035
with:
3136
node-version: ${{ matrix.node }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@
6464
"prettier --write"
6565
]
6666
},
67+
"packageManager": "[email protected]",
6768
"engines": {
68-
"pnpm": "^7.0.0",
69+
"pnpm": "^7.1.0",
6970
"yarn": "forbidden, use pnpm",
7071
"npm": "forbidden, use pnpm",
7172
"node": "^14.13.1 || >= 16"

0 commit comments

Comments
 (0)