This commit is contained in:
Salman Chishti 2025-08-19 13:49:21 +00:00 committed by GitHub
commit fa4b9d2ea1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 48 additions and 35 deletions

View File

@ -16,4 +16,4 @@ jobs:
name: Basic validation name: Basic validation
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
with: with:
node-version: '20.x' node-version: '24.x'

View File

@ -19,7 +19,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22] node-version: [18, 20, 22, 24]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Clean global cache - name: Clean global cache
@ -42,7 +42,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22] node-version: [18, 20, 22, 24]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install pnpm - name: Install pnpm
@ -75,13 +75,13 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20] node-version: [18, 20, 24]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Yarn version - name: Yarn version
run: yarn --version run: yarn --version
- name: Generate yarn file - name: Generate yarn file
run: yarn install run: yarn install --ignore-engines
- name: Remove dependencies - name: Remove dependencies
shell: pwsh shell: pwsh
run: Remove-Item node_modules -Force -Recurse run: Remove-Item node_modules -Force -Recurse
@ -107,7 +107,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22] node-version: [18, 20, 22, 24]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Update yarn - name: Update yarn
@ -139,7 +139,7 @@ jobs:
name: Test yarn subprojects name: Test yarn subprojects
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22] node-version: [18, 20, 22, 24]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -166,7 +166,7 @@ jobs:
name: Test yarn subprojects all locally managed name: Test yarn subprojects all locally managed
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22] node-version: [18, 20, 22, 24]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -193,7 +193,7 @@ jobs:
name: Test yarn subprojects some locally managed name: Test yarn subprojects some locally managed
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22] node-version: [18, 20, 22, 24]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -220,7 +220,7 @@ jobs:
name: Test yarn subprojects managed by git name: Test yarn subprojects managed by git
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22] node-version: [18, 20, 22, 24]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -18,7 +18,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22] node-version: [18, 20, 22, 24]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Node - name: Setup Node
@ -139,7 +139,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
node-version: [18, 20, 22] node-version: [18, 20, 22, 24]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup Node and check latest - name: Setup Node and check latest
@ -166,7 +166,7 @@ jobs:
with: with:
node-version-file: '__tests__/data/${{ matrix.node-version-file }}' node-version-file: '__tests__/data/${{ matrix.node-version-file }}'
- name: Verify node - name: Verify node
run: __tests__/verify-node.sh 20 run: __tests__/verify-node.sh 24
version-file-volta: version-file-volta:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -181,7 +181,7 @@ jobs:
with: with:
node-version-file: '__tests__/data/package-volta.json' node-version-file: '__tests__/data/package-volta.json'
- name: Verify node - name: Verify node
run: __tests__/verify-node.sh 20 run: __tests__/verify-node.sh 24
version-file-volta-extends: version-file-volta-extends:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -196,7 +196,7 @@ jobs:
with: with:
node-version-file: '__tests__/data/package-volta-extends.json' node-version-file: '__tests__/data/package-volta-extends.json'
- name: Verify node - name: Verify node
run: __tests__/verify-node.sh 20 run: __tests__/verify-node.sh 24
node-dist: node-dist:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
v20 v24

View File

@ -1 +1 @@
nodejs 20.0.0 nodejs 24.0.0

View File

@ -1 +1 @@
node 20.0.0 node 24.0.0

View File

@ -3,6 +3,6 @@
"node": "^14.0.0" "node": "^14.0.0"
}, },
"volta": { "volta": {
"node": "20.0.0" "node": "24.0.0"
} }
} }

View File

@ -1,5 +1,5 @@
{ {
"engines": { "engines": {
"node": "^20.0.0" "node": "^24.0.0"
} }
} }

View File

@ -7,8 +7,13 @@ fi
node_version="$(node --version)" node_version="$(node --version)"
echo "Found node version '$node_version'" echo "Found node version '$node_version'"
if [ -z "$(echo $node_version | grep --fixed-strings v$1)" ]; then
echo "Unexpected version" # Extract the major version from the node version (remove the 'v' prefix)
actual_major_version=$(echo $node_version | sed -E 's/^v([0-9]+)\..*/\1/')
expected_major_version=$(echo $1 | sed -E 's/^([0-9]+)\..*/\1/') # Extract major version from argument
if [ "$actual_major_version" != "$expected_major_version" ]; then
echo "Expected Node.js $expected_major_version.x.x but found $node_version"
exit 1 exit 1
fi fi

View File

@ -37,7 +37,7 @@ outputs:
node-version: node-version:
description: 'The installed node version.' description: 'The installed node version.'
runs: runs:
using: 'node20' using: 'node24'
main: 'dist/setup/index.js' main: 'dist/setup/index.js'
post: 'dist/cache-save/index.js' post: 'dist/cache-save/index.js'
post-if: success() post-if: success()

25
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "setup-node", "name": "setup-node",
"version": "4.0.0", "version": "5.0.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "setup-node", "name": "setup-node",
"version": "4.0.0", "version": "5.0.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "^4.0.3", "@actions/cache": "^4.0.3",
@ -22,7 +22,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.14", "@types/jest": "^29.5.14",
"@types/node": "^20.11.25", "@types/node": "^24.1.0",
"@types/semver": "^7.5.8", "@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0", "@typescript-eslint/parser": "^5.54.0",
@ -37,6 +37,9 @@
"prettier": "^2.8.4", "prettier": "^2.8.4",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"typescript": "^5.4.2" "typescript": "^5.4.2"
},
"engines": {
"node": ">=24.0.0"
} }
}, },
"node_modules/@aashutoshrathi/word-wrap": { "node_modules/@aashutoshrathi/word-wrap": {
@ -1780,11 +1783,12 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.11.25", "version": "24.1.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz",
"integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==",
"license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~5.26.4" "undici-types": "~7.8.0"
} }
}, },
"node_modules/@types/node-fetch": { "node_modules/@types/node-fetch": {
@ -5552,9 +5556,10 @@
} }
}, },
"node_modules/undici-types": { "node_modules/undici-types": {
"version": "5.26.5", "version": "7.8.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
"license": "MIT"
}, },
"node_modules/universal-user-agent": { "node_modules/universal-user-agent": {
"version": "6.0.1", "version": "6.0.1",

View File

@ -1,9 +1,12 @@
{ {
"name": "setup-node", "name": "setup-node",
"version": "4.0.0", "version": "5.0.0",
"private": true, "private": true,
"description": "setup node action", "description": "setup node action",
"main": "lib/setup-node.js", "main": "lib/setup-node.js",
"engines": {
"node": ">=24.0.0"
},
"scripts": { "scripts": {
"build": "ncc build -o dist/setup src/setup-node.ts && ncc build -o dist/cache-save src/cache-save.ts", "build": "ncc build -o dist/setup src/setup-node.ts && ncc build -o dist/cache-save src/cache-save.ts",
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"", "format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
@ -38,7 +41,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.14", "@types/jest": "^29.5.14",
"@types/node": "^20.11.25", "@types/node": "^24.1.0",
"@types/semver": "^7.5.8", "@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0", "@typescript-eslint/parser": "^5.54.0",