Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ jobs:
node-version: 22.12.0
registry-url: https://registry.npmjs.org

- name: Verify npm auth secret
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY || secrets.NPM_TOKEN }}
shell: bash
run: |
if [[ -z "${NODE_AUTH_TOKEN}" ]]; then
echo "Missing npm auth secret. Expected NPM_KEY or NPM_TOKEN." >&2
exit 1
fi

- name: Determine publish version
id: version
shell: bash
Expand All @@ -59,10 +69,10 @@ jobs:
if: steps.version.outputs.type == 'release'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY || secrets.NPM_TOKEN }}

- name: Publish canary
if: steps.version.outputs.type == 'canary'
run: npm publish --tag canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY || secrets.NPM_TOKEN }}