Skip to content

Commit f49d1ca

Browse files
committed
Update GitHub Action workflows
1 parent b90960f commit f49d1ca

2 files changed

Lines changed: 21 additions & 17 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
33

44
name: Node.js CI
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [ "master" ]
99
pull_request:
10-
branches: [ master ]
10+
branches: [ "master" ]
1111

1212
jobs:
1313
build:
@@ -16,15 +16,16 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [10.x, 12.x, 14.x, 15.x]
19+
node-version: [18.x, 20.x, 22.x]
2020
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v1
25+
uses: actions/setup-node@v4
2626
with:
2727
node-version: ${{ matrix.node-version }}
28+
cache: 'npm'
2829
- run: npm ci
2930
- run: npm run build --if-present
3031
- run: npm test

.github/workflows/npm-publish.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
2+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
33

44
name: Node.js Package
55

@@ -11,21 +11,21 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v1
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 12
17+
node-version: 20
1818
- run: npm ci
1919
- run: npm test
2020

2121
publish-npm:
2222
needs: build
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v2
26-
- uses: actions/setup-node@v1
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
2727
with:
28-
node-version: 12
28+
node-version: 20
2929
registry-url: https://registry.npmjs.org/
3030
- run: npm ci
3131
- run: npm publish
@@ -35,11 +35,14 @@ jobs:
3535
publish-gpr:
3636
needs: build
3737
runs-on: ubuntu-latest
38+
permissions:
39+
contents: read
40+
packages: write
3841
steps:
39-
- uses: actions/checkout@v2
40-
- uses: actions/setup-node@v1
42+
- uses: actions/checkout@v4
43+
- uses: actions/setup-node@v4
4144
with:
42-
node-version: 12
45+
node-version: 20
4346
registry-url: https://npm.pkg.github.com/
4447
- run: npm ci
4548
- run: npm publish

0 commit comments

Comments
 (0)