Skip to content

Commit 477b5bc

Browse files
committed
Update GitHub Actions
1 parent f6478af commit 477b5bc

2 files changed

Lines changed: 24 additions & 34 deletions

File tree

.github/workflows/nodejs.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
name: Node CI
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
3+
4+
name: Node.js CI
5+
permissions:
6+
contents: read
27

38
on:
49
push:
5-
branches: [ main ]
10+
branches: [ "main" ]
611
pull_request:
7-
branches: [ main ]
12+
branches: [ "main" ]
813

914
jobs:
1015
build:
@@ -14,18 +19,15 @@ jobs:
1419
strategy:
1520
matrix:
1621
node-version: [18.x, 22.x]
22+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1723

1824
steps:
1925
- uses: actions/checkout@v4
2026
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v3
27+
uses: actions/setup-node@v4
2228
with:
2329
node-version: ${{ matrix.node-version }}
2430
cache: 'npm'
25-
- name: npm install, build, and test
26-
run: |
27-
npm ci
28-
npm run build --if-present
29-
npm test
30-
env:
31-
CI: true
31+
- run: npm ci
32+
- run: npm run build --if-present
33+
- run: npm test

.github/workflows/npm-publish.yml

Lines changed: 11 additions & 23 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

@@ -10,41 +10,29 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
1315
steps:
1416
- uses: actions/checkout@v4
15-
- uses: actions/setup-node@v3
17+
- uses: actions/setup-node@v4
1618
with:
17-
node-version: 18
19+
node-version: 22
1820
- run: npm ci
1921
- run: npm test
2022

2123
publish-npm:
2224
needs: build
2325
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
packages: write
2429
steps:
2530
- uses: actions/checkout@v4
26-
- uses: actions/setup-node@v3
31+
- uses: actions/setup-node@v4
2732
with:
28-
node-version: 18
33+
node-version: 22
2934
registry-url: https://registry.npmjs.org/
3035
- run: npm ci
31-
- run: npm publish --access=public
36+
- run: npm publish
3237
env:
3338
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
34-
35-
# publish-gpr:
36-
# needs: build
37-
# runs-on: ubuntu-latest
38-
# permissions:
39-
# contents: read
40-
# packages: write
41-
# steps:
42-
# - uses: actions/checkout@v4
43-
# - uses: actions/setup-node@v3
44-
# with:
45-
# node-version: 18
46-
# registry-url: https://npm.pkg.github.com/
47-
# - run: npm ci
48-
# - run: npm publish
49-
# env:
50-
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)