Install Windows Node from ZIP to avoid runner 7z failure
This commit is contained in:
1 parent
a378f9904c
commit
78bd14318d
5 files changed
+18
-16
No files matched your search
@@ -34,6 +34,22 @@ if (-not $pwsh) {
|
||||
Add-RunnerPath (Split-Path $pwsh)
|
||||
Write-Host "PowerShell $(& $pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()') is ready."
|
||||
|
||||
$node = Get-Command node.exe -ErrorAction SilentlyContinue
|
||||
$nodeMajor = if ($node) { [int](& node -p 'process.versions.node.split(".")[0]') } else { 0 }
|
||||
if ($nodeMajor -lt 22) {
|
||||
$nodeVersion = '22.23.3'
|
||||
$nodeArchive = Join-Path $env:RUNNER_TEMP "node-v$nodeVersion-win-x64.zip"
|
||||
$nodeRoot = Join-Path $env:RUNNER_TEMP 'scopenet-node'
|
||||
$nodeBin = Join-Path $nodeRoot "node-v$nodeVersion-win-x64"
|
||||
if (-not (Test-Path (Join-Path $nodeBin 'node.exe'))) {
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://nodejs.org/dist/v$nodeVersion/node-v$nodeVersion-win-x64.zip" -OutFile $nodeArchive
|
||||
Expand-Archive -Path $nodeArchive -DestinationPath $nodeRoot -Force
|
||||
Remove-Item $nodeArchive
|
||||
}
|
||||
Add-RunnerPath $nodeBin
|
||||
}
|
||||
Write-Host "Node $(& node --version) is ready."
|
||||
|
||||
$cargoBin = Join-Path $env:USERPROFILE '.cargo\bin'
|
||||
Add-RunnerPath $cargoBin
|
||||
if (-not (Get-Command rustup.exe -ErrorAction SilentlyContinue)) {
|
||||
@@ -65,6 +81,5 @@ Write-Host "Microsoft C++ Build Tools are ready at $vsPath."
|
||||
foreach ($tool in @('cargo.exe', 'rustc.exe', 'node.exe', 'npm.cmd')) {
|
||||
if (-not (Get-Command $tool -ErrorAction SilentlyContinue)) { throw "Missing $tool after dependency setup." }
|
||||
}
|
||||
$nodeMajor = [int](& node -p 'process.versions.node.split(".")[0]')
|
||||
if ($nodeMajor -lt 22) { throw 'Node 22+ is required.' }
|
||||
if ([int](& node -p 'process.versions.node.split(".")[0]') -lt 22) { throw 'Node 22+ is required.' }
|
||||
Write-Host "Windows $Mode dependencies are ready."
|
||||
Reference in new issue
Block a user