File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 12121313 with :
1414 node-version : ' 20.x'
15+ registry-url : ' https://registry.npmjs.org'
1516
1617 - name : Install all required dependencies
17- run : yarn install
18+ run : |
19+ yarn install
20+ sudo apt-get update
21+ sudo apt-get -y install jq
22+
23+ - name : Check package version
24+ run : |
25+ if [ ${{ startsWith(github.ref, 'refs/tags/') }} = true ]; then
26+ VERSION=$(basename ${{ github.ref }})
27+ # Abort if version is not the same as in package.json
28+ PKGVERSION=$(jq -r '.version' package.json)
29+ if [ "$VERSION" != "v$PKGVERSION" ]; then
30+ echo "Version mismatch: tag is ${VERSION}, package.json version is ${PKGVERSION}"
31+ exit 1
32+ fi
33+ fi
1834
1935 - name : Compile a deployable application bundle
2036 run : yarn run prod
7389 curl -s -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
7490 -X DELETE ${{ steps.version_number.outputs.prev_release }}
7591 if : steps.version_number.outputs.prev_release != ''
92+
93+
94+ - name : Publish to NPM
95+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags/')
96+ run : |
97+ npm run dist
98+ pushd dist
99+ npm publish
100+ popd
101+ env :
102+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments