From 0590ebc27c08f76ae7f58576e253e86fe66c92f4 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 12:19:08 +0000 Subject: [PATCH] Migrate node-release workflow to NPM Trusted Publishing (#4005) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: acalcutt <3792408+acalcutt@users.noreply.github.com> --- .github/workflows/node-release.yml | 12 ++++++------ platform/node/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/node-release.yml b/.github/workflows/node-release.yml index 1bd73ec09..35b037946 100644 --- a/.github/workflows/node-release.yml +++ b/.github/workflows/node-release.yml @@ -1,5 +1,9 @@ name: node-release +permissions: + id-token: write # Required for trusted publishing + contents: write + on: push: branches: [main] @@ -245,6 +249,7 @@ jobs: runs-on: ubuntu-latest needs: publish_binaries permissions: + id-token: write # Required for trusted publishing contents: write defaults: run: @@ -259,6 +264,7 @@ jobs: uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4 with: node-version-file: 'platform/node/.nvmrc' + registry-url: 'https://registry.npmjs.org' - name: Get version id: package-version @@ -304,16 +310,10 @@ jobs: if: ${{ steps.prepare_release.outputs.prerelease == 'false' }} working-directory: platform/node run: | - npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}" npm publish --access public - env: - NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }} - name: Publish to NPM (prerelease) if: ${{ steps.prepare_release.outputs.prerelease == 'true' }} working-directory: platform/node run: | - npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}" npm publish --tag next --access public - env: - NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }} diff --git a/platform/node/package.json b/platform/node/package.json index 800d07984..05bc50c08 100644 --- a/platform/node/package.json +++ b/platform/node/package.json @@ -17,7 +17,7 @@ "types": "index.d.ts", "repository": { "type": "git", - "url": "git+https://github.com/maplibre/maplibre-native.git" + "url": "https://github.com/maplibre/maplibre-native" }, "license": "BSD-2-Clause", "dependencies": {