ci(workflow): 在Windows构建流程中添加Git到PATH
Some checks failed
Build Android APK / 编译 libcore.aar (push) Failing after 9s
Build Android APK / 编译 Android APK (release) (push) Has been skipped
Build Multi-Platform / 编译 libcore (iOS/tvOS) (push) Failing after 7s
Build Windows / 编译 libcore (Windows) (20.15.1) (push) Successful in 19m56s
Build Windows / build (push) Failing after 7h0m4s
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 / 编译 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 / 创建 Release (push) Has been cancelled
Build Multi-Platform / 构建 iOS (push) Has been cancelled

添加PowerShell步骤以将Git的可执行路径添加到系统PATH环境变量中,确保在Windows环境下可以正常使用git命令
This commit is contained in:
shanshanzhong 2025-11-06 02:55:16 -08:00
parent 89e02cc707
commit f738ba9245

View File

@ -77,6 +77,24 @@ jobs:
steps:
# 新增:引导步骤,下载并设置 Node.js便携版无需全局安装
- name: 🔧 Add Git to PATH (Windows)
if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
$paths = @(
'C:\Program Files\Git\cmd',
'C:\Program Files\Git\bin'
)
foreach ($p in $paths) {
if (Test-Path $p) {
Add-Content -Path $env:GITHUB_PATH -Value $p
Write-Host "✅ Added to PATH: $p"
} else {
Write-Host "⚠️ Path not found: $p"
}
}
git --version
- name: 📥 Checkout 代码
uses: actions/checkout@v4
with: