Skip to content

Commit

Permalink
Add publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
nkshah2 committed Jun 3, 2022
1 parent 64743c4 commit a1d445c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .circleci/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version=$(cat ../package.json | jq .version | tr -d '"')
isLatest=`curl -s -X GET \
"https://api.supertokens.io/0/frontend/latest/check?password=$SUPERTOKENS_API_KEY&version=$version&name=web-js" \
-H 'api-version: 0'`
if [[ $? -ne 0 ]]
then
echo "api not working... exiting!"
exit 1
fi
if [[ `echo $isLatest | jq .isLatest` == "true" ]]
then
cd ..
npm publish --tag latest
else
cd ..
npm publish --tag version-$version
fi

0 comments on commit a1d445c

Please sign in to comment.