File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish
2+ on :
3+ release :
4+ types : [published]
5+ jobs :
6+ publish-npm :
7+ runs-on : ubuntu-latest
8+ permissions :
9+ contents : read
10+ id-token : write
11+ steps :
12+ - uses : actions/checkout@v4
13+ - uses : actions/setup-node@v4
14+ with :
15+ node-version : 18
16+ registry-url : https://registry.npmjs.org/
17+ cache : ' npm'
18+
19+ - run : npm ci
20+ - run : npm run build
21+
22+ - name : Lint
23+ run : npm run lint
24+ - name : Format check
25+ run : npm run format
26+
27+ - name : Check package version
28+ run : |
29+ PKG_VERSION=$(node -p "require('./package.json').version")
30+ TAG_VERSION=${GITHUB_REF#refs/tags/v}
31+ if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
32+ echo "Package version ($PKG_VERSION) does not match tag version ($TAG_VERSION)"
33+ exit 1
34+ fi
35+
36+ - run : npm publish --access public
37+ env :
38+ NODE_AUTH_TOKEN : ${{secrets.NPM}}
You can’t perform that action at this time.
0 commit comments