File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ build :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v3
12+ - uses : actions/setup-node@v3
13+ with :
14+ node-version : ' 24.x'
15+ registry-url : ' https://registry.npmjs.org'
16+ cache : ' npm'
17+ - name : Check release tag
18+ run : |
19+ VERSION=$(node -p "const ver=require('./package.json').version; ver.startsWith('v') ? ver : 'v' + ver")
20+ TAG=${{ github.ref }}
21+ TAG=${TAG#refs/tags/}
22+ if [ "$VERSION" != "$TAG" ]; then
23+ echo "Error: The release tag ($TAG) does not match the version ($VERSION) in package.json"
24+ exit 1
25+ fi
26+ - run : npm ci
27+ # env:
28+ # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_READ }}
29+ - run : npm run test
30+ - run : npm run build --if-present
31+ - run : npm publish
32+ env :
33+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN_PUBLISH }}
You can’t perform that action at this time.
0 commit comments