Skip to content

Commit 214dedb

Browse files
committed
OIDC publish workflow
1 parent e8f2b8b commit 214dedb

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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@v5
17+
18+
- uses: actions/setup-node@v6
19+
with:
20+
node-version: 24
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- run: npm ci
24+
- run: npm run build
25+
- run: npm publish ./dist/lib --access public

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
"release:patch": "VERSION=patch npm run release",
2323
"release:minor": "VERSION=minor npm run release",
2424
"release:major": "VERSION=major npm run release",
25-
"release:premajor": "VERSION=premajor TAG=next npm run release",
26-
"release:prerelease": "VERSION=prerelease TAG=next npm run release",
27-
"release": "if test $VERSION; then npm run build && cd lib && npm version $VERSION --no-git-tag-version && git add package.json && cd .. && git commit -m \"release\" && npm version $VERSION && npm run build && npm publish ./dist/lib --access public --tag ${TAG:-latest} && git push; fi"
25+
"release": "if test $VERSION; then npm run build && cd lib && npm version $VERSION --no-git-tag-version && git add package.json && cd .. && git commit -m \"release\" && npm version $VERSION && git push && git push origin v$npm_package_version; fi"
2826
},
2927
"private": true,
3028
"dependencies": {
@@ -62,4 +60,4 @@
6260
"typescript-eslint": "^8.33.0",
6361
"zone.js": "^0.15.1"
6462
}
65-
}
63+
}

0 commit comments

Comments
 (0)