Files
tamigo-cli/.gitea/workflows/build.yml
Daniel Dybing 987ce19aec
Some checks failed
Build Tamigo CLI / Build Linux Binary (pull_request) Successful in 54s
Build Tamigo CLI / Build Windows Binary (pull_request) Failing after 18s
CI: Add test execution step to build and release workflows
2026-03-14 12:01:07 +01:00

82 lines
2.5 KiB
YAML

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: Run tests
run: python3 test_export.py
- name: Build
run: pyinstaller --onefile --name tamigo-cli tamigo.py
- name: Upload Linux Artifact
uses: actions/upload-artifact@v3
with:
name: tamigo-cli-linux-binary
path: dist/tamigo-cli
build-windows:
name: Build Windows Binary
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Windows executable (Robust CP Method)
run: |
CONTAINER_NAME="win-builder-${{ github.run_id }}"
# 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
# 3. Run build with explicit environment variables to fix the /tmp bug
# We also use explicit paths for every PyInstaller directory
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 && \
python3 test_export.py && \
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.exe
# 5. Cleanup
docker rm -f $CONTAINER_NAME
- name: Debug - List Files
if: always()
run: |
ls -R win_dist/ || echo "win_dist not found"
- name: Upload Windows Artifact
uses: actions/upload-artifact@v3
with:
name: tamigo-cli-windows-binary
path: win_dist/tamigo-cli.exe