Skip to content

feat: graph-tool-call PyInstaller sidecar 번들링 — 앱 빌트인 #30

feat: graph-tool-call PyInstaller sidecar 번들링 — 앱 빌트인

feat: graph-tool-call PyInstaller sidecar 번들링 — 앱 빌트인 #30

Workflow file for this run

name: Build Desktop App
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
TAURI_ENV: "true"
NEXT_PUBLIC_BACKEND_HOST: "https://xgen.x2bee.com"
NEXT_PUBLIC_BACKEND_PORT: ""
GRAPH_TOOL_CALL_VERSION: "0.13.1"
jobs:
build-windows:
runs-on: windows-latest
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v4
# --- PyInstaller: graph-tool-call sidecar ---
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build graph-tool-call sidecar (Windows)
shell: bash
run: |
pip install "graph-tool-call[mcp]==$GRAPH_TOOL_CALL_VERSION" pyinstaller
# Find the entry point
ENTRY=$(python -c "import graph_tool_call.__main__; print(graph_tool_call.__main__.__file__)")
echo "Entry point: $ENTRY"
pyinstaller --onefile --name graph-tool-call --hidden-import graph_tool_call "$ENTRY"
# Copy to Tauri sidecar directory with target triple suffix
mkdir -p src-tauri/binaries
cp dist/graph-tool-call.exe "src-tauri/binaries/graph-tool-call-x86_64-pc-windows-msvc.exe"
echo "Sidecar built: $(ls -lh src-tauri/binaries/)"
# --- Frontend: xgen-frontend clone & build ---
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
continue-on-error: true
- name: Clone xgen-frontend
run: |
git clone --depth 1 --branch main "https://sonsj97:${{ secrets.GITLAB_TOKEN }}@gitlab.x2bee.com/xgen2.0/xgen-frontend.git" frontend
- name: Patch frontend for Tauri static export
shell: bash
run: bash scripts/patch-frontend.sh
- name: Install frontend dependencies
working-directory: frontend
run: npm install
- name: Build frontend (static export)
working-directory: frontend
run: npm run build
- name: Copy CLI window HTML
shell: bash
run: cp src-cli/cli.html frontend/out/cli.html
- name: Verify frontend build output
run: |
if (!(Test-Path "frontend/out")) { Write-Error "frontend/out not found"; exit 1 }
Write-Host "Frontend build OK: $(Get-ChildItem -Recurse frontend/out -File | Measure-Object | Select-Object -ExpandProperty Count) files"
# --- Tauri: Rust build ---
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: src-tauri
cache-on-failure: true
- name: Install Tauri CLI
run: cargo install tauri-cli --version "^2"
- name: Build Tauri app (Windows)
working-directory: src-tauri
run: cargo tauri build
- name: Upload MSI installer
uses: actions/upload-artifact@v4
with:
name: xgen-windows-msi
path: src-tauri/target/release/bundle/msi/*.msi
if-no-files-found: warn
- name: Upload NSIS installer
uses: actions/upload-artifact@v4
with:
name: xgen-windows-nsis
path: src-tauri/target/release/bundle/nsis/*.exe
if-no-files-found: warn
build-macos:
runs-on: macos-latest
timeout-minutes: 90
steps:
- name: Checkout
uses: actions/checkout@v4
# --- PyInstaller: graph-tool-call sidecar ---
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build graph-tool-call sidecar (macOS)
run: |
pip install "graph-tool-call[mcp]==$GRAPH_TOOL_CALL_VERSION" pyinstaller
# Find the entry point
ENTRY=$(python -c "import graph_tool_call.__main__; print(graph_tool_call.__main__.__file__)")
echo "Entry point: $ENTRY"
pyinstaller --onefile --name graph-tool-call --hidden-import graph_tool_call "$ENTRY"
# Copy to Tauri sidecar directory with target triple suffix
mkdir -p src-tauri/binaries
cp dist/graph-tool-call "src-tauri/binaries/graph-tool-call-aarch64-apple-darwin"
chmod +x "src-tauri/binaries/graph-tool-call-aarch64-apple-darwin"
echo "Sidecar built: $(ls -lh src-tauri/binaries/)"
# --- Frontend ---
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Clone xgen-frontend
run: |
git clone --depth 1 --branch main "https://sonsj97:${{ secrets.GITLAB_TOKEN }}@gitlab.x2bee.com/xgen2.0/xgen-frontend.git" frontend
- name: Patch frontend for Tauri static export
run: bash scripts/patch-frontend.sh
- name: Install frontend dependencies
working-directory: frontend
run: npm install
- name: Build frontend (static export)
working-directory: frontend
run: npm run build
- name: Copy CLI window HTML
run: cp src-cli/cli.html frontend/out/cli.html
- name: Verify frontend build output
run: |
test -d frontend/out || (echo "frontend/out not found" && exit 1)
echo "Frontend build OK: $(find frontend/out -type f | wc -l) files"
# --- Tauri ---
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: src-tauri
cache-on-failure: true
- name: Install Tauri CLI
run: cargo install tauri-cli --version "^2"
- name: Build Tauri app (macOS)
working-directory: src-tauri
run: cargo tauri build
- name: Upload DMG
uses: actions/upload-artifact@v4
with:
name: xgen-macos-dmg
path: src-tauri/target/release/bundle/dmg/*.dmg
if-no-files-found: warn
- name: Upload macOS app
uses: actions/upload-artifact@v4
with:
name: xgen-macos-app
path: src-tauri/target/release/bundle/macos/*.app
if-no-files-found: warn