Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 20 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,29 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
registry-url: 'https://registry.npmjs.org'

# Upgrade npm to a version that supports OIDC trusted publishing (>= 11.5.1)
- name: Upgrade npm for OIDC trusted publishing
run: npm install -g npm@latest

- run: npm ci

- run: npm run build

- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Determine npm dist-tag from package.json
id: dist_tag
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *-* ]]; then
echo "npm_tag=next" >> "$GITHUB_OUTPUT"
echo "Publishing pre-release $VERSION to @next"
else
echo "npm_tag=latest" >> "$GITHUB_OUTPUT"
echo "Publishing $VERSION to @latest"
fi

# Authentication via OIDC trusted publisher (configured on npmjs.com).
# No NPM_TOKEN needed.
- run: npm publish --provenance --access public --tag ${{ steps.dist_tag.outputs.npm_tag }}
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

# Upgrade npm to a version that supports OIDC trusted publishing (>= 11.5.1)
- name: Upgrade npm for OIDC trusted publishing
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci

Expand All @@ -93,10 +97,10 @@ jobs:
echo "Publishing $TAG to @latest"
fi

# Authentication via OIDC trusted publisher (configured on npmjs.com).
# No NPM_TOKEN needed.
- name: Publish to npm
run: npm publish --provenance --access public --tag ${{ steps.dist_tag.outputs.npm_tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
Expand Down
Loading