Skip to content

Commit 04dd431

Browse files
committed
Update workflows
1 parent e1ca37e commit 04dd431

File tree

2 files changed

+13
-25
lines changed

2 files changed

+13
-25
lines changed

.github/workflows/node.js.yml

Lines changed: 7 additions & 5 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
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
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

44
name: Node.js CI
55

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

1212
jobs:
1313
build:
@@ -17,13 +17,15 @@ jobs:
1717
strategy:
1818
matrix:
1919
node-version: [12.x, 14.x, 16.x]
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2021

2122
steps:
22-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2324
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v1
25+
uses: actions/setup-node@v3
2526
with:
2627
node-version: ${{ matrix.node-version }}
28+
cache: 'npm'
2729
- run: npm ci
2830
- run: npm run build --if-present
2931
- run: npm test

.github/workflows/npm-publish.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,23 @@ 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@v3
15+
- uses: actions/setup-node@v3
1616
with:
17-
node-version: 14
17+
node-version: 16
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@v3
26+
- uses: actions/setup-node@v3
2727
with:
28-
node-version: 14
28+
node-version: 16
2929
registry-url: https://registry.npmjs.org/
3030
- run: npm ci
3131
- run: npm publish
3232
env:
3333
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
34-
35-
publish-gpr:
36-
needs: build
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@v2
40-
- uses: actions/setup-node@v1
41-
with:
42-
node-version: 14
43-
registry-url: https://npm.pkg.github.com/
44-
- run: npm ci
45-
- run: npm publish
46-
env:
47-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)