Workflow: Use discovery mode to find Windows binary inside Docker
This commit is contained in:
@@ -34,19 +34,45 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build Windows executable via Docker
|
|
||||||
|
- name: Build Windows executable via Docker (Discovery Mode)
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
CONTAINER_NAME="builder-${{ github.run_id }}"
|
||||||
-v "${{ github.workspace }}:/src" \
|
docker rm -f $CONTAINER_NAME || true
|
||||||
cdrx/pyinstaller-windows \
|
|
||||||
sh -c "pip install -r requirements.txt && pyinstaller --onefile --name tamigo-cli tamigo.py"
|
|
||||||
|
|
||||||
- name: Debug - Find all .exe files
|
# 1. Create the container
|
||||||
run: find dist/ -name "*.exe" || echo "No exe files found"
|
docker create --name $CONTAINER_NAME cdrx/pyinstaller-windows
|
||||||
|
|
||||||
|
# 2. Copy the source code in
|
||||||
|
docker cp . $CONTAINER_NAME:/src
|
||||||
|
|
||||||
|
# 3. Start the build
|
||||||
|
docker start -a $CONTAINER_NAME || echo "Build process finished with some output"
|
||||||
|
|
||||||
|
# 4. DISCOVERY: Find where the .exe actually ended up inside the container
|
||||||
|
echo "Searching for .exe inside container..."
|
||||||
|
EXE_PATH=$(docker exec $CONTAINER_NAME find /src -name "*.exe" | head -n 1)
|
||||||
|
echo "Found EXE at: $EXE_PATH"
|
||||||
|
|
||||||
|
# 5. Extract the entire dist folder or the specific file
|
||||||
|
mkdir -p output_dist
|
||||||
|
if [ -n "$EXE_PATH" ]; then
|
||||||
|
docker cp $CONTAINER_NAME:$EXE_PATH ./output_dist/tamigo-cli.exe
|
||||||
|
else
|
||||||
|
echo "Falling back to copying /src/dist..."
|
||||||
|
docker cp $CONTAINER_NAME:/src/dist ./output_dist || echo "Final fallback failed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 6. Clean up
|
||||||
|
docker rm $CONTAINER_NAME
|
||||||
|
|
||||||
|
- name: Debug - List local results
|
||||||
|
run: |
|
||||||
|
ls -R output_dist/ || echo "output_dist not found"
|
||||||
|
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
|
||||||
# Search recursively for the exe
|
path: output_dist/*.exe
|
||||||
path: dist/**/*.exe
|
|
||||||
|
|||||||
Reference in New Issue
Block a user