diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index cc4c592..026936b 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -18,8 +18,7 @@ jobs: run: | pip install -r requirements.txt - name: Build - run: | - pyinstaller --onefile --name tamigo-cli tamigo.py + run: pyinstaller --onefile --name tamigo-cli tamigo.py - name: Rename for release run: mv dist/tamigo-cli dist/tamigo-cli-linux - name: Upload to Release @@ -34,26 +33,40 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build Windows executable via Docker (Modern & Robust) + + - name: Build Windows executable (Robust Release Fix) run: | - CONTAINER_NAME="rel-builder-${{ github.run_id }}" - docker rm -f $CONTAINER_NAME || true + CONTAINER_NAME="win-rel-builder-${{ github.run_id }}" - # Using burningtyger/pyinstaller-windows for better path handling - docker create --name $CONTAINER_NAME burningtyger/pyinstaller-windows "pip install -r requirements.txt && pyinstaller --onefile --name tamigo-cli tamigo.py" + # 1. Create and start container in background + docker run -d --name $CONTAINER_NAME --entrypoint tail cdrx/pyinstaller-windows -f /dev/null + # 2. Copy source into container + docker exec $CONTAINER_NAME mkdir -p /src docker cp . $CONTAINER_NAME:/src - docker start -a $CONTAINER_NAME - docker cp $CONTAINER_NAME:/src/dist . - docker rm $CONTAINER_NAME - - name: Debug - List output files - run: ls -R dist/ - - name: Rename for release - run: mv dist/*.exe dist/tamigo-cli-windows.exe + # 3. Run build with explicit environment variables to fix the /tmp bug + docker exec -w /src $CONTAINER_NAME sh -c " + export TMP=C:\\\\temp && \ + export TEMP=C:\\\\temp && \ + mkdir -p /src/build /src/dist_win && \ + pip install -r requirements.txt && \ + pyinstaller --onefile --name tamigo-cli \ + --workpath /src/build \ + --distpath /src/dist_win \ + --specpath /src/build \ + tamigo.py" + + # 4. Extract results + mkdir -p win_dist + docker cp $CONTAINER_NAME:/src/dist_win/tamigo-cli.exe ./win_dist/tamigo-cli-windows.exe + + # 5. Cleanup + docker rm -f $CONTAINER_NAME + - name: Upload to Release uses: softprops/action-gh-release@v2 with: - files: dist/tamigo-cli-windows.exe + files: win_dist/tamigo-cli-windows.exe env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/GEMINI.md b/GEMINI.md new file mode 100644 index 0000000..df50a73 --- /dev/null +++ b/GEMINI.md @@ -0,0 +1,8 @@ + +## Windows Cross-Compilation Fix (Gitea Actions) +- **Problem**: The Windows build was failing due to `OSError: [WinError 123] Invalid name: '/tmp\\*'` and volume mount issues in the Gitea CI environment. +- **Solution**: + 1. Used the `cdrx/pyinstaller-windows` Docker image but bypassed its default entrypoint. + 2. Implemented a "Manual Copy" strategy using `docker cp` to move files in and out of the container, avoiding unreliable volume mounts. + 3. Forced PyInstaller to use Windows-compatible paths by explicitly setting `TMP` and `TEMP` environment variables to `C:\\temp` and specifying `--workpath` and `--distpath` during the build command. + 4. Downgraded `upload-artifact` to `v3` for compatibility with Gitea's artifact storage.