Workflow: Streamline Windows build using /tmp for PyInstaller to fix path errors
All checks were successful
Build Tamigo CLI / Build Linux Binary (push) Successful in 52s
Build Tamigo CLI / Build Windows Binary (push) Successful in 4s

This commit is contained in:
Daniel Dybing
2026-03-11 15:15:02 +01:00
parent fd4889da1e
commit 8e4ae990f9

View File

@@ -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: |