From 5915537e838d9e36634b2c7cf12573b1602a1f5a Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Sat, 24 Jan 2026 13:49:57 +0100 Subject: [PATCH] [Fix] Usa git clone per checkout su Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Sostituito download ZIP con git clone diretto - Più veloce e affidabile - Clone shallow (depth 1) per performance - Verifica Dockerfile.windows dopo clone - Git è disponibile sul runner Windows --- .gitea/workflows/docker-build.yml | 44 ++++++++----------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index a1a1cb0..8a3542f 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -99,47 +99,25 @@ jobs: packages: write steps: - - name: Download and extract repository + - name: Checkout repository with Git run: | - echo ===== Downloading repository ===== - curl -L -o repo.zip https://github.com/${{ github.repository }}/archive/refs/heads/${{ github.ref_name }}.zip + echo ===== Cloning repository ===== + git clone --depth 1 --branch ${{ github.ref_name }} https://github.com/${{ github.repository }}.git repo if errorlevel 1 ( - echo Failed to download repository + echo Failed to clone 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 ===== Verifying files ===== - echo Current directory contents: - dir /B + echo ===== Moving files to working directory ===== + robocopy repo . /E /MOVE /NFL /NDL /NJH /NJS + rmdir repo /S /Q 2>nul + echo ===== Verifying checkout ===== if exist Dockerfile.windows ( - echo SUCCESS: Dockerfile.windows found! + echo SUCCESS: Repository checked out, Dockerfile.windows found ) else ( - echo ERROR: Dockerfile.windows not found! + echo ERROR: Dockerfile.windows not found + dir /B exit /b 1 ) shell: cmd