Skip to content
Open
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
25 changes: 11 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: release

permissions:
id-token: write # Required for NPM trusted publishing
contents: write

on:
push:
branches: [master]
Expand All @@ -22,8 +26,9 @@ jobs:
- name: Check if version is published
id: check
run: |
packageName="$( node -e "console.log(require('./package.json').name)" )"
currentVersion="$( node -e "console.log(require('./package.json').version)" )"
isPublished="$( npm view @mapbox/node-pre-gyp versions --json | jq -c --arg cv "$currentVersion" 'any(. == $cv)' )"
isPublished="$( npm view $packageName versions --json | jq -c --arg cv "$currentVersion" 'any(. == $cv)' )"
echo "version=$currentVersion" >> "$GITHUB_OUTPUT"
echo "published=$isPublished" >> "$GITHUB_OUTPUT"
echo "currentVersion: $currentVersion"
Expand All @@ -36,8 +41,6 @@ jobs:
needs: release-check
if: ${{ needs.release-check.outputs.published == 'false' }}
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
shell: bash
Expand All @@ -47,7 +50,8 @@ jobs:

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

- run: npm ci

Expand Down Expand Up @@ -90,16 +94,9 @@ jobs:

- name: Publish to NPM (release)
if: ${{ steps.prepare_release.outputs.prerelease == 'false' }}
run: |
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public

- name: Publish to NPM (prerelease)
if: ${{ steps.prepare_release.outputs.prerelease == 'true' }}
run: |
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"
npm publish --tag next --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --tag next --access public

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "Dane Springmeyer <dane@mapbox.com>",
"repository": {
"type": "git",
"url": "git://github.com/mapbox/node-pre-gyp.git"
"url": "https://github.com/mapbox/node-pre-gyp"
},
"bin": "./bin/node-pre-gyp",
"main": "./lib/node-pre-gyp.js",
Expand Down