File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish to npm
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+ tags :
7+ - ' [0-9]*.[0-9]*.[0-9]*'
8+
9+ jobs :
10+ publish :
11+ runs-on : ubuntu-latest
12+
13+ permissions :
14+ id-token : write
15+ contents : read
16+
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - uses : actions/setup-node@v4
21+ with :
22+ node-version : 24
23+ cache : npm
24+ registry-url : https://registry.npmjs.org
25+
26+ - run : npm ci
27+
28+ - name : Verify tag matches package.json version
29+ if : github.event_name == 'push'
30+ env :
31+ TAG : ${{ github.ref_name }}
32+ run : |
33+ PKG_VERSION=$(node -p "require('./package.json').version")
34+ if [ "$TAG" != "$PKG_VERSION" ]; then
35+ echo "Tag '$TAG' does not match package.json version '$PKG_VERSION'."
36+ exit 1
37+ fi
38+
39+ - run : npm run lint
40+ - run : npm run format:check
41+ - run : npm run typecheck
42+ - run : npm run build
43+ - run : npm test
44+
45+ - run : npm publish --provenance --access public
You can’t perform that action at this time.
0 commit comments