File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Publish to npm
22
33on :
4- release :
5- types : [published]
4+ push :
5+ tags :
6+ - ' v*'
67
78jobs :
89 publish :
1314 permissions :
1415 contents : read
1516 id-token : write
16- attestations : write
1717
1818 steps :
1919 - name : Checkout
@@ -26,11 +26,14 @@ jobs:
2626 cache : ' npm'
2727 registry-url : ' https://registry.npmjs.org'
2828
29+ - name : Update npm to latest (required for trusted publishers)
30+ run : npm install -g npm@latest
31+
2932 - name : Extract version from tag
3033 id : version
3134 run : |
3235 # Remove 'v' prefix if present (e.g., v1.0.0 -> 1.0.0)
33- VERSION=${GITHUB_REF_NAME# v}
36+ VERSION=${GITHUB_REF#refs/tags/ v}
3437 echo "version=$VERSION" >> $GITHUB_OUTPUT
3538 echo "Publishing version: $VERSION"
3639
4952 - name : Build library
5053 run : npm run build:lib
5154
52- - name : Publish to npm (trusted publishing)
53- run : npm publish --provenance -- access public
55+ - name : Publish to npm
56+ run : npm publish --access public
You can’t perform that action at this time.
0 commit comments