ci(windows): split build into cargo + flutter; restore flutter/windows between
build-windows / build-windows-x64 (push) Failing after 1h20m26s

This commit is contained in:
2026-05-04 22:00:39 +02:00
parent 8bf82833f0
commit 9f131e7113
+49 -3
View File
@@ -212,11 +212,57 @@ jobs:
fi
fi
- name: Build RustDesk (build.py --portable --hwcodec --flutter --vram)
# The monolithic `python build.py` invocation that the upstream GitHub
# workflow uses runs cargo and `flutter build windows` back-to-back. On this
# self-hosted runner, *something* during the ~14min cargo build wipes out
# flutter/windows, which then makes the subsequent flutter build fail with
# "source directory does not exist" -- even though the diagnostic step
# immediately above confirms the dir is fully present at that moment.
# Splitting the build into discrete steps lets us restore flutter/windows
# right before flutter needs it, after cargo has finished.
- name: Cargo build (virtual_display dylib + main lib)
shell: pwsh
run: |
python .\build.py --portable --hwcodec --flutter --vram --skip-portable-pack
Move-Item -Force .\flutter\build\windows\x64\runner\Release .\rustdesk
$features = "hwcodec,vram,flutter"
Push-Location libs\virtual_display\dylib
cargo build --release
if ($LASTEXITCODE -ne 0) { throw "cargo build (virtual_display) failed" }
Pop-Location
cargo build --features $features --lib --release
if ($LASTEXITCODE -ne 0) { throw "cargo build (rustdesk lib) failed" }
if (-not (Test-Path target\release\librustdesk.dll)) {
throw "target\release\librustdesk.dll missing after cargo build"
}
- name: Restore flutter/windows if cargo build wiped it
shell: bash
run: |
if [ ! -d flutter/windows ]; then
echo "flutter/windows missing after cargo build -- restoring from git"
git status --porcelain | grep -E "flutter/windows" | head -10 || true
git checkout HEAD -- flutter/windows
fi
test -d flutter/windows && echo "flutter/windows present: $(find flutter/windows -type f | wc -l) files"
test -f flutter/windows/CMakeLists.txt || { echo "CMakeLists.txt missing"; exit 1; }
- name: Flutter build windows
shell: pwsh
run: |
Push-Location flutter
flutter build windows --release
if ($LASTEXITCODE -ne 0) { throw "flutter build windows failed" }
Pop-Location
# Mirror what build.py's build_flutter_windows() does after flutter build:
# copy the virtual_display dylib next to rustdesk.exe.
Copy-Item -Force `
target\release\deps\dylib_virtual_display.dll `
flutter\build\windows\x64\runner\Release\
Move-Item -Force flutter\build\windows\x64\runner\Release rustdesk
- name: Bundle usbmmidd_v2 + printer driver
shell: pwsh