From a50b295c5939314d4f18348f0a7eee9f46c6c073 Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Sat, 24 Jan 2026 13:49:15 +0100 Subject: [PATCH] [Fix] Migliorato download e extract repository Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Usa robocopy per spostare file (più affidabile di xcopy) - Logging dettagliato per ogni fase - Verifica Dockerfile.windows dopo estrazione - Error handling robusto con exit codes - Risolve: Dockerfile.windows not found --- .gitea/workflows/docker-build.yml | 48 ++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index 856dd5c..a1a1cb0 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -101,19 +101,47 @@ jobs: steps: - name: Download and extract repository run: | - echo Downloading repository from GitHub... + echo ===== Downloading repository ===== curl -L -o repo.zip https://github.com/${{ github.repository }}/archive/refs/heads/${{ github.ref_name }}.zip - echo Extracting archive... - tar -xf repo.zip - echo Moving files... - for /d %%d in (*) do ( - if exist "%%d\.gitignore" ( - xcopy "%%d\*" . /E /H /Y /Q - rmdir "%%d" /S /Q - ) + if errorlevel 1 ( + echo Failed to download repository + exit /b 1 ) + + echo ===== Extracting archive ===== + tar -xf repo.zip + if errorlevel 1 ( + echo Failed to extract archive + exit /b 1 + ) + + echo ===== Finding extracted folder ===== + dir /B /AD + + echo ===== Moving files to current directory ===== + REM GitHub creates folder with format: repo-name-branch + REM Find first directory and copy its contents + for /d %%i in (*) do ( + echo Found directory: %%i + echo Copying contents from %%i to current directory... + robocopy "%%i" . /E /MOVE /NFL /NDL /NJH /NJS + goto :extracted + ) + :extracted + + echo ===== Cleaning up ===== del repo.zip - echo Repository ready + + echo ===== Verifying files ===== + echo Current directory contents: + dir /B + + if exist Dockerfile.windows ( + echo SUCCESS: Dockerfile.windows found! + ) else ( + echo ERROR: Dockerfile.windows not found! + exit /b 1 + ) shell: cmd - name: Debug - Verify files