Workflow: Use docker cp for robust Windows binary extraction
This commit is contained in:
@@ -35,24 +35,36 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build Windows executable via Docker (Direct Output)
|
- name: Build Windows executable via Docker (Manual Extraction)
|
||||||
run: |
|
run: |
|
||||||
# Use docker run with direct output to dist/
|
CONTAINER_NAME="win-builder-${{ github.run_id }}"
|
||||||
# We force pyinstaller to use current directory for workpath to avoid /tmp issues
|
# 1. Create a container from a reliable Wine+Python 3.10 image
|
||||||
docker run --rm \
|
docker create --name $CONTAINER_NAME cdrx/pyinstaller-windows
|
||||||
-v "${{ github.workspace }}:/src" \
|
|
||||||
cdrx/pyinstaller-windows \
|
|
||||||
sh -c "pip install --upgrade pyinstaller && pip install -r requirements.txt && pyinstaller --onefile --name tamigo-cli --workpath ./build --distpath ./dist_windows tamigo.py"
|
|
||||||
|
|
||||||
- name: Debug - List all files
|
# 2. Copy source code into the container
|
||||||
|
docker cp . $CONTAINER_NAME:/src
|
||||||
|
|
||||||
|
# 3. Run the build process manually inside the container
|
||||||
|
# We upgrade pyinstaller and run the build
|
||||||
|
docker start -a $CONTAINER_NAME || echo "Container finished"
|
||||||
|
|
||||||
|
# 4. Extract the result
|
||||||
|
# PyInstaller in this image puts output in /src/dist/windows/ by default
|
||||||
|
mkdir -p final_dist
|
||||||
|
docker cp $CONTAINER_NAME:/src/dist/windows/tamigo-cli.exe ./final_dist/tamigo-cli.exe || \
|
||||||
|
docker cp $CONTAINER_NAME:/src/dist/tamigo-cli.exe ./final_dist/tamigo-cli.exe || \
|
||||||
|
echo "Could not find EXE in standard locations"
|
||||||
|
|
||||||
|
# 5. Cleanup
|
||||||
|
docker rm $CONTAINER_NAME
|
||||||
|
|
||||||
|
- name: Debug - Verify final file
|
||||||
run: |
|
run: |
|
||||||
echo "Listing dist_windows folder:"
|
ls -R final_dist/
|
||||||
ls -R dist_windows/ || echo "dist_windows not found"
|
|
||||||
echo "Searching for any .exe in workspace:"
|
|
||||||
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: final_dist/*.exe
|
||||||
|
|||||||
Reference in New Issue
Block a user