Workflow: Use skandyla/wine-pyinstaller and docker cp for robust Windows builds
This commit is contained in:
@@ -35,33 +35,34 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build Windows executable (Standard CDRX)
|
- name: Build Windows executable (Robust Cross-Compile)
|
||||||
run: |
|
run: |
|
||||||
# The cdrx image is actually quite good if we let it use its OWN entrypoint
|
CONTAINER_NAME="win-build-${{ github.run_id }}"
|
||||||
# The issue was my custom 'sh -c' was breaking its Wine environment setup
|
|
||||||
mkdir -p output_dist
|
|
||||||
|
|
||||||
docker run --rm \
|
# 1. Create a container from a modern Wine-PyInstaller image
|
||||||
-v "${{ github.workspace }}:/src" \
|
docker create --name $CONTAINER_NAME skandyla/wine-pyinstaller sh -c "pip install -r requirements.txt && pyinstaller --onefile --name tamigo-cli tamigo.py"
|
||||||
cdrx/pyinstaller-windows
|
|
||||||
|
|
||||||
# This image outputs to dist/windows/ by default
|
# 2. Copy source into container
|
||||||
if [ -f "dist/windows/tamigo-cli.exe" ]; then
|
docker cp . $CONTAINER_NAME:/src
|
||||||
cp dist/windows/tamigo-cli.exe output_dist/
|
|
||||||
elif [ -f "dist/tamigo-cli.exe" ]; then
|
|
||||||
cp dist/tamigo-cli.exe output_dist/
|
|
||||||
fi
|
|
||||||
|
|
||||||
- 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()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
echo "Current directory tree:"
|
ls -R win_dist/
|
||||||
find . -maxdepth 3 -not -path '*/.*'
|
|
||||||
echo "Searching for any .exe:"
|
|
||||||
find . -name "*.exe"
|
find . -name "*.exe"
|
||||||
|
|
||||||
- name: Upload Windows Artifact
|
- name: Upload Windows Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: binary-windows
|
name: binary-windows
|
||||||
path: "**/*.exe"
|
path: win_dist/*.exe
|
||||||
|
|||||||
Reference in New Issue
Block a user