diff --git a/README.md b/README.md index 3cbd2bc1..d7943e86 100644 --- a/README.md +++ b/README.md @@ -78,11 +78,13 @@ Voicebox is a **local-first voice cloning studio** — a free and open-source al | Platform | Download | |----------|----------| -| macOS (Apple Silicon) | [Download DMG](https://github.com/jamiepine/voicebox/releases/latest/download/Voicebox_aarch64.dmg) | -| macOS (Intel) | [Download DMG](https://github.com/jamiepine/voicebox/releases/latest/download/Voicebox_x64.dmg) | -| Windows | [Latest Release](https://github.com/jamiepine/voicebox/releases/latest) | +| macOS (Apple Silicon) | [Download DMG](https://voicebox.sh/download/mac-arm) | +| macOS (Intel) | [Download DMG](https://voicebox.sh/download/mac-intel) | +| Windows | [Download MSI](https://voicebox.sh/download/windows) | | Docker | `docker compose up` | +> **[View all binaries →](https://github.com/jamiepine/voicebox/releases/latest)** + > **Linux** — Pre-built binaries are not yet available. See [voicebox.sh/linux-install](https://voicebox.sh/linux-install) for build-from-source instructions. --- diff --git a/landing/src/app/download/[platform]/route.ts b/landing/src/app/download/[platform]/route.ts new file mode 100644 index 00000000..af76c315 --- /dev/null +++ b/landing/src/app/download/[platform]/route.ts @@ -0,0 +1,42 @@ +import { type NextRequest, NextResponse } from 'next/server'; +import { getLatestRelease } from '@/lib/releases'; + +export const dynamic = 'force-dynamic'; + +const PLATFORM_MAP: Record< + string, + keyof Awaited>['downloadLinks'] +> = { + 'mac-arm': 'macArm', + 'mac-intel': 'macIntel', + windows: 'windows', + linux: 'linux', +}; + +export async function GET( + _request: NextRequest, + { params }: { params: Promise<{ platform: string }> }, +) { + const { platform } = await params; + const key = PLATFORM_MAP[platform]; + + if (!key) { + return NextResponse.json( + { error: `Unknown platform: ${platform}. Use: ${Object.keys(PLATFORM_MAP).join(', ')}` }, + { status: 404 }, + ); + } + + try { + const release = await getLatestRelease(); + const url = release.downloadLinks[key]; + + if (!url) { + return NextResponse.json({ error: `No download available for ${platform}` }, { status: 404 }); + } + + return NextResponse.redirect(url); + } catch { + return NextResponse.redirect(`https://github.com/jamiepine/voicebox/releases/latest`); + } +}