Skip to content

Commit 77e2545

Browse files
committed
Using latest templates for CI workflows
1 parent fba5db7 commit 77e2545

File tree

2 files changed

+21
-43
lines changed

2 files changed

+21
-43
lines changed

.github/workflows/nodejs.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
name: Node CI
2-
permissions:
3-
contents: read
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
45

56
on:
67
push:
7-
branches: [ main ]
8+
branches: [ "main" ]
89
pull_request:
9-
branches: [ main ]
10+
branches: [ "main" ]
1011

1112
jobs:
1213
build:
@@ -16,18 +17,15 @@ jobs:
1617
strategy:
1718
matrix:
1819
node-version: [18.x, 22.x]
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1921

2022
steps:
21-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2224
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v3
25+
uses: actions/setup-node@v4
2426
with:
2527
node-version: ${{ matrix.node-version }}
2628
cache: 'npm'
27-
- name: npm install, build, and test
28-
run: |
29-
npm ci
30-
npm run build --if-present
31-
npm test
32-
env:
33-
CI: true
29+
- run: npm ci
30+
- run: npm run build --if-present
31+
- run: npm test

.github/workflows/npm-publish.yml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
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

6-
permissions:
7-
contents: read
8-
packages: write
9-
106
on:
117
release:
128
types: [created]
@@ -17,42 +13,26 @@ jobs:
1713
permissions:
1814
contents: read
1915
steps:
20-
- uses: actions/checkout@v3
21-
- uses: actions/setup-node@v3
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
2218
with:
23-
node-version: 18
19+
node-version: 22
2420
- run: npm ci
2521
- run: npm test
2622

2723
publish-npm:
2824
needs: build
2925
runs-on: ubuntu-latest
3026
permissions:
31-
contents: write
27+
contents: read
28+
packages: write
3229
steps:
33-
- uses: actions/checkout@v3
34-
- uses: actions/setup-node@v3
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-node@v4
3532
with:
36-
node-version: 18
33+
node-version: 22
3734
registry-url: https://registry.npmjs.org/
3835
- run: npm ci
3936
- run: npm publish
4037
env:
4138
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
42-
43-
# publish-gpr:
44-
# needs: build
45-
# runs-on: ubuntu-latest
46-
# permissions:
47-
# contents: read
48-
# packages: write
49-
# steps:
50-
# - uses: actions/checkout@v3
51-
# - uses: actions/setup-node@v3
52-
# with:
53-
# node-version: 18
54-
# registry-url: https://npm.pkg.github.com/
55-
# - run: npm ci
56-
# - run: npm publish
57-
# env:
58-
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)