Files
tamigo-cli/.gitea/workflows/build.yml
Daniel Dybing eb845563a7
Some checks failed
Build Tamigo CLI / Build Linux Binary (push) Successful in 54s
Build Tamigo CLI / Build Windows Binary (push) Failing after 2m43s
Workflow: Build local Docker environment for Windows to guarantee availability
2026-03-11 15:41:42 +01:00

73 lines
2.2 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: 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 (Self-Built Environment)
run: |
# 1. Create a local Dockerfile for a guaranteed working environment
cat <<EOF > Dockerfile.win
FROM python:3.10-slim
RUN apt-get update && apt-get install -y wine binutils-mingw-w64-x86-64 && apt-get clean
RUN python -m pip install --upgrade pip pyinstaller requests questionary rich python-dotenv
WORKDIR /src
EOF
# 2. Build the local image
docker build -t local-win-builder -f Dockerfile.win .
# 3. Create container and copy files
CONTAINER_NAME="win-build-${{ github.run_id }}"
docker create --name \$CONTAINER_NAME local-win-builder sh -c "pyinstaller --onefile --name tamigo-cli tamigo.py"
docker cp . \$CONTAINER_NAME:/src
# 4. Start build and extract
docker start -a \$CONTAINER_NAME
mkdir -p win_dist
docker cp \$CONTAINER_NAME:/src/dist/. ./win_dist/
docker rm \$CONTAINER_NAME
- name: Debug - List Files
if: always()
run: |
ls -R win_dist/ || echo "No win_dist folder"
find . -name "*.exe"
- name: Upload Windows Artifact
uses: actions/upload-artifact@v3
with:
name: binary-windows
path: win_dist/*.exe