File tree 1 file changed +28
-1
lines changed
1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 12
12
13
13
with :
14
14
node-version : ' 20.x'
15
+ registry-url : ' https://registry.npmjs.org'
15
16
16
17
- 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
18
34
19
35
- name : Compile a deployable application bundle
20
36
run : yarn run prod
73
89
curl -s -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
74
90
-X DELETE ${{ steps.version_number.outputs.prev_release }}
75
91
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