[Fix] Migliorato download e extract repository Windows

- 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
This commit is contained in:
2026-01-24 13:49:15 +01:00
parent 33381a9950
commit a50b295c59
+38 -10
View File
@@ -101,19 +101,47 @@ jobs:
steps: steps:
- name: Download and extract repository - name: Download and extract repository
run: | 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 curl -L -o repo.zip https://github.com/${{ github.repository }}/archive/refs/heads/${{ github.ref_name }}.zip
echo Extracting archive... if errorlevel 1 (
tar -xf repo.zip echo Failed to download repository
echo Moving files... exit /b 1
for /d %%d in (*) do (
if exist "%%d\.gitignore" (
xcopy "%%d\*" . /E /H /Y /Q
rmdir "%%d" /S /Q
)
) )
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 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 shell: cmd
- name: Debug - Verify files - name: Debug - Verify files