From 8ab1c72e8fea8b84636041b81278835dae27d85b Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 09:41:43 +0200 Subject: [PATCH 01/14] ci: rename nodejs.yml to ci.yml --- .github/workflows/{nodejs.yml => ci.yml} | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{nodejs.yml => ci.yml} (100%) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/nodejs.yml rename to .github/workflows/ci.yml diff --git a/README.md b/README.md index eb69c0ca8f4..22c43d0a350 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # undici -[![Node CI](https://github.com/nodejs/undici/actions/workflows/nodejs.yml/badge.svg)](https://github.com/nodejs/undici/actions/workflows/nodejs.yml) [![neostandard javascript style](https://img.shields.io/badge/neo-standard-7fffff?style=flat\&labelColor=ff80ff)](https://github.com/neostandard/neostandard) [![npm version](https://badge.fury.io/js/undici.svg)](https://badge.fury.io/js/undici) [![codecov](https://codecov.io/gh/nodejs/undici/branch/main/graph/badge.svg?token=yZL6LtXkOA)](https://codecov.io/gh/nodejs/undici) +[![Node CI](https://github.com/nodejs/undici/actions/workflows/ci.yml/badge.svg)](https://github.com/nodejs/undici/actions/workflows/nodejs.yml) [![neostandard javascript style](https://img.shields.io/badge/neo-standard-7fffff?style=flat\&labelColor=ff80ff)](https://github.com/neostandard/neostandard) [![npm version](https://badge.fury.io/js/undici.svg)](https://badge.fury.io/js/undici) [![codecov](https://codecov.io/gh/nodejs/undici/branch/main/graph/badge.svg?token=yZL6LtXkOA)](https://codecov.io/gh/nodejs/undici) An HTTP/1.1 client, written from scratch for Node.js. From 83c2faedff2ce0feabd069ae2c5d0fca428afd5d Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 09:46:09 +0200 Subject: [PATCH 02/14] standardize strategy, node-version should be everywhere used --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/nodejs-shared.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a362a05bbe2..ef53117ab7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,12 +73,12 @@ jobs: secrets: inherit test-without-intl: - name: Test with Node.js ${{ matrix.version }} compiled --without-intl + name: Test with Node.js ${{ matrix.node-version }} compiled --without-intl strategy: fail-fast: false max-parallel: 0 matrix: - version: [20, 22, 24] + node-version: [20, 22, 24] runs-on: ubuntu-latest timeout-minutes: 120 steps: @@ -89,10 +89,10 @@ jobs: submodules: recursive # Setup node, install deps, and build undici prior to building icu-less node and testing - - name: Setup Node.js@${{ inputs.version }} + - name: Setup Node.js@${{ matrix.node-version }} uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: ${{ inputs.version }} + node-version: ${{ matrix.node-version }} - name: Install dependencies run: npm install @@ -109,7 +109,7 @@ jobs: const req = await fetch('https://nodejs.org/download/release/index.json') const releases = await req.json() - const latest = releases.find((r) => r.version.startsWith('v${{ matrix.version }}')) + const latest = releases.find((r) => r.version.startsWith('v${{ matrix.node-version }}')) return latest.version - name: Download and extract source @@ -121,7 +121,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 #v1.2.18 with: - key: node${{ matrix.version }} + key: node${{ matrix.node-version }} - name: Build node working-directory: ./node-${{ steps.release.outputs.result }} diff --git a/.github/workflows/nodejs-shared.yml b/.github/workflows/nodejs-shared.yml index 14044a2a655..fed630a5afc 100644 --- a/.github/workflows/nodejs-shared.yml +++ b/.github/workflows/nodejs-shared.yml @@ -14,12 +14,12 @@ permissions: jobs: test-shared-builtin: - name: Test with Node.js ${{ matrix.version }} compiled --shared-builtin-undici/undici-path + name: Test with Node.js ${{ matrix.node-version }} compiled --shared-builtin-undici/undici-path strategy: fail-fast: false max-parallel: 0 matrix: - version: [20, 22, 24] + node-version: [20, 22, 24] runs-on: ubuntu-latest timeout-minutes: 120 steps: @@ -31,10 +31,10 @@ jobs: persist-credentials: false # Setup node, install deps, and build undici prior to building node with `--shared-builtin-undici/undici-path` and testing - - name: Setup Node.js@${{ inputs.version }} + - name: Setup Node.js@${{ matrix.node-version }} uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: ${{ inputs.version }} + node-version: ${{ matrix.node-version }} - name: Install dependencies working-directory: ./undici @@ -62,7 +62,7 @@ jobs: const req = await fetch('https://nodejs.org/download/release/index.json') const releases = await req.json() - const latest = releases.find((r) => r.version.startsWith('v${{ matrix.version }}')) + const latest = releases.find((r) => r.version.startsWith('v${{ matrix.node-version }}')) return latest.version - name: Download and extract source @@ -74,7 +74,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 #v1.2.18 with: - key: node(external_undici)${{ matrix.version }} + key: node(external_undici)${{ matrix.node-version }} - name: Build node working-directory: ./node-${{ steps.release.outputs.result }} From bcc105ca00315e27e6475275c4b90074729e93bb Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 09:46:55 +0200 Subject: [PATCH 03/14] rename name of ci.yml from Node CI to CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef53117ab7c..b8b3d840bf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Node CI +name: CI on: push: From 3b7078a2f072a32d83e787a298c63e4a1c88c57e Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 09:48:47 +0200 Subject: [PATCH 04/14] rename test.yml to nodejs.yml, rename name in nodejs.yml --- .github/workflows/ci.yml | 2 +- .github/workflows/nightly.yml | 6 +++--- .github/workflows/{test.yml => nodejs.yml} | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename .github/workflows/{test.yml => nodejs.yml} (99%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8b3d840bf5..d82d6e1b0d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: exclude: - node-version: 20 runs-on: windows-latest - uses: ./.github/workflows/test.yml + uses: ./.github/workflows/nodejs.yml with: node-version: ${{ matrix.node-version }} runs-on: ${{ matrix.runs-on }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 7da843a9e6e..dfe69a0e874 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,7 +11,7 @@ permissions: jobs: test-linux: if: github.repository == 'nodejs/undici' - uses: ./.github/workflows/test.yml + uses: ./.github/workflows/nodejs.yml with: node-version: 23-nightly runs-on: ubuntu-latest @@ -26,7 +26,7 @@ jobs: test-windows: if: github.repository == 'nodejs/undici' - uses: ./.github/workflows/test.yml + uses: ./.github/workflows/nodejs.yml with: node-version: 23-nightly runs-on: windows-latest @@ -34,7 +34,7 @@ jobs: test-macos: if: github.repository == 'nodejs/undici' - uses: ./.github/workflows/test.yml + uses: ./.github/workflows/nodejs.yml with: node-version: 23-nightly runs-on: macos-latest diff --git a/.github/workflows/test.yml b/.github/workflows/nodejs.yml similarity index 99% rename from .github/workflows/test.yml rename to .github/workflows/nodejs.yml index d2cb4a8fb9e..c5a2b933820 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/nodejs.yml @@ -1,4 +1,4 @@ -name: Run tests +name: Node.js on: workflow_call: From 1df2c4f50c05cdb0d713a3096b99584121cc64ff Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 10:24:53 +0200 Subject: [PATCH 05/14] add output about built-in-dependencies --- .github/workflows/ci.yml | 1 + .github/workflows/nodejs-shared.yml | 1 + .github/workflows/nodejs.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d82d6e1b0d1..1e9709e72a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,6 +137,7 @@ jobs: run: | echo OS: $(node -p "os.version()") echo Node.js: $(node --version) + echo "Node.js built-in dependencies: $(node -p "'\r\n' + (Object.entries(process.versions).map(([k, v], i, arr) => (i !== arr.length - 1 ? '├──' : '└──') + k + '@' + v)).join('\r\n')")" echo npm: $(npm --version) echo git: $(git --version) echo icu config: $(node -e "console.log(process.config)" | grep icu) diff --git a/.github/workflows/nodejs-shared.yml b/.github/workflows/nodejs-shared.yml index fed630a5afc..6c5c2b5814d 100644 --- a/.github/workflows/nodejs-shared.yml +++ b/.github/workflows/nodejs-shared.yml @@ -91,6 +91,7 @@ jobs: run: | echo OS: $(node -p "os.version()") echo Node.js: $(node --version) + echo "Node.js built-in dependencies: $(node -p "'\r\n' + (Object.entries(process.versions).map(([k, v], i, arr) => (i !== arr.length - 1 ? '├──' : '└──') + k + '@' + v)).join('\r\n')")" echo npm: $(npm --version) echo git: $(git --version) echo external config: $(node -e "console.log(process.config)" | grep NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index c5a2b933820..087331b28f3 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -34,6 +34,7 @@ jobs: run: | echo OS: $(node -p "os.version()") echo Node.js: $(node --version) + echo "Node.js built-in dependencies: $(node -p "'\r\n' + (Object.entries(process.versions).map(([k, v], i, arr) => (i !== arr.length - 1 ? '├──' : '└──') + k + '@' + v)).join('\r\n')")" echo npm: $(npm --version) echo git: $(git --version) From 87e05b49d5bcd4ae34eb98abb2028786085f54a9 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 10:26:50 +0200 Subject: [PATCH 06/14] make running codecov configurable in the ci.yml --- .github/workflows/ci.yml | 1 + .github/workflows/nodejs.yml | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e9709e72a8..47b7c87dbc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,7 @@ jobs: runs-on: windows-latest uses: ./.github/workflows/nodejs.yml with: + codecov: ${{ matrix.node-version == 22 && matrix.runs-on == 'ubuntu-latest' }} node-version: ${{ matrix.node-version }} runs-on: ${{ matrix.runs-on }} secrets: inherit diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 087331b28f3..8ab3b63aed8 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -9,6 +9,10 @@ on: runs-on: required: true type: string + codecov: + required: false + type: boolean + default: false permissions: contents: read @@ -60,20 +64,20 @@ jobs: - name: Run tests with coverage id: coverage - if: inputs.runs-on == 'ubuntu-latest' && inputs.node-version == 22 + if: inputs.codecov == true run: npm run coverage:ci env: CI: true NODE_V8_COVERAGE: ./coverage/tmp - name: Run tests - if: steps.coverage.outcome == 'skipped' + if: inputs.codecov != true run: npm run test:javascript env: CI: true - name: Coverage Report - if: inputs.runs-on == 'ubuntu-latest' && inputs.node-version == 20 + if: inputs.codecov == true uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} From c1008365abefd0962424df5a9f368c48f0b6000f Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 10:44:44 +0200 Subject: [PATCH 07/14] use commit hashes instead of versions, standardize --- .github/workflows/backport.yml | 3 +- .github/workflows/release-create-pr.yml | 14 +++++++-- .github/workflows/release.yml | 38 +++++++++++++++++++------ 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 4621cf7e510..8f120070f25 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -24,6 +24,7 @@ jobs: name: Backport steps: - name: Backport - uses: tibdex/backport@v2 + uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e + id: backport with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-create-pr.yml b/.github/workflows/release-create-pr.yml index f61bda23076..af81b82f381 100644 --- a/.github/workflows/release-create-pr.yml +++ b/.github/workflows/release-create-pr.yml @@ -30,11 +30,18 @@ jobs: version: ${{ steps.bump.outputs.version }} steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 + - name: Checkout Repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + id: checkout + with: + persist-credentials: true + - name: Setup Node.js + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + id: setup-node with: node-version: '20' - name: Git Config + id: git-config run: | git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" @@ -49,7 +56,8 @@ jobs: git push origin "HEAD:$RELEASE_BRANCH" echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Create PR - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + id: create-pr with: script: | const defaultBranch = "${{ github.event.repository.default_branch }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc62816e90b..b6875e450dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,8 +16,13 @@ jobs: outputs: release-version: ${{ steps.set-release-version.outputs.result }} steps: - - uses: actions/checkout@v5 - - uses: actions/github-script@v7 + - name: Checkout Repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + id: checkout + with: + persist-credentials: true + - name: Set release version + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 id: set-release-version with: result-encoding: string @@ -49,20 +54,35 @@ jobs: environment: release steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 + - name: Checkout Repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + id: checkout + with: + persist-credentials: true + - name: Setup Node.js + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: '22' registry-url: 'https://registry.npmjs.org' - - run: npm install -g npm@latest - - run: npm install + - name: Install globally latest npm + run: npm install -g npm@latest + id: install-globally-latest-npm + - name: Install dependencies + run: npm install + id: install-dependencies - name: Create NPM release run: npm publish --access public - - run: node scripts/generate-undici-types-package-json.js - - run: npm publish + id: create-npm-release + - name: Generate Types Package + run: node scripts/generate-undici-types-package-json.js + id: generate-types-package + - name: Publish Types Package + run: npm publish + id: publish-types-package working-directory: './types' - name: Create GitHub release - uses: actions/github-script@v7 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + id: create-release with: script: | const defaultBranch = "${{ github.event.repository.default_branch }}" From edab583d8cd679e53f263bd0e693036231e0d9fe Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 10:54:35 +0200 Subject: [PATCH 08/14] standardize name to Checkout Repository, set persist-credentials accordingly --- .github/workflows/autobahn.yml | 2 +- .github/workflows/bench.yml | 12 ++++---- .github/workflows/ci.yml | 12 ++++---- .github/workflows/codeql.yml | 2 ++ .github/workflows/nodejs-shared.yml | 2 +- .github/workflows/nodejs.yml | 2 +- .github/workflows/release.yml | 35 ++++++++++++++---------- .github/workflows/update-cache-tests.yml | 2 ++ 8 files changed, 40 insertions(+), 29 deletions(-) diff --git a/.github/workflows/autobahn.yml b/.github/workflows/autobahn.yml index 449523705dc..6dd883d8c5d 100644 --- a/.github/workflows/autobahn.yml +++ b/.github/workflows/autobahn.yml @@ -30,7 +30,7 @@ jobs: - ${{ github.workspace }}/test/autobahn/config:/config - ${{ github.workspace }}/test/autobahn/reports:/reports steps: - - name: Checkout Code + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index efb6a54b132..0ae834ae0a7 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -11,7 +11,7 @@ jobs: name: benchmark current runs-on: ubuntu-latest steps: - - name: Checkout Code + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -33,7 +33,7 @@ jobs: name: benchmark branch runs-on: ubuntu-latest steps: - - name: Checkout Code + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -54,7 +54,7 @@ jobs: name: benchmark (sending data) current runs-on: ubuntu-latest steps: - - name: Checkout Code + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -76,7 +76,7 @@ jobs: name: benchmark (sending data) branch runs-on: ubuntu-latest steps: - - name: Checkout Code + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -97,7 +97,7 @@ jobs: name: benchmark current h2 runs-on: ubuntu-latest steps: - - name: Checkout Code + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -119,7 +119,7 @@ jobs: name: benchmark branch h2 runs-on: ubuntu-latest steps: - - name: Checkout Code + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47b7c87dbc3..99ec7a77bf0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: with: egress-policy: audit - - name: Checkout + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -34,7 +34,7 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -83,7 +83,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 120 steps: - - name: Checkout + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -163,7 +163,7 @@ jobs: name: Fuzzing runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -184,7 +184,7 @@ jobs: timeout-minutes: 15 runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -205,7 +205,7 @@ jobs: timeout-minutes: 15 runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e8e321fcfa6..691bf4bed90 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -47,6 +47,8 @@ jobs: - name: Checkout repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/nodejs-shared.yml b/.github/workflows/nodejs-shared.yml index 6c5c2b5814d..8a7cd3d3e82 100644 --- a/.github/workflows/nodejs-shared.yml +++ b/.github/workflows/nodejs-shared.yml @@ -24,7 +24,7 @@ jobs: timeout-minutes: 120 steps: # Checkout into a subdirectory otherwise Node.js tests will break due to finding Undici's package.json in a parent directory. - - name: Checkout + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: path: ./undici diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 8ab3b63aed8..b8eb890c5f0 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -23,7 +23,7 @@ jobs: timeout-minutes: 15 runs-on: ${{ inputs.runs-on }} steps: - - name: Checkout + - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b6875e450dc..b0e301fdb8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Create release +name: Release undici and undici-types on NPM and create GitHub Release on: push: @@ -11,19 +11,19 @@ permissions: contents: read jobs: - check-release-version: + determine-release-version: runs-on: ubuntu-latest outputs: - release-version: ${{ steps.set-release-version.outputs.result }} + release-version: ${{ steps.determine-release-version.outputs.result }} steps: - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 id: checkout with: - persist-credentials: true - - name: Set release version + persist-credentials: false + - name: Determine release version uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - id: set-release-version + id: determine-release-version with: result-encoding: string script: | @@ -44,8 +44,8 @@ jobs: release: runs-on: ubuntu-latest - needs: check-release-version - if: ${{ startsWith(needs.check-release-version.outputs.release-version, 'v') }} + needs: determine-release-version + if: ${{ startsWith(needs.determine-release-version.outputs.release-version, 'v') }} permissions: contents: write @@ -59,32 +59,39 @@ jobs: id: checkout with: persist-credentials: true + - name: Setup Node.js uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: node-version: '22' registry-url: 'https://registry.npmjs.org' + - name: Install globally latest npm run: npm install -g npm@latest id: install-globally-latest-npm + - name: Install dependencies run: npm install id: install-dependencies - - name: Create NPM release + + - name: Publish undici on NPM run: npm publish --access public - id: create-npm-release + id: npm-publish-undici + - name: Generate Types Package run: node scripts/generate-undici-types-package-json.js id: generate-types-package - - name: Publish Types Package + + - name: Publish undici-types on NPM run: npm publish - id: publish-types-package + id: npm-publish-undici-types working-directory: './types' + - name: Create GitHub release uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - id: create-release + id: create-gh-release with: script: | const defaultBranch = "${{ github.event.repository.default_branch }}" - const versionTag = "${{ needs.check-release-version.outputs.release-version }}" + const versionTag = "${{ needs.determine-release-version.outputs.release-version }}" await require('./scripts/release').release({ github, context, defaultBranch, versionTag }) diff --git a/.github/workflows/update-cache-tests.yml b/.github/workflows/update-cache-tests.yml index e0fb9eed6c0..a1696737919 100644 --- a/.github/workflows/update-cache-tests.yml +++ b/.github/workflows/update-cache-tests.yml @@ -21,6 +21,8 @@ jobs: - name: Checkout Repository uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: true - name: Update Cache Tests run: | From 10107f5a68fb3f4637eda813b73591460f615910 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 11:00:17 +0200 Subject: [PATCH 09/14] use node-version 25-nightly for the nightly tests --- .github/workflows/nightly.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index dfe69a0e874..6d5a92e01e0 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -13,7 +13,7 @@ jobs: if: github.repository == 'nodejs/undici' uses: ./.github/workflows/nodejs.yml with: - node-version: 23-nightly + node-version: 25-nightly runs-on: ubuntu-latest secrets: inherit @@ -21,14 +21,14 @@ jobs: if: github.repository == 'nodejs/undici' uses: ./.github/workflows/autobahn.yml with: - node-version: 23-nightly + node-version: 25-nightly secrets: inherit test-windows: if: github.repository == 'nodejs/undici' uses: ./.github/workflows/nodejs.yml with: - node-version: 23-nightly + node-version: 25-nightly runs-on: windows-latest secrets: inherit @@ -36,7 +36,7 @@ jobs: if: github.repository == 'nodejs/undici' uses: ./.github/workflows/nodejs.yml with: - node-version: 23-nightly + node-version: 25-nightly runs-on: macos-latest secrets: inherit From fd5e18d7c3952170d91c2555ca7955bf87aa7274 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 11:09:25 +0200 Subject: [PATCH 10/14] improve nightly tests --- .../{nightly.yml => nodejs-nightly.yml} | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) rename .github/workflows/{nightly.yml => nodejs-nightly.yml} (66%) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nodejs-nightly.yml similarity index 66% rename from .github/workflows/nightly.yml rename to .github/workflows/nodejs-nightly.yml index 6d5a92e01e0..73ebf1a2af2 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nodejs-nightly.yml @@ -1,4 +1,4 @@ -name: Nightly tests +name: Node.js Nightly on: workflow_dispatch: @@ -9,44 +9,32 @@ permissions: contents: read jobs: - test-linux: + test: if: github.repository == 'nodejs/undici' + strategy: + fail-fast: false + max-parallel: 1 + matrix: + node-version: [25-nightly] + runs-on: [ubuntu-latest, windows-latest, macos-latest] uses: ./.github/workflows/nodejs.yml with: - node-version: 25-nightly - runs-on: ubuntu-latest + node-version: ${{ matrix.node-version }} + runs-on: ${{ matrix.runs-on }} secrets: inherit - test-autobahn: + autobahn: if: github.repository == 'nodejs/undici' uses: ./.github/workflows/autobahn.yml with: node-version: 25-nightly secrets: inherit - test-windows: - if: github.repository == 'nodejs/undici' - uses: ./.github/workflows/nodejs.yml - with: - node-version: 25-nightly - runs-on: windows-latest - secrets: inherit - - test-macos: - if: github.repository == 'nodejs/undici' - uses: ./.github/workflows/nodejs.yml - with: - node-version: 25-nightly - runs-on: macos-latest - secrets: inherit - report-failure: - if: ${{ always() && (needs.test-linux.result == 'failure' && needs.test-windows.result == 'failure' && needs.test-macos.result == 'failure') }} + if: ${{ always() && (needs.test.result == 'failure' || needs.autobahn.result == 'failure') }} needs: - - test-linux - - test-windows - - test-macos - - test-autobahn + - test + - autobahn runs-on: ubuntu-latest permissions: issues: write From a627a65623eb313626e89c05b49764ce0829cec4 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 11:17:22 +0200 Subject: [PATCH 11/14] use strings for node-version, use node lts/* for meta workflows --- .github/workflows/autobahn.yml | 8 ++++---- .github/workflows/bench.yml | 12 ++++++------ .github/workflows/ci.yml | 15 ++++++--------- .github/workflows/nodejs-nightly.yml | 6 +++--- .github/workflows/nodejs-shared.yml | 2 +- .github/workflows/release-create-pr.yml | 5 ++++- .github/workflows/release.yml | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/autobahn.yml b/.github/workflows/autobahn.yml index 6dd883d8c5d..c76381765b8 100644 --- a/.github/workflows/autobahn.yml +++ b/.github/workflows/autobahn.yml @@ -5,7 +5,7 @@ on: workflow_call: inputs: node-version: - default: '22' + default: '24' type: string pull_request: paths: @@ -19,7 +19,7 @@ jobs: autobahn: name: Autobahn Test Suite runs-on: ubuntu-latest - container: node:22 + container: node:24 services: fuzzingserver: image: crossbario/autobahn-testsuite:latest @@ -42,10 +42,10 @@ jobs: with: args: docker restart --time 0 --signal=SIGKILL fuzzingserver - - name: Setup Node.js@${{ inputs.node-version || '22' }} + - name: Setup Node.js@${{ inputs.node-version }} uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: ${{ inputs.node-version || '22' }} + node-version: ${{ inputs.node-version }} - name: Run Autobahn Test Suite run: npm run test:websocket:autobahn diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 0ae834ae0a7..4309139a663 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Node uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: lts/* + node-version: 'lts/*' - name: Install Modules for undici run: npm i --ignore-scripts --omit=dev - name: Install Modules for Benchmarks @@ -40,7 +40,7 @@ jobs: - name: Setup Node uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: lts/* + node-version: 'lts/*' - name: Install Modules for undici run: npm i --ignore-scripts --omit=dev - name: Install Modules for Benchmarks @@ -62,7 +62,7 @@ jobs: - name: Setup Node uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: lts/* + node-version: 'lts/*' - name: Install Modules for undici run: npm i --ignore-scripts --omit=dev - name: Install Modules for Benchmarks @@ -83,7 +83,7 @@ jobs: - name: Setup Node uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: lts/* + node-version: 'lts/*' - name: Install Modules for undici run: npm i --ignore-scripts --omit=dev - name: Install Modules for Benchmarks @@ -105,7 +105,7 @@ jobs: - name: Setup Node uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: lts/* + node-version: 'lts/*' - name: Install Modules for undici run: npm i --ignore-scripts --omit=dev - name: Install Modules for Benchmarks @@ -126,7 +126,7 @@ jobs: - name: Setup Node uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: lts/* + node-version: 'lts/*' - name: Install Modules for undici run: npm i --ignore-scripts --omit=dev - name: Install Modules for Benchmarks diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99ec7a77bf0..af56025a845 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: lts/* + node-version: 'lts/*' - name: Install dependencies run: npm install @@ -55,20 +55,17 @@ jobs: fail-fast: false max-parallel: 0 matrix: - node-version: - - 20 - - 22 - - 24 + node-version: ['20', '22', '24'] runs-on: - ubuntu-latest - windows-latest - macos-latest exclude: - - node-version: 20 + - node-version: '20' runs-on: windows-latest uses: ./.github/workflows/nodejs.yml with: - codecov: ${{ matrix.node-version == 22 && matrix.runs-on == 'ubuntu-latest' }} + codecov: ${{ matrix.node-version == '24' && matrix.runs-on == 'ubuntu-latest' }} node-version: ${{ matrix.node-version }} runs-on: ${{ matrix.runs-on }} secrets: inherit @@ -79,7 +76,7 @@ jobs: fail-fast: false max-parallel: 0 matrix: - node-version: [20, 22, 24] + node-version: ['20', '22', '24'] runs-on: ubuntu-latest timeout-minutes: 120 steps: @@ -213,7 +210,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: 22 + node-version: '24' - name: Install dependencies run: npm install diff --git a/.github/workflows/nodejs-nightly.yml b/.github/workflows/nodejs-nightly.yml index 73ebf1a2af2..28f882ca31d 100644 --- a/.github/workflows/nodejs-nightly.yml +++ b/.github/workflows/nodejs-nightly.yml @@ -13,9 +13,9 @@ jobs: if: github.repository == 'nodejs/undici' strategy: fail-fast: false - max-parallel: 1 + max-parallel: 0 matrix: - node-version: [25-nightly] + node-version: ['25-nightly'] runs-on: [ubuntu-latest, windows-latest, macos-latest] uses: ./.github/workflows/nodejs.yml with: @@ -27,7 +27,7 @@ jobs: if: github.repository == 'nodejs/undici' uses: ./.github/workflows/autobahn.yml with: - node-version: 25-nightly + node-version: '25-nightly' secrets: inherit report-failure: diff --git a/.github/workflows/nodejs-shared.yml b/.github/workflows/nodejs-shared.yml index 8a7cd3d3e82..a58c3ccda25 100644 --- a/.github/workflows/nodejs-shared.yml +++ b/.github/workflows/nodejs-shared.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false max-parallel: 0 matrix: - node-version: [20, 22, 24] + node-version: ['20', '22', '24'] runs-on: ubuntu-latest timeout-minutes: 120 steps: diff --git a/.github/workflows/release-create-pr.yml b/.github/workflows/release-create-pr.yml index af81b82f381..0a4a697a251 100644 --- a/.github/workflows/release-create-pr.yml +++ b/.github/workflows/release-create-pr.yml @@ -35,16 +35,18 @@ jobs: id: checkout with: persist-credentials: true + - name: Setup Node.js uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 id: setup-node with: - node-version: '20' + node-version: 'lts/*' - name: Git Config id: git-config run: | git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" + - name: Change version number and push id: bump run: | @@ -55,6 +57,7 @@ jobs: git commit -m "Bumped v$VERSION" git push origin "HEAD:$RELEASE_BRANCH" echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Create PR uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 id: create-pr diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0e301fdb8d..29f8db5b487 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: '22' + node-version: 'lts/*' registry-url: 'https://registry.npmjs.org' - name: Install globally latest npm From 2a5ae1206d8ace4c43730692fb37abe6dbc293ab Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 11:24:41 +0200 Subject: [PATCH 12/14] one liner in strategies --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af56025a845..b3c2f41c7f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,10 +56,7 @@ jobs: max-parallel: 0 matrix: node-version: ['20', '22', '24'] - runs-on: - - ubuntu-latest - - windows-latest - - macos-latest + runs-on: ['ubuntu-latest', 'windows-latest', 'macos-latest'] exclude: - node-version: '20' runs-on: windows-latest From 423c0f6eae4bf68c35bb996ee1add4a447efd231 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Wed, 3 Sep 2025 13:24:07 +0200 Subject: [PATCH 13/14] add name for nightly test job --- .github/workflows/nodejs-nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nodejs-nightly.yml b/.github/workflows/nodejs-nightly.yml index 28f882ca31d..cda46a88d87 100644 --- a/.github/workflows/nodejs-nightly.yml +++ b/.github/workflows/nodejs-nightly.yml @@ -10,6 +10,7 @@ permissions: jobs: test: + name: Test with Node.js ${{ matrix.node-version }} on ${{ matrix.runs-on }} if: github.repository == 'nodejs/undici' strategy: fail-fast: false From 3ddcb02e110ab3e4b96bb2aa1f5f82a8c3262e83 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Thu, 4 Sep 2025 10:19:40 +0200 Subject: [PATCH 14/14] Update .github/workflows/backport.yml --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 8f120070f25..22586651256 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -24,7 +24,7 @@ jobs: name: Backport steps: - name: Backport - uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e + uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4 id: backport with: github_token: ${{ secrets.GITHUB_TOKEN }}