fix(ci): switch npm publish to OIDC trusted publishing
NODE_AUTH_TOKEN expired (set 90 days ago, the npm token default expiry) causing all publish runs to fail with 'PUT 404 Not Found' since 2026-04-30. Migrate publish.yml and publish-platform.yml to npm Trusted Publishing (OIDC) so we no longer depend on long-lived secrets: - Bump actions/setup-node v4 -> v6 (improves OIDC compatibility) - Add 'npm install -g npm@latest' to guarantee npm CLI >= 11.5.1 (the minimum required for trusted publishing). - Drop NODE_AUTH_TOKEN env from every publish step. The npm CLI picks up the GitHub Actions OIDC token automatically. - Keep --provenance / NPM_CONFIG_PROVENANCE=true (real-world reports indicate provenance is not auto-emitted yet). Per-package trusted publisher must still be configured on npmjs.com (Settings -> Trusted Publisher) for all 24 packages (oh-my-opencode + oh-my-openagent main + 11 platform packages each, dual-published) before the next publish run.
This commit is contained in:
@@ -342,17 +342,20 @@ jobs:
|
||||
ls -la packages/${PLATFORM}/
|
||||
ls -la packages/${PLATFORM}/bin/
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
if: steps.check.outputs.skip_all != 'true' && steps.download.outcome == 'success'
|
||||
with:
|
||||
node-version: "24"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Upgrade npm for trusted publishing (>=11.5.1)
|
||||
if: steps.check.outputs.skip_all != 'true' && steps.download.outcome == 'success'
|
||||
run: npm install -g npm@latest
|
||||
|
||||
- name: Publish oh-my-opencode-${{ matrix.platform }}
|
||||
if: steps.check.outputs.skip_opencode != 'true' && steps.download.outcome == 'success'
|
||||
env:
|
||||
DIST_TAG: ${{ steps.validate.outputs.dist_tag }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
|
||||
NPM_CONFIG_PROVENANCE: true
|
||||
run: |
|
||||
cd packages/${{ matrix.platform }}
|
||||
@@ -368,7 +371,6 @@ jobs:
|
||||
if: steps.check.outputs.skip_openagent != 'true' && steps.download.outcome == 'success'
|
||||
env:
|
||||
DIST_TAG: ${{ steps.validate.outputs.dist_tag }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
|
||||
NPM_CONFIG_PROVENANCE: true
|
||||
run: |
|
||||
cd packages/${{ matrix.platform }}
|
||||
|
||||
@@ -83,11 +83,14 @@ jobs:
|
||||
with:
|
||||
bun-version: "1.3.11"
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "24"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Upgrade npm for trusted publishing (>=11.5.1)
|
||||
run: npm install -g npm@latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
env:
|
||||
@@ -170,7 +173,6 @@ jobs:
|
||||
if: steps.check.outputs.skip != 'true'
|
||||
env:
|
||||
DIST_TAG: ${{ steps.version.outputs.dist_tag }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
|
||||
NPM_CONFIG_PROVENANCE: true
|
||||
run: |
|
||||
if [ -n "$DIST_TAG" ]; then
|
||||
@@ -197,7 +199,6 @@ jobs:
|
||||
env:
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
DIST_TAG: ${{ steps.version.outputs.dist_tag }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
|
||||
NPM_CONFIG_PROVENANCE: true
|
||||
run: |
|
||||
# Update package name, version, and optionalDependencies for oh-my-openagent
|
||||
|
||||
Reference in New Issue
Block a user