mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-16 05:10:42 -07:00
281 lines
10 KiB
YAML
281 lines
10 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
env:
|
|
PROVIDER_VERSION: "1.0.0"
|
|
|
|
jobs:
|
|
# ============================================
|
|
# Build TTS Providers (uploaded to R2, not GitHub)
|
|
# ============================================
|
|
build-providers:
|
|
runs-on: ${{ matrix.platform }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# PyTorch CPU provider (Windows)
|
|
- platform: "windows-latest"
|
|
provider: "pytorch-cpu"
|
|
python-version: "3.12"
|
|
# PyTorch CUDA provider (Windows) - large binary, uploaded to R2
|
|
- platform: "windows-latest"
|
|
provider: "pytorch-cuda"
|
|
python-version: "3.12"
|
|
# PyTorch CPU provider (Linux)
|
|
# - platform: "ubuntu-22.04"
|
|
# provider: "pytorch-cpu"
|
|
# python-version: "3.12"
|
|
# PyTorch CUDA provider (Linux) - large binary, uploaded to R2
|
|
- platform: "ubuntu-22.04"
|
|
provider: "pytorch-cuda"
|
|
python-version: "3.12"
|
|
|
|
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 llvm-dev
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: "pip"
|
|
|
|
- name: Install Python dependencies (CPU)
|
|
if: matrix.provider == 'pytorch-cpu'
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pyinstaller
|
|
pip install -r providers/pytorch-cpu/requirements.txt
|
|
pip install -r backend/requirements.txt
|
|
|
|
- name: Install Python dependencies (CUDA)
|
|
if: matrix.provider == 'pytorch-cuda'
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pyinstaller
|
|
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
|
|
pip install -r providers/pytorch-cuda/requirements.txt
|
|
pip install -r backend/requirements.txt
|
|
|
|
- name: Build provider binary
|
|
shell: bash
|
|
run: |
|
|
cd providers/${{ matrix.provider }}
|
|
python build.py
|
|
|
|
- name: Upload provider to R2
|
|
shell: bash
|
|
env:
|
|
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
|
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
|
|
run: |
|
|
# Install AWS CLI (compatible with R2)
|
|
pip install awscli
|
|
|
|
# Configure AWS CLI for R2
|
|
aws configure set aws_access_key_id $R2_ACCESS_KEY_ID
|
|
aws configure set aws_secret_access_key $R2_SECRET_ACCESS_KEY
|
|
aws configure set region auto
|
|
|
|
# Determine binary name based on platform
|
|
if [ "${{ matrix.platform }}" == "windows-latest" ]; then
|
|
BINARY_NAME="tts-provider-${{ matrix.provider }}.exe"
|
|
BINARY_PATH="providers/${{ matrix.provider }}/dist/tts-provider-${{ matrix.provider }}.exe"
|
|
else
|
|
BINARY_NAME="tts-provider-${{ matrix.provider }}"
|
|
BINARY_PATH="providers/${{ matrix.provider }}/dist/tts-provider-${{ matrix.provider }}"
|
|
fi
|
|
|
|
# Add platform suffix for clarity
|
|
if [ "${{ matrix.platform }}" == "windows-latest" ]; then
|
|
UPLOAD_NAME="tts-provider-${{ matrix.provider }}-windows.exe"
|
|
else
|
|
UPLOAD_NAME="tts-provider-${{ matrix.provider }}-linux"
|
|
fi
|
|
|
|
# Upload to R2 (bucket: voicebox)
|
|
aws s3 cp "$BINARY_PATH" "s3://voicebox/providers/v${{ env.PROVIDER_VERSION }}/$UPLOAD_NAME" \
|
|
--endpoint-url "$R2_ENDPOINT"
|
|
|
|
echo "Uploaded $UPLOAD_NAME to R2"
|
|
|
|
# ============================================
|
|
# Build Main App (without bundled TTS on Win/Linux)
|
|
# ============================================
|
|
release:
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# macOS Apple Silicon - MLX bundled (works out of the box)
|
|
- platform: "macos-latest"
|
|
args: "--target aarch64-apple-darwin"
|
|
python-version: "3.12"
|
|
backend: "mlx"
|
|
# macOS Intel - PyTorch bundled (smaller user base, keep simple)
|
|
- platform: "macos-15-intel"
|
|
args: "--target x86_64-apple-darwin"
|
|
python-version: "3.12"
|
|
backend: "pytorch"
|
|
# Linux - No TTS bundled, providers downloaded separately
|
|
- platform: "ubuntu-22.04"
|
|
args: ""
|
|
python-version: "3.12"
|
|
backend: "none"
|
|
# Windows - No TTS bundled, providers downloaded separately
|
|
- platform: "windows-latest"
|
|
args: ""
|
|
python-version: "3.12"
|
|
backend: "none"
|
|
|
|
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 libasound2-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 (with TTS)
|
|
if: matrix.backend != 'none'
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pyinstaller
|
|
pip install -r backend/requirements.txt
|
|
|
|
- name: Install Python dependencies (without TTS)
|
|
if: matrix.backend == 'none'
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pyinstaller
|
|
# Install base requirements without PyTorch/Qwen-TTS
|
|
pip install fastapi uvicorn sqlalchemy librosa soundfile numpy httpx
|
|
pip install huggingface_hub # For Whisper downloads
|
|
|
|
- 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 Python server (Windows)
|
|
if: matrix.platform == 'windows-latest'
|
|
shell: bash
|
|
run: |
|
|
cd backend
|
|
python build_binary.py
|
|
|
|
# Get platform tuple
|
|
PLATFORM=$(rustc --print host-tuple)
|
|
|
|
# Create binaries directory
|
|
mkdir -p ../tauri/src-tauri/binaries
|
|
|
|
# Copy with platform suffix
|
|
cp dist/voicebox-server.exe ../tauri/src-tauri/binaries/voicebox-server-${PLATFORM}.exe
|
|
echo "Built voicebox-server-${PLATFORM}.exe"
|
|
|
|
- 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 (works out of the box)
|
|
- **macOS (Intel)**: Download the `x64.dmg` file - uses PyTorch
|
|
- **Windows**: Download the `.msi` installer - requires downloading a TTS provider on first use
|
|
- **Linux**: Download the `.AppImage` or `.deb` package - requires downloading a TTS provider on first use
|
|
|
|
### TTS Providers
|
|
Windows and Linux users will be prompted to download a TTS provider on first launch:
|
|
- **Windows**: PyTorch CPU (~300MB) or PyTorch CUDA (~2.4GB for NVIDIA GPUs)
|
|
- **Linux**: PyTorch CUDA (~2.4GB) - requires NVIDIA GPU
|
|
|
|
The app includes automatic updates - future updates will be installed automatically.
|
|
releaseDraft: true
|
|
prerelease: false
|
|
args: ${{ matrix.args }}
|
|
includeUpdaterJson: true
|