From 8e4ae990f996de5c1b02d991dd91c9a503007ea9 Mon Sep 17 00:00:00 2001 From: Daniel Dybing Date: Wed, 11 Mar 2026 15:15:02 +0100 Subject: [PATCH] Workflow: Streamline Windows build using /tmp for PyInstaller to fix path errors --- .gitea/workflows/build.yml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 608456f..143fb78 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -35,26 +35,21 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Build Windows executable via Docker (Fixed Paths) + - name: Build Windows executable via Docker (Streamlined) run: | - CONTAINER_NAME="builder-${{ github.run_id }}" - docker rm -f $CONTAINER_NAME || true - - # Create container - docker create --name $CONTAINER_NAME cdrx/pyinstaller-windows - - # Copy code - docker cp . $CONTAINER_NAME:/src - - # 1. Upgrade pyinstaller to fix the /tmp bug - # 2. Run pyinstaller with explicit local paths to avoid WinError 123 - docker start -a $CONTAINER_NAME --attach --status || docker exec $CONTAINER_NAME sh -c "pip install --upgrade pyinstaller && cd /src && pyinstaller --onefile --name tamigo-cli --workpath /src/build --distpath /src/dist tamigo.py" - - # Extract the result + # Create output directory mkdir -p output_dist - docker cp $CONTAINER_NAME:/src/dist/tamigo-cli.exe ./output_dist/tamigo-cli.exe || docker cp $CONTAINER_NAME:/src/dist/windows/tamigo-cli.exe ./output_dist/tamigo-cli.exe || true - docker rm $CONTAINER_NAME + # Run the build in one clean shot using volume mount for simplicity since we are on ubuntu-latest + # We override the entrypoint to run our own shell script inside Wine/Windows environment + docker run --rm \ + -v "${{ github.workspace }}:/src" \ + -w /src \ + cdrx/pyinstaller-windows \ + sh -c "pip install --upgrade pyinstaller && pip install -r requirements.txt && pyinstaller --onefile --name tamigo-cli --workpath /tmp/build --distpath /tmp/dist tamigo.py && cp /tmp/dist/tamigo-cli.exe /src/tamigo-cli.exe" + + # Move the result to our tracked folder + mv tamigo-cli.exe output_dist/ || echo "EXE not found in root" - name: Debug - List local results run: |