name: Build Tamigo CLI on: push: branches: [ "main", "master" ] pull_request: branches: [ "main", "master" ] workflow_dispatch: jobs: build-linux: name: Build Linux Binary runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Build run: pyinstaller --onefile --name tamigo-cli tamigo.py - name: Upload Linux Artifact uses: actions/upload-artifact@v3 with: name: binary-linux path: dist/tamigo-cli build-windows: name: Build Windows Binary runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Build Windows executable via Docker (Discovery Mode) run: | CONTAINER_NAME="builder-${{ github.run_id }}" docker rm -f $CONTAINER_NAME || true # 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 path: output_dist/*.exe