From a828d14f1ace6846db8d4ff82141ad0dcf204c54 Mon Sep 17 00:00:00 2001 From: Hamza Aamer Date: Thu, 5 Nov 2026 15:41:38 +0100 Subject: [PATCH] Publish job: install with npm 10, publish with npm 11 npm 11's npm ci rejects package-lock.json (optional rollup platform packages missing), which failed the 4.1.0 publish on main. Install with Node 20's npm like the build job, then switch to npm >= 11.5.1 only for the trusted publish. --- .github/workflows/npm-publish.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 98f5f5d..5f0b844 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -48,14 +48,16 @@ jobs: - uses: actions/setup-node@v4 if: steps.check.outputs.changed == 'true' with: - node-version: 24 - # trusted publishing needs npm >= 11.5.1 - - run: npm install -g npm@^11.5.1 && npm --version - if: steps.check.outputs.changed == 'true' + node-version: 20 + # install with the npm that wrote package-lock.json (npm 11's `npm ci` + # rejects this lockfile's missing optional platform packages) - run: npm ci if: steps.check.outputs.changed == 'true' env: ONNXRUNTIME_NODE_INSTALL_CUDA: skip + # trusted publishing needs npm >= 11.5.1 + - run: npm install -g npm@^11.5.1 && npm --version + if: steps.check.outputs.changed == 'true' - run: npm publish if: steps.check.outputs.changed == 'true' - name: Version unchanged