Skip to content

Commit

Permalink
fix: Only try to publish when version has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
eliassjogreen committed Dec 18, 2024
1 parent ae0d6a5 commit 4424655
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
push:
branches:
- main
paths:
- deno.json

jobs:
publish:
Expand All @@ -19,9 +21,16 @@ jobs:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- uses: denoland/setup-deno@v1
- run: deno run -A scripts/npm.ts
- run: |
echo "DENO_VERSION=$(cat deno.json | jq \".version\")" >> $GITHUB_ENV
echo "NPM_VERSION=$(npm info @denosaurs/typefetch --json | jq \".['dist-tags'].latest\")" >> $GITHUB_ENV
echo "JSR_VERSION=$(curl -s https://jsr.io/@denosaurs/typefetch/meta.json | jq \".latest\")" >> $GITHUB_ENV
- run: deno publish
if: ${{ env.DENO_VERSION != env.JSR_VERSION }}
- run: deno run -A scripts/npm.ts
if: ${{ env.DENO_VERSION != env.NPM_VERSION }}
- run: npm publish --provenance --access public
if: ${{ env.DENO_VERSION != env.NPM_VERSION }}
working-directory: ./npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 4424655

Please sign in to comment.