Skip to content

Commit

Permalink
ci: only publish @supabase/gotrue-js if version is not 0.0.0 (#828)
Browse files Browse the repository at this point in the history
If the previous step with `npx semantic-release` needs to publish a
version, it will update the `package.json` file with the correct
version. Only then should `@supabase/gotrue-js` be published.
  • Loading branch information
hf committed Dec 20, 2023
1 parent b717b1c commit b664f0f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc
if [ "0.0.0" -neq $(jq -r '.version' package.json) ]
then
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc
for f in package.json package-lock.json
do
sed -i 's|\(["/]\)auth-js|\1gotrue-js|g' "$f"
done
for f in package.json package-lock.json
do
sed -i 's|\(["/]\)auth-js|\1gotrue-js|g' "$f"
done
npm publish --tag latest
fi
npm publish --tag latest

0 comments on commit b664f0f

Please sign in to comment.