diff options
| author | Brendan Allan <[email protected]> | 2026-02-20 22:33:21 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-20 22:33:21 +0800 |
| commit | ce17f9dd9451feae8b80f7d8054be5b72ce8d1fa (patch) | |
| tree | 5a5c6df3add43e6900c9caadce08c111eef1f8e4 /packages/console/app/src | |
| parent | 92ab4217c241f1fe75ac3d99bc455d0005383d3b (diff) | |
| download | opencode-ce17f9dd9451feae8b80f7d8054be5b72ce8d1fa.tar.gz opencode-ce17f9dd9451feae8b80f7d8054be5b72ce8d1fa.zip | |
desktop: publish betas to separate repo (#14376)
Diffstat (limited to 'packages/console/app/src')
| -rw-r--r-- | packages/console/app/src/routes/download/[channel]/[platform].ts (renamed from packages/console/app/src/routes/download/[platform].ts) | 23 | ||||
| -rw-r--r-- | packages/console/app/src/routes/download/index.tsx | 22 |
2 files changed, 24 insertions, 21 deletions
diff --git a/packages/console/app/src/routes/download/[platform].ts b/packages/console/app/src/routes/download/[channel]/[platform].ts index 2c30a8036..9a5284263 100644 --- a/packages/console/app/src/routes/download/[platform].ts +++ b/packages/console/app/src/routes/download/[channel]/[platform].ts @@ -1,5 +1,5 @@ -import { APIEvent } from "@solidjs/start" -import { DownloadPlatform } from "./types" +import type { APIEvent } from "@solidjs/start" +import type { DownloadPlatform } from "../types" const assetNames: Record<string, string> = { "darwin-aarch64-dmg": "opencode-desktop-darwin-aarch64.dmg", @@ -17,17 +17,20 @@ const downloadNames: Record<string, string> = { "windows-x64-nsis": "OpenCode Desktop Installer.exe", } satisfies { [K in DownloadPlatform]?: string } -export async function GET({ params: { platform } }: APIEvent) { +export async function GET({ params: { platform, channel } }: APIEvent) { const assetName = assetNames[platform] if (!assetName) return new Response("Not Found", { status: 404 }) - const resp = await fetch(`https://github.com/anomalyco/opencode/releases/latest/download/${assetName}`, { - cf: { - // in case gh releases has rate limits - cacheTtl: 60 * 5, - cacheEverything: true, - }, - } as any) + const resp = await fetch( + `https://github.com/anomalyco/${channel === "stable" ? "opencode" : "opencode-beta"}/releases/latest/download/${assetName}`, + { + cf: { + // in case gh releases has rate limits + cacheTtl: 60 * 5, + cacheEverything: true, + }, + } as any, + ) const downloadName = downloadNames[platform] diff --git a/packages/console/app/src/routes/download/index.tsx b/packages/console/app/src/routes/download/index.tsx index e5e4e9750..0278d8622 100644 --- a/packages/console/app/src/routes/download/index.tsx +++ b/packages/console/app/src/routes/download/index.tsx @@ -1,18 +1,18 @@ import "./index.css" -import { Title, Meta } from "@solidjs/meta" -import { A, createAsync, query } from "@solidjs/router" -import { Header } from "~/component/header" -import { Footer } from "~/component/footer" -import { IconCopy, IconCheck } from "~/component/icon" +import { Meta, Title } from "@solidjs/meta" +import { A } from "@solidjs/router" +import { createSignal, type JSX, onMount, Show } from "solid-js" import { Faq } from "~/component/faq" -import desktopAppIcon from "../../asset/lander/opencode-desktop-icon.png" +import { Footer } from "~/component/footer" +import { Header } from "~/component/header" +import { IconCheck, IconCopy } from "~/component/icon" import { Legal } from "~/component/legal" +import { LocaleLinks } from "~/component/locale-links" import { config } from "~/config" -import { createSignal, onMount, Show, JSX } from "solid-js" -import { DownloadPlatform } from "./types" import { useI18n } from "~/context/i18n" import { useLanguage } from "~/context/language" -import { LocaleLinks } from "~/component/locale-links" +import desktopAppIcon from "../../asset/lander/opencode-desktop-icon.png" +import type { DownloadPlatform } from "./types" type OS = "macOS" | "Windows" | "Linux" | null @@ -40,8 +40,8 @@ function getDownloadPlatform(os: OS): DownloadPlatform { } } -function getDownloadHref(platform: DownloadPlatform) { - return `/download/${platform}` +function getDownloadHref(platform: DownloadPlatform, channel: "stable" | "beta" = "stable") { + return `/download/${channel}/${platform}` } function IconDownload(props: JSX.SvgSVGAttributes<SVGSVGElement>) { |
