ci(release): avoid powershell policy by using cmd node bootstrap
All checks were successful
Desktop CI / tests (push) Successful in 13s
All checks were successful
Desktop CI / tests (push) Successful in 13s
This commit is contained in:
@@ -11,24 +11,29 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Ensure Node.js for Gitea actions
|
- name: Ensure Node.js for Gitea actions
|
||||||
shell: powershell
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
if (Get-Command node -ErrorAction SilentlyContinue) {
|
where node
|
||||||
|
if %ERRORLEVEL% EQU 0 (
|
||||||
node --version
|
node --version
|
||||||
exit 0
|
exit /b 0
|
||||||
}
|
)
|
||||||
$nodeVersion = "v20.19.0"
|
set "NODE_VERSION=v20.19.0"
|
||||||
$zipUrl = "https://nodejs.org/dist/$nodeVersion/node-$nodeVersion-win-x64.zip"
|
set "ZIP_URL=https://nodejs.org/dist/%NODE_VERSION%/node-%NODE_VERSION%-win-x64.zip"
|
||||||
$zipPath = "$env:RUNNER_TEMP\node.zip"
|
set "ZIP_PATH=%RUNNER_TEMP%\node.zip"
|
||||||
$extractRoot = "$env:RUNNER_TEMP\node"
|
set "EXTRACT_ROOT=%RUNNER_TEMP%\node"
|
||||||
Invoke-WebRequest -Uri $zipUrl -OutFile $zipPath
|
mkdir "%EXTRACT_ROOT%"
|
||||||
Expand-Archive -Path $zipPath -DestinationPath $extractRoot -Force
|
curl.exe -fsSL "%ZIP_URL%" -o "%ZIP_PATH%"
|
||||||
$nodeDir = Get-ChildItem -Path $extractRoot -Directory | Select-Object -First 1
|
tar -xf "%ZIP_PATH%" -C "%EXTRACT_ROOT%"
|
||||||
if (-not $nodeDir) {
|
for /d %%D in ("%EXTRACT_ROOT%\*") do (
|
||||||
throw "Node.js archive extracted incorrectly."
|
set "NODE_DIR=%%~fD"
|
||||||
}
|
goto :node_found
|
||||||
$nodeDir.FullName | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
)
|
||||||
$env:PATH = "$($nodeDir.FullName);$env:PATH"
|
echo Node.js archive extracted incorrectly.
|
||||||
|
exit /b 1
|
||||||
|
:node_found
|
||||||
|
echo %NODE_DIR%>>"%GITHUB_PATH%"
|
||||||
|
set "PATH=%NODE_DIR%;%PATH%"
|
||||||
node --version
|
node --version
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
Reference in New Issue
Block a user