From 748d58f0364c80ddd1270ca9d26cefb399ee4ab8 Mon Sep 17 00:00:00 2001 From: foxyz Date: Sat, 10 Oct 2026 00:01:02 +0300 Subject: [PATCH] CI: build Windows on every push; a failed Windows build prints the compiler errors Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/ci.yml | 5 +++++ tool/package_windows.ps1 | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index f256090..864dded 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -60,3 +60,8 @@ jobs: dart pub get if ($LASTEXITCODE) { exit 1 } dart test test/updater_test.dart + # The release build, without publishing: a broken Windows build shows + # here, not only on a tag. + - name: Windows build + shell: powershell + run: powershell -NoProfile -ExecutionPolicy Bypass -File tool/package_windows.ps1 diff --git a/tool/package_windows.ps1 b/tool/package_windows.ps1 index 7da051e..654e301 100644 --- a/tool/package_windows.ps1 +++ b/tool/package_windows.ps1 @@ -27,7 +27,14 @@ function Invoke-Checked([string]$What, [scriptblock]$Cmd) { if (-not $SkipBuild) { Push-Location $App try { - Invoke-Checked 'flutter build windows' { flutter build windows --release "--dart-define=APP_VERSION=$Version" } + flutter build windows --release "--dart-define=APP_VERSION=$Version" + if ($LASTEXITCODE -ne 0) { + # Flutter hides MSBuild's messages: rebuild verbosely and show only + # the compiler/linker errors, so CI logs say what broke. + $log = flutter build windows --release -v "--dart-define=APP_VERSION=$Version" 2>&1 + $log | Select-String -Pattern 'error C\d+|error LNK\d+|fatal error|: error ' | ForEach-Object { $_.Line } | Select-Object -First 40 + throw 'flutter build windows failed' + } } finally { Pop-Location } }