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 | |
| parent | 92ab4217c241f1fe75ac3d99bc455d0005383d3b (diff) | |
| download | opencode-ce17f9dd9451feae8b80f7d8054be5b72ce8d1fa.tar.gz opencode-ce17f9dd9451feae8b80f7d8054be5b72ce8d1fa.zip | |
desktop: publish betas to separate repo (#14376)
Diffstat (limited to 'packages')
| -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 | ||||
| -rw-r--r-- | packages/desktop/src-tauri/tauri.beta.conf.json | 21 | ||||
| -rwxr-xr-x | packages/opencode/script/build.ts | 18 |
4 files changed, 56 insertions, 28 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>) { diff --git a/packages/desktop/src-tauri/tauri.beta.conf.json b/packages/desktop/src-tauri/tauri.beta.conf.json new file mode 100644 index 000000000..5207c73fc --- /dev/null +++ b/packages/desktop/src-tauri/tauri.beta.conf.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://schema.tauri.app/config/2", + "productName": "OpenCode Beta", + "identifier": "ai.opencode.desktop.beta", + "bundle": { + "createUpdaterArtifacts": true, + "linux": { + "rpm": { + "compression": { + "type": "none" + } + } + } + }, + "plugins": { + "updater": { + "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEYwMDM5Nzg5OUMzOUExMDQKUldRRW9UbWNpWmNEOENYT01CV0lhOXR1UFhpaXJsK1Z3aU9lZnNtNzE0TDROWVMwVW9XQnFOelkK", + "endpoints": ["https://github.com/anomalyco/opencode-beta/releases/latest/download/latest.json"] + } + } +} diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index ddb476991..34e80d71a 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -1,10 +1,10 @@ #!/usr/bin/env bun -import solidPlugin from "../node_modules/@opentui/solid/scripts/solid-plugin" -import path from "path" -import fs from "fs" import { $ } from "bun" +import fs from "fs" +import path from "path" import { fileURLToPath } from "url" +import solidPlugin from "../node_modules/@opentui/solid/scripts/solid-plugin" const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) @@ -12,8 +12,9 @@ const dir = path.resolve(__dirname, "..") process.chdir(dir) -import pkg from "../package.json" import { Script } from "@opencode-ai/script" +import pkg from "../package.json" + const modelsUrl = process.env.OPENCODE_MODELS_URL || "https://models.dev" // Fetch and generate models.dev snapshot const modelsData = process.env.MODELS_DEV_API_JSON @@ -26,7 +27,11 @@ await Bun.write( console.log("Generated models-snapshot.ts") // Load migrations from migration directories -const migrationDirs = (await fs.promises.readdir(path.join(dir, "migration"), { withFileTypes: true })) +const migrationDirs = ( + await fs.promises.readdir(path.join(dir, "migration"), { + withFileTypes: true, + }) +) .filter((entry) => entry.isDirectory() && /^\d{4}\d{2}\d{2}\d{2}\d{2}\d{2}/.test(entry.name)) .map((entry) => entry.name) .sort() @@ -171,7 +176,6 @@ for (const item of targets) { compile: { autoloadBunfig: false, autoloadDotenv: false, - //@ts-ignore (bun types aren't up to date) autoloadTsconfig: true, autoloadPackageJson: true, target: name.replace(pkg.name, "bun") as any, @@ -214,7 +218,7 @@ if (Script.release) { await $`zip -r ../../${key}.zip *`.cwd(`dist/${key}/bin`) } } - await $`gh release upload v${Script.version} ./dist/*.zip ./dist/*.tar.gz --clobber` + await $`gh release upload v${Script.version} ./dist/*.zip ./dist/*.tar.gz --clobber --repo ${process.env.GH_REPO}` } export { binaries } |
