Workflow: Use manual docker build/cp for Windows to ensure reliability
This commit is contained in:
@@ -35,32 +35,36 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build Windows executable via Docker (Manual Extraction)
|
- name: Build Windows executable (Manual Build)
|
||||||
run: |
|
run: |
|
||||||
CONTAINER_NAME="win-builder-${{ github.run_id }}"
|
CONTAINER_NAME="win-builder-${{ github.run_id }}"
|
||||||
# 1. Create a container from a reliable Wine+Python 3.10 image
|
docker rm -f $CONTAINER_NAME || true
|
||||||
docker create --name $CONTAINER_NAME cdrx/pyinstaller-windows
|
|
||||||
|
# 1. Create the container with a custom build command
|
||||||
|
# We upgrade pyinstaller to fix the WinError 123 bug
|
||||||
|
docker create --name $CONTAINER_NAME --workdir /src cdrx/pyinstaller-windows sh -c "pip install --upgrade pyinstaller && pip install -r requirements.txt && pyinstaller --onefile --name tamigo-cli tamigo.py"
|
||||||
|
|
||||||
# 2. Copy source code into the container
|
# 2. Copy source code into the container
|
||||||
docker cp . $CONTAINER_NAME:/src
|
docker cp . $CONTAINER_NAME:/src
|
||||||
|
|
||||||
# 3. Run the build process manually inside the container
|
# 3. Run the build
|
||||||
# We upgrade pyinstaller and run the build
|
echo "Starting Windows build inside Docker..."
|
||||||
docker start -a $CONTAINER_NAME || echo "Container finished"
|
docker start -a $CONTAINER_NAME
|
||||||
|
|
||||||
# 4. Extract the result
|
# 4. Extract results
|
||||||
# PyInstaller in this image puts output in /src/dist/windows/ by default
|
echo "Extracting results from container..."
|
||||||
mkdir -p final_dist
|
mkdir -p final_dist
|
||||||
docker cp $CONTAINER_NAME:/src/dist/windows/tamigo-cli.exe ./final_dist/tamigo-cli.exe || \
|
# We copy the entire dist folder to be safe
|
||||||
docker cp $CONTAINER_NAME:/src/dist/tamigo-cli.exe ./final_dist/tamigo-cli.exe || \
|
docker cp $CONTAINER_NAME:/src/dist/. ./final_dist/ || echo "Warning: Could not copy dist folder"
|
||||||
echo "Could not find EXE in standard locations"
|
|
||||||
|
|
||||||
# 5. Cleanup
|
# 5. Cleanup
|
||||||
docker rm $CONTAINER_NAME
|
docker rm $CONTAINER_NAME
|
||||||
|
|
||||||
- name: Debug - Verify final file
|
- name: Debug - List final files
|
||||||
run: |
|
run: |
|
||||||
ls -R final_dist/
|
echo "Contents of final_dist:"
|
||||||
|
ls -R final_dist/ || echo "final_dist is empty"
|
||||||
|
echo "Finding all .exe files in workspace:"
|
||||||
find . -name "*.exe"
|
find . -name "*.exe"
|
||||||
|
|
||||||
- name: Upload Windows Artifact
|
- name: Upload Windows Artifact
|
||||||
|
|||||||
Reference in New Issue
Block a user