prova
Some checks failed
Build and Release FLUX Windows / build (push) Failing after 26s

This commit is contained in:
2026-05-22 10:45:46 +02:00
parent f574d6197b
commit 813fc9dd38
2 changed files with 20 additions and 17 deletions

View File

@@ -11,33 +11,36 @@ jobs:
- name: Checkout del codice
uses: actions/checkout@v3
# 1. Facciamo una build finta. Genererà i symlinks e poi fallirà per il bug,
# ma il 'continue-on-error' dirà a Gitea di ignorare l'errore e andare avanti.
- name: Pre-build per generare l'ambiente (Fallirà apposta)
# 1. Pre-build per generare i symlink (Fallirà apposta)
- name: Pre-build per generare l'ambiente
continue-on-error: true
run: flutter build windows --release
# 2. Ora la cartella ephemeral esiste! Applichiamo il fix e pialliamo la cache.
- name: Fix bug CMake di pdfx
# 2. Il Fix Definitivo con .NET
- name: Fix bug CMake di pdfx (Patcha la vera Pub Cache)
run: |
$cmakeFile = "windows\flutter\ephemeral\.plugin_symlinks\pdfx\windows\DownloadProject.cmake"
$file = "windows\flutter\ephemeral\.plugin_symlinks\pdfx\windows\DownloadProject.cmake"
if (Test-Path $cmakeFile) {
# 1. Applichiamo il cerotto
(Get-Content $cmakeFile) -replace 'VERSION 2.8.2', 'VERSION 3.5' | Set-Content $cmakeFile
Write-Host "Il cerotto CMake è stato applicato con successo!"
if (Test-Path $file) {
# Usiamo [IO.File] del .NET Framework!
# Questo segue il symlink in modo trasparente e modifica il VERO file originale nella Pub Cache.
$text = [IO.File]::ReadAllText($file)
$text = $text.Replace("VERSION 2.8.2", "VERSION 3.5")
[IO.File]::WriteAllText($file, $text)
# 2. LA MAGIA: Pialliamo la cache di CMake generata dalla build fallita!
if (Test-Path "build\windows") {
Remove-Item -Recurse -Force "build\windows"
Write-Host "Cache CMake eliminata. Pronti per la build pulita."
}
Write-Host "Il VERO file nella Pub Cache è stato patchato in modo permanente!"
} else {
Write-Error "File non trovato. La pre-build non ha generato i symlink."
exit 1
}
# 3. Ora che il file è corretto, la build vera arriverà fino in fondo
# Pialliamo la cache sporca di CMake del tentativo precedente
if (Test-Path "build\windows") {
Remove-Item -Recurse -Force "build\windows"
Write-Host "Cartella build sporca eliminata."
}
# 3. Ora la build vera non può fallire, perché il sorgente di pdfx è stato curato alla radice
- name: Build Flutter Definitiva
env:
CMAKE_BUILD_PARALLEL_LEVEL: 2