File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
33# Checking if current tag matches the package version
4- current_tag=$( echo $GITHUB_REF | tr -d ' refs/tags/v ' )
4+ current_tag=$( echo $GITHUB_REF | cut -d ' / ' -f 3 | tr -d ' ' )
55file_tag=$( grep ' "version":' package.json | cut -d ' :' -f 2- | tr -d ' ' | tr -d ' "' | tr -d ' ,' )
66if [ " $current_tag " != " $file_tag " ]; then
77 echo " Error: the current tag does not match the version in package file(s)."
Original file line number Diff line number Diff line change 11name : publish to npm
22on :
3- push :
4- tags :
5- - v*
3+ release :
4+ types : [published]
65
76jobs :
87 publish-npm :
@@ -13,13 +12,19 @@ jobs:
1312 with :
1413 node-version : 12
1514 registry-url : https://registry.npmjs.org/
15+ - name : Check release validity
16+ run : sh .github/scripts/check-release.sh
1617 - name : Install dependencies
1718 run : yarn install
18- - name : Build
19+ - name : Build meilisearch-js
1920 run : yarn build
20- - name : Check release validity
21- run : sh .github/scripts/check-release.sh
22- - name : Publish
21+ - name : Publish with latest tag
22+ if : " github.event.release.release"
2323 run : npm publish .
2424 env :
2525 NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
26+ - name : Publish with beta tag
27+ if : " github.event.release.prerelease"
28+ run : npm publish . --tag beta
29+ env :
30+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
You can’t perform that action at this time.
0 commit comments