diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 225eb2d..6493896 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -34,19 +34,45 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build Windows executable via Docker + + - name: Build Windows executable via Docker (Discovery Mode) run: | - docker run --rm \ - -v "${{ github.workspace }}:/src" \ - cdrx/pyinstaller-windows \ - sh -c "pip install -r requirements.txt && pyinstaller --onefile --name tamigo-cli tamigo.py" + CONTAINER_NAME="builder-${{ github.run_id }}" + docker rm -f $CONTAINER_NAME || true - - name: Debug - Find all .exe files - run: find dist/ -name "*.exe" || echo "No exe files found" + # 1. Create the container + 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 uses: actions/upload-artifact@v3 with: name: binary-windows - # Search recursively for the exe - path: dist/**/*.exe + path: output_dist/*.exe