Skip to content

Commit 9076f6c

Browse files
authored
chore: Node.js maintenance update (#19)
* chore: migrate from yarn v1 to pnpm * CI: update Node.js version * fix: clean up release workflow after pnpm migration
1 parent 49de1cf commit 9076f6c

File tree

6 files changed

+1930
-1810
lines changed

6 files changed

+1930
-1810
lines changed

.github/workflows/create-release-pr.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ jobs:
2020
pull-requests: write
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
24+
with:
25+
persist-credentials: false
26+
27+
- name: Install pnpm
28+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
2429
with:
2530
persist-credentials: false
2631

@@ -34,11 +39,11 @@ jobs:
3439
with:
3540
node-version: 'lts/*'
3641

37-
# No need to install dependencies - npm version works without them
42+
# No need to install dependencies - pnpm version works without them
3843
- name: Version bump
3944
id: version
4045
run: |
41-
npm version "$VERSION_TYPE" --no-git-tag-version
46+
pnpm version "$VERSION_TYPE" --no-git-tag-version
4247
VERSION=$(jq -r '.version' package.json)
4348
echo "version=$VERSION" >> $GITHUB_OUTPUT
4449
env:
@@ -97,7 +102,7 @@ jobs:
97102
commit-message: "chore: release v${{ steps.version.outputs.version }}"
98103
add-paths: |
99104
package.json
100-
yarn.lock
105+
pnpm.lock
101106
labels: |
102107
Type: Release
103108
assignees: ${{ github.actor }}

.github/workflows/release.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ jobs:
2828
pull-requests: write # PR comment
2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
31+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
32+
with:
33+
persist-credentials: false
34+
35+
- name: Install pnpm
36+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
3237
with:
3338
persist-credentials: false
3439

@@ -65,28 +70,19 @@ jobs:
6570
node-version: 'lts/*'
6671
registry-url: 'https://registry.npmjs.org'
6772

68-
- name: Ensure npm 11.5.1 or later is installed
69-
if: steps.tag-check.outputs.exists == 'false'
70-
run: |
71-
NPM_VERSION=$(npm -v)
72-
echo "Current npm version: $NPM_VERSION"
73-
if ! npx semver -r ">=11.5.1" "$NPM_VERSION"; then
74-
echo "npm version $NPM_VERSION is too old. Installing latest npm..."
75-
npm install -g npm@latest
76-
echo "Updated npm version: $(npm -v)"
77-
fi
73+
# pnpm is already installed via pnpm/action-setup
7874

7975
- name: Install dependencies
8076
if: steps.tag-check.outputs.exists == 'false'
81-
run: yarn install --frozen-lockfile
77+
run: pnpm install --frozen-lockfile
8278

8379
- name: Build package
8480
if: steps.tag-check.outputs.exists == 'false'
85-
run: yarn run build
81+
run: pnpm run build
8682

8783
- name: Publish to npm with provenance
8884
if: steps.tag-check.outputs.exists == 'false'
89-
run: npm publish --provenance --access public
85+
run: pnpm publish --provenance --access public
9086

9187
- name: Create GitHub Release with tag
9288
id: create-release

.github/workflows/test.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,22 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [ 16, 18 ]
13+
node-version: [ 20, 22, 24 ]
1414
steps:
1515
- name: checkout
16-
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
16+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5
17+
with:
18+
persist-credentials: false
19+
20+
- name: Install pnpm
21+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
1722
with:
1823
persist-credentials: false
1924
- name: setup Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1.4.6
25+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2126
with:
2227
node-version: ${{ matrix.node-version }}
2328
- name: Install
24-
run: yarn install
29+
run: pnpm install
2530
- name: Test
26-
run: yarn run build
31+
run: pnpm run build

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@
5454
"ts-node": "^10.9.1",
5555
"ts-node-test-register": "^10.0.0",
5656
"typescript": "^4.9.4"
57-
}
57+
},
58+
"packageManager": "[email protected]+sha512.34e538c329b5553014ca8e8f4535997f96180a1d0f614339357449935350d924e22f8614682191264ec33d1462ac21561aff97f6bb18065351c162c7e8f6de67"
5859
}

0 commit comments

Comments
 (0)