File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ publish :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ contents : read
12+ id-token : write
13+ steps :
14+ - uses : actions/checkout@v4
15+ - name : Use Node.js 20.x
16+ uses : actions/setup-node@v4
17+ with :
18+ node-version : 20.x
19+ registry-url : https://registry.npmjs.org/
20+ - name : Upgrade npm for OIDC trusted publishing
21+ run : npm install -g npm@latest
22+ - name : NPM Publish
23+ run : |
24+ npm install
25+ npm run build
26+ VERSION=$(node -p "require('./package.json').version")
27+ # Only publish stable versions to the latest tag
28+ if [[ "$VERSION" =~ ^[^-]+$ ]]; then
29+ NPM_TAG="latest"
30+ else
31+ NPM_TAG="beta"
32+ fi
33+ echo "Publishing $VERSION with $NPM_TAG tag."
34+ npm publish --tag $NPM_TAG --provenance --access public
35+ env :
36+ CI : true
You can’t perform that action at this time.
0 commit comments