Compare commits
1 Commits
v1.1
...
5c818a09e0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c818a09e0 |
@@ -18,8 +18,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: pyinstaller --onefile --name tamigo-cli tamigo.py
|
||||||
pyinstaller --onefile --name tamigo-cli tamigo.py
|
|
||||||
- name: Rename for release
|
- name: Rename for release
|
||||||
run: mv dist/tamigo-cli dist/tamigo-cli-linux
|
run: mv dist/tamigo-cli dist/tamigo-cli-linux
|
||||||
- name: Upload to Release
|
- name: Upload to Release
|
||||||
@@ -34,26 +33,40 @@ 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 (Modern & Robust)
|
|
||||||
|
- name: Build Windows executable (Robust Release Fix)
|
||||||
run: |
|
run: |
|
||||||
CONTAINER_NAME="rel-builder-${{ github.run_id }}"
|
CONTAINER_NAME="win-rel-builder-${{ github.run_id }}"
|
||||||
docker rm -f $CONTAINER_NAME || true
|
|
||||||
|
|
||||||
# Using burningtyger/pyinstaller-windows for better path handling
|
# 1. Create and start container in background
|
||||||
docker create --name $CONTAINER_NAME burningtyger/pyinstaller-windows "pip install -r requirements.txt && pyinstaller --onefile --name tamigo-cli tamigo.py"
|
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 cp . $CONTAINER_NAME:/src
|
||||||
docker start -a $CONTAINER_NAME
|
|
||||||
docker cp $CONTAINER_NAME:/src/dist .
|
|
||||||
docker rm $CONTAINER_NAME
|
|
||||||
|
|
||||||
- name: Debug - List output files
|
# 3. Run build with explicit environment variables to fix the /tmp bug
|
||||||
run: ls -R dist/
|
docker exec -w /src $CONTAINER_NAME sh -c "
|
||||||
- name: Rename for release
|
export TMP=C:\\\\temp && \
|
||||||
run: mv dist/*.exe dist/tamigo-cli-windows.exe
|
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
|
- name: Upload to Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: dist/tamigo-cli-windows.exe
|
files: win_dist/tamigo-cli-windows.exe
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
8
GEMINI.md
Normal file
8
GEMINI.md
Normal file
@@ -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.
|
||||||
Reference in New Issue
Block a user