From e64c19f1af672e4f1737d81fbe83906de3547f03 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 11 May 2026 01:41:32 -0700 Subject: [PATCH] Alias stable releases to the router domain (#2636) --- .github/workflows/release.yml | 10 ++++++++++ apps/web/src/branding.test.ts | 2 ++ apps/web/src/branding.ts | 12 ++++++----- .../components/settings/SettingsPanels.tsx | 2 +- apps/web/vercel.ts | 11 +++++++++- docs/release.md | 20 ++++++++++--------- 6 files changed, 41 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35bcaaf3129ccfca8cbfb1b4eb2ec901b029c618..367ce867dc3bab09eed14051126358496f289976 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -625,6 +625,9 @@ jobs: router_url="${T3CODE_WEB_ROUTER_URL:-https://app.t3.codes}" latest_domain="${T3CODE_WEB_LATEST_DOMAIN:-latest.app.t3.codes}" nightly_domain="${T3CODE_WEB_NIGHTLY_DOMAIN:-nightly.app.t3.codes}" + router_domain="${router_url#http://}" + router_domain="${router_domain#https://}" + router_domain="${router_domain%%/*}" if [[ "${{ needs.preflight.outputs.release_channel }}" == "stable" ]]; then channel_domain="$latest_domain" @@ -655,6 +658,13 @@ jobs: --token "$VERCEL_TOKEN" \ "${vercel_scope_args[@]}" + if [[ "$channel_name" == "latest" && -n "$router_domain" && "$router_domain" != "$channel_domain" ]]; then + echo "Aliasing $deployment_url to router domain $router_domain." + bunx vercel@53.1.1 alias set "$deployment_url" "$router_domain" \ + --token "$VERCEL_TOKEN" \ + "${vercel_scope_args[@]}" + fi + finalize: name: Finalize release if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'stable' }} diff --git a/apps/web/src/branding.test.ts b/apps/web/src/branding.test.ts index 764b63cdb4b9732f64c8658f7dfc2336017e17c2..096fc16ecc0bcc27f2817c5376fa2feb66736ac2 100644 --- a/apps/web/src/branding.test.ts +++ b/apps/web/src/branding.test.ts @@ -42,6 +42,8 @@ describe("branding", () => { expect(branding.HOSTED_APP_CHANNEL).toBe("nightly"); expect(branding.HOSTED_APP_CHANNEL_LABEL).toBe("Nightly"); + expect(branding.APP_STAGE_LABEL).toBe("Nightly"); + expect(branding.APP_DISPLAY_NAME).toBe("T3 Code (Nightly)"); }); it("ignores unknown hosted app channels", async () => { diff --git a/apps/web/src/branding.ts b/apps/web/src/branding.ts index d8018f0d9243bb6340e6b12ed80809bbca38b107..5c1309ca06b0bb0c0c5b6ff196b6cd1e78dc6c7d 100644 --- a/apps/web/src/branding.ts +++ b/apps/web/src/branding.ts @@ -11,13 +11,15 @@ function readInjectedDesktopAppBranding(): DesktopAppBranding | null { const injectedDesktopAppBranding = readInjectedDesktopAppBranding(); const hostedAppChannel = import.meta.env.VITE_HOSTED_APP_CHANNEL?.trim().toLowerCase(); +export const HOSTED_APP_CHANNEL = + hostedAppChannel === "latest" || hostedAppChannel === "nightly" ? hostedAppChannel : null; +export const HOSTED_APP_CHANNEL_LABEL = + HOSTED_APP_CHANNEL === "nightly" ? "Nightly" : HOSTED_APP_CHANNEL === "latest" ? "Latest" : null; export const APP_BASE_NAME = injectedDesktopAppBranding?.baseName ?? "T3 Code"; export const APP_STAGE_LABEL = - injectedDesktopAppBranding?.stageLabel ?? (import.meta.env.DEV ? "Dev" : "Alpha"); + injectedDesktopAppBranding?.stageLabel ?? + HOSTED_APP_CHANNEL_LABEL ?? + (import.meta.env.DEV ? "Dev" : "Alpha"); export const APP_DISPLAY_NAME = injectedDesktopAppBranding?.displayName ?? `${APP_BASE_NAME} (${APP_STAGE_LABEL})`; export const APP_VERSION = import.meta.env.APP_VERSION || "0.0.0"; -export const HOSTED_APP_CHANNEL = - hostedAppChannel === "latest" || hostedAppChannel === "nightly" ? hostedAppChannel : null; -export const HOSTED_APP_CHANNEL_LABEL = - HOSTED_APP_CHANNEL === "nightly" ? "Nightly" : HOSTED_APP_CHANNEL === "latest" ? "Latest" : null; diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx index 505be5c73f8b1d20ba4a1bd918d591796a4b62c2..e7f21da48092fef3913dc220ab5a0f9804f02e98 100644 --- a/apps/web/src/components/settings/SettingsPanels.tsx +++ b/apps/web/src/components/settings/SettingsPanels.tsx @@ -892,7 +892,7 @@ export function GeneralSettingsPanel() { - {isElectron ? ( + {isElectron || HOSTED_APP_CHANNEL ? ( ) : (