ci(workflow): 移除 Windows 构建中的 Node.js 安装步骤并添加 runner 条件
Some checks failed
Build Android APK / 编译 libcore.aar (push) Failing after 9s
Build Multi-Platform / 编译 libcore (iOS/tvOS) (push) Failing after 8s
Build Windows / 编译 libcore (Windows) (20.15.1) (push) Successful in 20m6s
Build Android APK / 编译 Android APK (release) (push) Has been skipped
Build Windows / build (push) Has been skipped
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Multi-Platform / 构建 iOS (push) Has been cancelled
Some checks failed
Build Android APK / 编译 libcore.aar (push) Failing after 9s
Build Multi-Platform / 编译 libcore (iOS/tvOS) (push) Failing after 8s
Build Windows / 编译 libcore (Windows) (20.15.1) (push) Successful in 20m6s
Build Android APK / 编译 Android APK (release) (push) Has been skipped
Build Windows / build (push) Has been skipped
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Multi-Platform / 构建 iOS (push) Has been cancelled
This commit is contained in:
parent
dbf6175ad9
commit
d1e45f0254
28
.github/workflows/build-windows.yml
vendored
28
.github/workflows/build-windows.yml
vendored
@ -74,35 +74,11 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
needs: build-libcore
|
needs: build-libcore
|
||||||
# 新增:设置 job 级 PATH,让所有 steps 都能访问 Node.js
|
if: ${{ runner.os == 'Windows' }}
|
||||||
env:
|
# 仅在真实 Windows runner 上执行此构建
|
||||||
PATH: ${{ github.workspace }}\node;${{ env.PATH }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 新增:引导步骤,下载并设置 Node.js(便携版,无需全局安装)
|
# 新增:引导步骤,下载并设置 Node.js(便携版,无需全局安装)
|
||||||
- name: 🔧 Setup Node.js
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$nodeVersion = "22.9.0" # 可调整为其他 LTS 版本,如 "20.17.0"
|
|
||||||
$zipUrl = "https://nodejs.org/dist/v${nodeVersion}/node-v${nodeVersion}-win-x64.zip"
|
|
||||||
$zipPath = Join-Path $env:GITHUB_WORKSPACE "node.zip"
|
|
||||||
$nodeDir = Join-Path $env:GITHUB_WORKSPACE "node"
|
|
||||||
|
|
||||||
# 创建目录
|
|
||||||
New-Item -ItemType Directory -Force -Path $nodeDir | Out-Null
|
|
||||||
|
|
||||||
# 下载 ZIP
|
|
||||||
Write-Host "Downloading Node.js from $zipUrl"
|
|
||||||
Invoke-WebRequest -Uri $zipUrl -OutFile $zipPath
|
|
||||||
|
|
||||||
# 解压
|
|
||||||
Expand-Archive -Path $zipPath -DestinationPath $nodeDir -Force
|
|
||||||
Remove-Item $zipPath
|
|
||||||
|
|
||||||
# 验证(此时 PATH 已包含 $nodeDir,所以能直接调用)
|
|
||||||
Write-Host "Node.js version: $(& "$nodeDir\node.exe" --version)"
|
|
||||||
Write-Host "npm version: $(& "$nodeDir\npm.cmd" --version)"
|
|
||||||
Write-Host "Node.js installed to: $nodeDir"
|
|
||||||
|
|
||||||
- name: 📥 Checkout 代码
|
- name: 📥 Checkout 代码
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user