From 61b87233566ec7e731cdecb414c166fccb63bc6f Mon Sep 17 00:00:00 2001 From: Volodymyr Rudenko Date: Thu, 11 Jun 2026 15:13:02 +0200 Subject: [PATCH] ci: migrate npm publish to trusted publishing (OIDC) The v0.2.2 publish failed with E404: the NPM_TOKEN secret had expired (npm granular tokens default to 30-day expiry). Replace token auth with npm trusted publishing, configured for this repo/workflow on npmjs.com: - Upgrade npm in the workflow: OIDC auth requires npm >= 11.5.1, while Node 22 bundles npm 10.x. - Drop NODE_AUTH_TOKEN and the --provenance flag; with trusted publishing, auth comes from the GitHub OIDC token and provenance is generated automatically. - Drop publishConfig.provenance for the same reason. - Disable dependency caching in the release build per npm's guidance (cache: npm removed, package-manager-cache: false). Co-Authored-By: Claude Fable 5 --- .github/workflows/publish.yml | 12 +++++++----- package.json | 3 +-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5a368aa..31300fb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,8 +17,11 @@ jobs: - uses: actions/setup-node@v6 with: node-version: 22 - cache: npm registry-url: https://registry.npmjs.org + package-manager-cache: false + + # Trusted publishing (OIDC) requires npm >= 11.5.1; Node 22 bundles npm 10.x. + - run: npm install -g npm@latest - run: npm ci - run: npm run lint @@ -49,10 +52,9 @@ jobs: exit 1 fi - - name: Publish to npm with provenance - run: npm publish --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # Auth via npm trusted publishing (OIDC); provenance is generated automatically. + - name: Publish to npm + run: npm publish - name: Create GitHub Release with MCPB asset uses: softprops/action-gh-release@v3 diff --git a/package.json b/package.json index 2abc517..0217f5e 100644 --- a/package.json +++ b/package.json @@ -50,8 +50,7 @@ "url": "https://github.com/joinmassive/mcp-server/issues" }, "publishConfig": { - "access": "public", - "provenance": true + "access": "public" }, "dependencies": { "@modelcontextprotocol/sdk": "^1.29.0",