68 lines
2.2 KiB
YAML
68 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 via Docker (Fixed Paths)
|
|
run: |
|
|
CONTAINER_NAME="builder-${{ github.run_id }}"
|
|
docker rm -f $CONTAINER_NAME || true
|
|
|
|
# Create container
|
|
docker create --name $CONTAINER_NAME cdrx/pyinstaller-windows
|
|
|
|
# Copy code
|
|
docker cp . $CONTAINER_NAME:/src
|
|
|
|
# 1. Upgrade pyinstaller to fix the /tmp bug
|
|
# 2. Run pyinstaller with explicit local paths to avoid WinError 123
|
|
docker start -a $CONTAINER_NAME --attach --status || docker exec $CONTAINER_NAME sh -c "pip install --upgrade pyinstaller && cd /src && pyinstaller --onefile --name tamigo-cli --workpath /src/build --distpath /src/dist tamigo.py"
|
|
|
|
# Extract the result
|
|
mkdir -p output_dist
|
|
docker cp $CONTAINER_NAME:/src/dist/tamigo-cli.exe ./output_dist/tamigo-cli.exe || docker cp $CONTAINER_NAME:/src/dist/windows/tamigo-cli.exe ./output_dist/tamigo-cli.exe || true
|
|
|
|
docker rm $CONTAINER_NAME
|
|
|
|
- name: Debug - List local results
|
|
run: |
|
|
ls -R output_dist/ || echo "output_dist not found"
|
|
|
|
- name: Upload Windows Artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: binary-windows
|
|
path: output_dist/*.exe
|