Skip to content

Commit 68fa3f0

Browse files
authored
Update workflows and bump node versions to 18, 20 and 21 (#9)
1 parent fc7b47a commit 68fa3f0

File tree

4 files changed

+49
-17
lines changed

4 files changed

+49
-17
lines changed

.github/workflows/formatting.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717

18-
- name: Use Node.js 16
18+
- name: Install Node.js
1919
uses: actions/setup-node@v3
2020
with:
21-
node-version: '16.x'
21+
node-version: '20.x'
2222
cache: 'yarn'
2323

2424
- run: yarn install

.github/workflows/node.js.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,43 @@ on:
99
pull_request:
1010
branches: [main]
1111

12+
# Ensure that only one instance of the workflow is run at a time for each branch/tag.
13+
# Jobs currently running on the branch/tag will be cancelled when new commits are pushed.
14+
# See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency.
15+
concurrency:
16+
# `github.workflow` is the workflow name, `github.ref` is the current branch/tag identifier
17+
group: ${{ format('{0}:{1}', github.workflow, github.ref) }}
18+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
19+
1220
jobs:
13-
build-and-test:
21+
build:
1422
runs-on: ${{ matrix.os }}
23+
continue-on-error: true
1524

1625
strategy:
1726
matrix:
18-
os: [ubuntu-latest, windows-2019, macos-latest]
27+
os: [ubuntu-latest, windows-latest, macos-latest]
1928
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20-
node-version: [14.x, 16.x, 18.x]
29+
node-version: [18.x, 20.x, 21.x]
2130

2231
steps:
23-
- uses: actions/checkout@v3
32+
- name: Checkout Code
33+
uses: actions/checkout@v3
2434

25-
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v3
35+
- name: Install Node.js ${{ matrix.node-version }}
36+
uses: actions/setup-node@v4
2737
with:
2838
node-version: ${{ matrix.node-version }}
2939
cache: 'yarn'
3040

31-
- run: yarn install
32-
- run: yarn test
41+
- name: Install node-gyp
42+
run: npm install -g node-gyp@10.0.1
43+
44+
- name: Install dependencies
45+
run: yarn
46+
47+
- name: Build
48+
run: yarn build
49+
50+
- name: Run tests
51+
run: yarn test

.github/workflows/publish-to-npm.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,32 @@ jobs:
88
publish_to_npm:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- name: Checkout Code
12+
uses: actions/checkout@v3
1213
with:
1314
ref: main
1415

1516
# Installs Node and sets up up the .npmrc file to publish to npm
16-
- uses: actions/setup-node@v3
17+
- name: Install Node.js
18+
uses: actions/setup-node@v4
1719
with:
18-
node-version: '16.x'
20+
node-version: '20.x'
1921
registry-url: 'https://registry.npmjs.org'
2022
cache: 'yarn'
2123

22-
- run: yarn install
23-
- run: yarn test
24-
- run: node .github/auto-publish-action.js
24+
- name: Install node-gyp
25+
run: npm install -g node-gyp@10.0.1
26+
27+
- name: Install dependencies
28+
run: yarn
29+
30+
- name: Build
31+
run: yarn build
32+
33+
- name: Run tests
34+
run: yarn test
35+
36+
- name: Publish to npm
37+
run: node .github/auto-publish-action.js
2538
env:
2639
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "nbsdecoder.js",
66
"types": "nbsdecoder.d.ts",
77
"engines": {
8-
"node": ">=14.14.0"
8+
"node": ">=18.17.0"
99
},
1010
"files": [
1111
"nbsdecoder.js",

0 commit comments

Comments
 (0)