Skip to content

Commit ec27ccc

Browse files
committed
Add trusted published github workflow
1 parent 73f4db5 commit ec27ccc

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
on:
2+
release:
3+
types: [published]
4+
5+
permissions:
6+
id-token: write # Required for OIDC
7+
contents: read
8+
9+
jobs:
10+
npm-publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
# Ensure npm 11.5.1 or later is installed
23+
- name: Update npm
24+
run: npm install -g npm@latest
25+
- run: npm ci
26+
- run: npm run build --if-present
27+
- run: npm test
28+
- run: npm publish

.github/workflows/node.js.yml renamed to .github/workflows/test.js.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Workflow for testing of node-red-retry using github actions / Node.js.
1+
# Workflow for testing of node-red-persistent-values using github actions / Node.js.
22
# The workflow will do a checkout, installation of dependencies and run tests.
33
#
44
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
@@ -11,7 +11,7 @@ on:
1111
branches: [ "master" ]
1212

1313
env:
14-
NODEJS_DEFAULT_VERSION: 20.x
14+
NODEJS_DEFAULT_VERSION: 22.x
1515

1616
jobs:
1717
lint:
@@ -27,23 +27,26 @@ jobs:
2727
- name: Run eslint
2828
run: npm run lint
2929

30-
3130
unit-test:
3231
runs-on: ubuntu-latest
3332

3433
strategy:
3534
matrix:
3635
# https://nodered.org/docs/faq/node-versions
37-
node-version: [20.x, 22.x]
36+
node-version: [20.x, 22.x, 24.x]
3837

3938
steps:
40-
- uses: actions/checkout@v4
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
4142
- name: Use Node.js ${{ matrix.node-version }}
4243
uses: actions/setup-node@v4
4344
with:
4445
node-version: ${{ matrix.node-version }}
46+
4547
- name: Install dependencies
4648
run: npm install
49+
4750
- name: Run unit tests
4851
run: npm run coverage
4952

0 commit comments

Comments
 (0)