Skip to content

Commit d22072b

Browse files
authored
Merge pull request #479 from NodeSecure/oidc-publish
feat: publish package using NPM OIDC trusted publisher
1 parent 38eb4af commit d22072b

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/publish.yml

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

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
"preview:dark": "node --no-warnings ./scripts/preview.ts --theme dark",
2525
"prepublishOnly": "npm run build"
2626
},
27+
"publishConfig": {
28+
"registry": "https://registry.npmjs.org",
29+
"access": "public",
30+
"provenance": true
31+
},
2732
"files": [
2833
"dist"
2934
],

0 commit comments

Comments
 (0)