diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index a1e8186..4f21c5f 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -9,7 +9,7 @@ on: type: string node-version: description: "Node.js version to use" - default: "20" + default: "24" type: string registry: description: "NPM registry URL" @@ -121,11 +121,11 @@ jobs: run: | if [ -n "${{ secrets.npm-token }}" ]; then echo "npm-token secret is set not using OIDC" - elif [ -n "$(npx semver -r ">=11.5.1" "$(npm -v)")" ]; then + elif [ -n "$(npx semver@7.8.5 -r ">=11.5.1" "$(npm -v)")" ]; then echo "OIDC trusted publishing supported by current npm version" else - echo "OIDC trusted publishing requires npm >= 11.5.1, updating npm" - npm install -g npm@11 + echo "::error::OIDC trusted publishing requires npm >= 11.5.1, shipped with Node.js >= 24.5.0 (current: npm $(npm -v), Node.js $(node -v)). Use a compatible \`node-version\` input, or provide the \`npm-token\` secret." + exit 1 fi - name: Install dependencies diff --git a/publish-npm/README.md b/publish-npm/README.md index 07c5c52..4c0f7d4 100644 --- a/publish-npm/README.md +++ b/publish-npm/README.md @@ -21,7 +21,7 @@ This reusable GitHub Actions workflow automates the process of publishing an NPM | **Input** | **Description** | **Required** | **Default** | | --- | --- | --- | --- | | **scope** | NPM package scope (e.g., `@iexec`). | No | `@iexec` | -| **node-version** | Node.js version to use. | No | `20` | +| **node-version** | Node.js version to use. | No | `24` | | **registry** | NPM registry URL. | No | `https://registry.npmjs.org` | | **access** | Package access (public or restricted). | No | `public` | | **provenance** | Enable npm provenance. | No | `true` | @@ -61,7 +61,7 @@ This reusable GitHub Actions workflow automates the process of publishing an NPM ### With Trusted Publishers (preferred) -> ⚠️ this method uses npm >= 11.5.1 ensure your project supports a compatible version of npm if not please use the method with npm token. +> ⚠️ this method requires npm >= 11.5.1, shipped with Node.js >= 24.5.0. Use a compatible `node-version`, or provide the `npm-token` secret. 1. **Call the Reusable Workflow** @@ -82,7 +82,7 @@ This reusable GitHub Actions workflow automates the process of publishing an NPM publish: uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@main with: - node-version: "22" + node-version: "24" build-command: "npm run build:prod" run-tests: true test-command: "npm run test:ci" @@ -116,7 +116,7 @@ This reusable GitHub Actions workflow automates the process of publishing an NPM publish: uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@main with: - node-version: "22" + node-version: "24" build-command: "npm run build:prod" run-tests: true test-command: "npm run test:ci" diff --git a/publish-npm/workflow-sha256 b/publish-npm/workflow-sha256 index c9941ca..446583c 100644 --- a/publish-npm/workflow-sha256 +++ b/publish-npm/workflow-sha256 @@ -1 +1 @@ -a936ca8dedd03c393e20d2716282cf3bc72bdc3bcfceae0d083686f938e6e513 +243c60661de8b313ccfca192af41b147c3ba94b36318ac3a5dcd901c6e9fa919