Skip to content

Commit

Permalink
Fix more bits of workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gausie committed Jul 10, 2024
1 parent a990179 commit 61a49bd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,19 @@ jobs:
- uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
- run: yarn
- run: yarn publish

- name: Check publish status
id: check
run: |
NEXT_VERSION=$(jq -r '.version' < packages/garbo-lib/package.json)
STATUS=$(curl --write-out '%{http_code}\n' --head --silent --output /dev/null https://registry.npmjs.org/garbo-lib/$NEXT_VERSION)
echo "status=$STATUS" >> "$GITHUB_OUTPUT"
- name: Publish if necessary
if: ${{ steps.check.outputs.status == '404' }}
run: |
yarn
yarn npm publish
env:
STATUS: ${{ steps.check.outputs.status }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 61a49bd

Please sign in to comment.