Skip to content

Commit ea6db8a

Browse files
Modernize CI workflows
1 parent 6be01ac commit ea6db8a

File tree

4 files changed

+10
-57
lines changed

4 files changed

+10
-57
lines changed

.github/workflows/nodejs.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,14 @@ jobs:
1818
node-version: [20, 22]
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2222
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v2
23+
uses: actions/setup-node@v4
2424
with:
2525
node-version: ${{ matrix.node-version }}
26-
- name: Use cached node_modules
27-
id: cache
28-
uses: actions/cache@v2
29-
with:
30-
path: node_modules
31-
key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }}
32-
restore-keys: |
33-
nodeModules-
26+
cache: 'npm'
27+
3428
- name: Install dependencies
35-
if: steps.cache.outputs.cache-hit != 'true'
3629
run: npm install
37-
env:
38-
CI: true
30+
3931
- run: npm test
40-
env:
41-
CI: true

.github/workflows/prepare-release.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
tags:
77
- 'v*'
88

9-
env:
10-
CI: true
11-
129
permissions:
1310
contents: read
1411

@@ -24,31 +21,20 @@ jobs:
2421
node-version: [22]
2522

2623
steps:
27-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2825

2926
- name: Use Node.js ${{ matrix.node-version }}
30-
uses: actions/setup-node@v3
27+
uses: actions/setup-node@v4
3128
with:
3229
node-version: ${{ matrix.node-version }}
3330
registry-url: 'https://registry.npmjs.org'
34-
35-
- name: Use cached node_modules
36-
id: cache
37-
uses: actions/cache@v3
38-
with:
39-
path: node_modules
40-
key: nodeModules-${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}
31+
cache: 'npm'
4132

4233
- name: Install dependencies
43-
if: steps.cache.outputs.cache-hit != 'true'
4434
run: npm install
45-
env:
46-
CI: true
4735

4836
- name: Test
4937
run: npm test
50-
env:
51-
CI: true
5238

5339
- name: Resolve version
5440
id: vars

.github/workflows/release-insiders.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,13 @@ jobs:
2424
with:
2525
node-version: ${{ matrix.node-version }}
2626
registry-url: 'https://registry.npmjs.org'
27-
28-
- name: Use cached node_modules
29-
id: cache
30-
uses: actions/cache@v3
31-
with:
32-
path: node_modules
33-
key: nodeModules-${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}
27+
cache: 'npm'
3428

3529
- name: Install dependencies
36-
if: steps.cache.outputs.cache-hit != 'true'
3730
run: npm install
38-
env:
39-
CI: true
4031

4132
- name: Test
4233
run: npm test
43-
env:
44-
CI: true
4534

4635
- name: Resolve version
4736
id: vars
@@ -53,5 +42,4 @@ jobs:
5342
- name: Publish
5443
run: npm publish --provenance --tag insiders
5544
env:
56-
CI: true
5745
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,13 @@ jobs:
2424
with:
2525
node-version: ${{ matrix.node-version }}
2626
registry-url: 'https://registry.npmjs.org'
27-
28-
- name: Use cached node_modules
29-
id: cache
30-
uses: actions/cache@v3
31-
with:
32-
path: node_modules
33-
key: nodeModules-${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}
27+
cache: 'npm'
3428

3529
- name: Install dependencies
36-
if: steps.cache.outputs.cache-hit != 'true'
3730
run: npm install
38-
env:
39-
CI: true
4031

4132
- name: Test
4233
run: npm test
43-
env:
44-
CI: true
4534

4635
- name: Calculate environment variables
4736
run: |

0 commit comments

Comments
 (0)