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 : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*.*.*'
7+
8+ permissions :
9+ contents : read
10+ id-token : write
11+
12+ jobs :
13+ publish :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - uses : actions/checkout@v4
17+ - uses : actions/setup-node@v4
18+ with :
19+ node-version : 20
20+ registry-url : ' https://registry.npmjs.org'
21+ cache : npm
22+ - run : rm -f package-lock.json && npm install
23+ - name : Verify tag matches package.json version
24+ run : |
25+ TAG_VERSION="${GITHUB_REF_NAME#v}"
26+ PKG_VERSION=$(node -p "require('./package.json').version")
27+ if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
28+ echo "Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)"
29+ exit 1
30+ fi
31+ - run : npm run lint
32+ - run : npm test
33+ - run : npm publish --access public --provenance
34+ env :
35+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments