From ce5918e4c0b05d7ac5f022521e9b954acf05d7de Mon Sep 17 00:00:00 2001 From: luochen570 <1160510664@qq.com> Date: Sat, 30 May 2026 21:01:21 +0800 Subject: [PATCH] ci: make Windows workflow PowerShell 5 compatible --- .gitea/workflows/build-windows-release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build-windows-release.yml b/.gitea/workflows/build-windows-release.yml index 25bd998..987e398 100644 --- a/.gitea/workflows/build-windows-release.yml +++ b/.gitea/workflows/build-windows-release.yml @@ -61,9 +61,12 @@ jobs: } $bash = "$msysRoot\usr\bin\bash.exe" - & $bash -lc "pacman --noconfirm -Syuu" || $true & $bash -lc "pacman --noconfirm -Syuu" + if ($LASTEXITCODE -ne 0) { Write-Host '第一次 pacman 系统更新返回非零,继续执行第二次更新。' } + & $bash -lc "pacman --noconfirm -Syuu" + if ($LASTEXITCODE -ne 0) { throw "pacman 系统更新失败,退出码:$LASTEXITCODE" } & $bash -lc "pacman --noconfirm -S --needed git zip unzip p7zip mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-qt6-base mingw-w64-ucrt-x86_64-qt6-imageformats" + if ($LASTEXITCODE -ne 0) { throw "pacman 安装依赖失败,退出码:$LASTEXITCODE" } - name: Configure and build shell: powershell