mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-15 21:00:42 -07:00
Problem: The server binary with CUDA support was 2.9GB, causing: - MSI installer failures in CI (WiX can't handle 3GB files) - Massive downloads for all users (even those without GPUs) - Poor user experience Solution: Build two separate server binaries: - voicebox-server.exe (CPU-only, ~295MB) - ships with installer - voicebox-server-cuda.exe (CUDA, ~2.9GB) - optional download Changes: - backend/build_binary.py: Added 'variant' parameter for CPU/CUDA builds - backend/build_cpu.bat: Script to build CPU-only binary - backend/build_cuda.bat: Script to build CUDA binary - backend/build_both.bat: Script to build both binaries - backend/build_cpu.sh: Unix build script for CPU binary - .github/workflows/release.yml: Build both variants, upload CUDA separately - tauri/vite.config.ts: Externalize Tauri plugins to fix build - docs/dual-server-binaries.md: Complete documentation Results: - Installer size reduced from 3GB to ~500MB (6x smaller) - CI builds now succeed (WiX can handle 500MB) - GPU users can opt-in to download CUDA support - Better bandwidth usage for CPU-only users Next steps: - Frontend implementation to detect GPU and download CUDA binary - Settings UI to toggle between CPU/CUDA modes Co-Authored-By: Claude Sonnet 4.5 (1M context) <[email protected]>
198 lines
7.3 KiB
YAML
198 lines
7.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- platform: 'macos-latest'
|
|
args: '--target aarch64-apple-darwin'
|
|
python-version: '3.12'
|
|
backend: 'mlx'
|
|
- platform: 'macos-15-intel'
|
|
args: '--target x86_64-apple-darwin'
|
|
python-version: '3.12'
|
|
backend: 'pytorch'
|
|
# - platform: 'ubuntu-22.04'
|
|
# args: ''
|
|
# python-version: '3.12'
|
|
# backend: 'pytorch'
|
|
- platform: 'windows-latest'
|
|
args: ''
|
|
python-version: '3.12'
|
|
backend: 'pytorch'
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies (ubuntu only)
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf llvm-dev
|
|
|
|
- name: Install LLVM (macOS)
|
|
if: matrix.platform == 'macos-latest' || matrix.platform == 'macos-15-intel'
|
|
run: |
|
|
brew install llvm@20
|
|
echo "$(brew --prefix llvm@20)/bin" >> $GITHUB_PATH
|
|
echo "LLVM_CONFIG=$(brew --prefix llvm@20)/bin/llvm-config" >> $GITHUB_ENV
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
|
|
- name: Install Python dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pyinstaller
|
|
pip install -r backend/requirements.txt
|
|
|
|
- name: Install MLX dependencies (Apple Silicon only)
|
|
if: matrix.backend == 'mlx'
|
|
run: |
|
|
pip install -r backend/requirements-mlx.txt
|
|
|
|
- name: Build Python server (Linux/macOS)
|
|
if: matrix.platform != 'windows-latest'
|
|
run: |
|
|
chmod +x scripts/build-server.sh
|
|
./scripts/build-server.sh
|
|
|
|
- name: Build CPU Python server (Windows)
|
|
if: matrix.platform == 'windows-latest'
|
|
shell: bash
|
|
run: |
|
|
cd backend
|
|
|
|
echo "Installing CPU-only PyTorch..."
|
|
pip uninstall -y torch torchvision torchaudio
|
|
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
|
|
|
echo "Building CPU server binary..."
|
|
python build_binary.py cpu
|
|
|
|
# Get platform tuple
|
|
PLATFORM=$(rustc --print host-tuple)
|
|
|
|
# Create binaries directory
|
|
mkdir -p ../tauri/src-tauri/binaries
|
|
|
|
# Copy CPU version (default for installer)
|
|
cp dist/voicebox-server.exe ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}.exe
|
|
echo "Built CPU server: voicebox-server-${PLATFORM}.exe (~500MB)"
|
|
|
|
- name: Build CUDA Python server (Windows)
|
|
if: matrix.platform == 'windows-latest'
|
|
shell: bash
|
|
run: |
|
|
cd backend
|
|
|
|
echo "Installing CUDA PyTorch..."
|
|
pip uninstall -y torch torchvision torchaudio
|
|
pip install torch --index-url https://download.pytorch.org/whl/cu121 --force-reinstall --no-deps
|
|
pip install torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
|
|
|
|
echo "Building CUDA server binary..."
|
|
python build_binary.py cuda
|
|
|
|
# Get platform tuple
|
|
PLATFORM=$(rustc --print host-tuple)
|
|
|
|
# Copy CUDA version for separate upload
|
|
mkdir -p cuda-release
|
|
cp dist/voicebox-server-cuda.exe cuda-release/voicebox-server-cuda-${PLATFORM}.exe
|
|
echo "Built CUDA server: voicebox-server-cuda-${PLATFORM}.exe (~3GB)"
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
|
|
- name: Install Rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ (matrix.platform == 'macos-latest' && 'aarch64-apple-darwin') || (matrix.platform == 'macos-15-intel' && 'x86_64-apple-darwin') || '' }}
|
|
|
|
- name: Rust cache
|
|
uses: swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: './tauri/src-tauri -> target'
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Install Apple API key
|
|
if: matrix.platform == 'macos-latest' || matrix.platform == 'macos-15-intel'
|
|
run: |
|
|
mkdir -p ~/.appstoreconnect/private_keys/
|
|
cd ~/.appstoreconnect/private_keys/
|
|
echo ${{ secrets.APPLE_API_KEY_BASE64 }} >> AuthKey_${{ secrets.APPLE_API_KEY }}.p8.base64
|
|
base64 --decode -i AuthKey_${{ secrets.APPLE_API_KEY }}.p8.base64 -o AuthKey_${{ secrets.APPLE_API_KEY }}.p8
|
|
rm AuthKey_${{ secrets.APPLE_API_KEY }}.p8.base64
|
|
|
|
- name: Install Codesigning Certificate
|
|
if: matrix.platform == 'macos-latest' || matrix.platform == 'macos-15-intel'
|
|
uses: apple-actions/import-codesign-certs@v3
|
|
with:
|
|
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
|
|
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
|
|
- uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
|
|
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
|
APPLE_PROVIDER_SHORT_NAME: ${{ secrets.APPLE_PROVIDER_SHORT_NAME }}
|
|
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
|
|
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
|
|
with:
|
|
projectPath: tauri
|
|
tagName: v__VERSION__
|
|
releaseName: 'voicebox v__VERSION__'
|
|
releaseBody: |
|
|
## What's Changed
|
|
See the assets below to download and install this version.
|
|
|
|
### Installation
|
|
- **macOS (Apple Silicon)**: Download the `aarch64.dmg` file - uses MLX for fast native inference
|
|
- **macOS (Intel)**: Download the `x64.dmg` file - uses PyTorch
|
|
- **Windows**: Download the `.msi` installer - includes CPU-only inference (~500MB)
|
|
- **Linux**: Download the `.AppImage` or `.deb` package
|
|
|
|
### NVIDIA GPU Acceleration (Windows)
|
|
Windows users with NVIDIA GPUs can enable CUDA for 4-5x faster inference:
|
|
1. Install the app normally (CPU version)
|
|
2. The app will detect your GPU and offer to download CUDA support
|
|
3. Or manually download `voicebox-server-cuda-*.exe` (~3GB) from the assets below
|
|
|
|
The app includes automatic updates - future updates will be installed automatically.
|
|
releaseDraft: true
|
|
prerelease: false
|
|
args: ${{ matrix.args }}
|
|
includeUpdaterJson: true
|
|
|
|
- name: Upload CUDA server binary (Windows only)
|
|
if: matrix.platform == 'windows-latest'
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: backend/cuda-release/voicebox-server-cuda-*.exe
|
|
draft: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|