Skip to content

Commit

Permalink
Fix publishing with NPM tag without git tag
Browse files Browse the repository at this point in the history
For reasons beyond my comprehension, when you assign `default` to a
GitHub Action input value, it does _not_ prefill the input with that
value when it is missing. I guess we are changing what `default` means?
  • Loading branch information
ranisalt committed Aug 25, 2024
1 parent 0fffd19 commit 4a4c19e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ jobs:
with:
submodules: true

- name: Setup Node.js
uses: actions/setup-node@v4
with:
token: ${{ secrets.NPM_TOKEN }}
registry-url: 'https://registry.npmjs.org'

- name: Download artifacts
id: download-artifact
uses: actions/download-artifact@v4
Expand All @@ -199,8 +205,10 @@ jobs:
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
npm publish --tag ${{ inputs.npm-tag }} --new-version $(echo $VERSION | sed 's/^v//')
npm version --allow-same-version --no-git-tag-version $VERSION
npm publish --tag $TAG
if: ${{ !env.ACT }}
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: ${{ inputs.npm-tag || 'latest' }}
VERSION: ${{ inputs.new-version || github.ref_name }}

0 comments on commit 4a4c19e

Please sign in to comment.