File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 16
16
with :
17
17
node-version : 20
18
18
registry-url : https://registry.npmjs.org/
19
- - run : npm ci
20
- - run : npm test
21
- - run : npm run build
22
- - run : npm publish
19
+ cache : " npm"
20
+ - name : Install dependencies
21
+ run : npm ci
22
+ - name : Run tests
23
+ run : npm test
24
+ - name : Build package
25
+ run : npm run build
26
+ - name : Check package version matches release
27
+ run : |
28
+ PKG_VERSION=$(node -p "require('./package.json').version")
29
+ GITHUB_REF_VERSION=${GITHUB_REF#refs/tags/v}
30
+ if [ "$PKG_VERSION" != "$GITHUB_REF_VERSION" ]; then
31
+ echo "::error::Package version ($PKG_VERSION) does not match release tag ($GITHUB_REF_VERSION)"
32
+ exit 1
33
+ fi
34
+ - name : Publish to NPM
35
+ run : npm publish --provenance --access public
23
36
env :
24
37
NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
You can’t perform that action at this time.
0 commit comments