Skip to content

Commit f671d97

Browse files
authored
Add a GH Actions job for trusted publishing (#14)
see also: https://docs.npmjs.com/trusted-publishers
1 parent e6f9621 commit f671d97

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/publish.yml

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

0 commit comments

Comments
 (0)