From c0b37f456ef91809d3b900144a596408ec096c02 Mon Sep 17 00:00:00 2001 From: Daniel Dybing Date: Wed, 11 Mar 2026 15:38:22 +0100 Subject: [PATCH] Workflow: Use skandyla/wine-pyinstaller and docker cp for robust Windows builds --- .gitea/workflows/build.yml | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 2587c23..3e36d9b 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -35,33 +35,34 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Build Windows executable (Standard CDRX) + - name: Build Windows executable (Robust Cross-Compile) run: | - # The cdrx image is actually quite good if we let it use its OWN entrypoint - # The issue was my custom 'sh -c' was breaking its Wine environment setup - mkdir -p output_dist + CONTAINER_NAME="win-build-${{ github.run_id }}" - docker run --rm \ - -v "${{ github.workspace }}:/src" \ - cdrx/pyinstaller-windows + # 1. Create a container from a modern Wine-PyInstaller image + docker create --name $CONTAINER_NAME skandyla/wine-pyinstaller sh -c "pip install -r requirements.txt && pyinstaller --onefile --name tamigo-cli tamigo.py" - # This image outputs to dist/windows/ by default - if [ -f "dist/windows/tamigo-cli.exe" ]; then - cp dist/windows/tamigo-cli.exe output_dist/ - elif [ -f "dist/tamigo-cli.exe" ]; then - cp dist/tamigo-cli.exe output_dist/ - fi + # 2. Copy source into container + docker cp . $CONTAINER_NAME:/src - - name: Debug - Comprehensive Search + # 3. Run the build + docker start -a $CONTAINER_NAME + + # 4. Copy results back + mkdir -p win_dist + docker cp $CONTAINER_NAME:/src/dist/tamigo-cli.exe ./win_dist/tamigo-cli.exe || docker cp $CONTAINER_NAME:/src/dist/. ./win_dist/ + + # 5. Cleanup + docker rm $CONTAINER_NAME + + - name: Debug - List Files if: always() run: | - echo "Current directory tree:" - find . -maxdepth 3 -not -path '*/.*' - echo "Searching for any .exe:" + ls -R win_dist/ find . -name "*.exe" - name: Upload Windows Artifact uses: actions/upload-artifact@v3 with: name: binary-windows - path: "**/*.exe" + path: win_dist/*.exe