From 9c86a410ea7781b215a45317c9da0795eb205b25 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sun, 21 Jun 2026 01:14:00 +0700 Subject: [PATCH] fix(website): support stable AppImage asset names --- packages/website/src/downloads.tsx | 5 +++-- packages/website/src/release.ts | 18 +++++++++++++++++- packages/website/src/routes/__root.tsx | 2 ++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/website/src/downloads.tsx b/packages/website/src/downloads.tsx index 5f6bcbb65..3a1908512 100644 --- a/packages/website/src/downloads.tsx +++ b/packages/website/src/downloads.tsx @@ -6,17 +6,18 @@ export function releaseBase(version: string) { export interface ReleaseAssetInfo { version: string; + linuxAppImageAsset: string; windowsX64Asset: string | null; windowsArm64Asset: string | null; } export function downloadUrls(release: ReleaseAssetInfo) { - const { version, windowsX64Asset, windowsArm64Asset } = release; + const { version, linuxAppImageAsset, windowsX64Asset, windowsArm64Asset } = release; const base = releaseBase(version); return { macAppleSilicon: `${base}/Paseo-${version}-arm64.dmg`, macIntel: `${base}/Paseo-${version}-x64.dmg`, - linuxAppImage: `${base}/Paseo-${version}-x86_64.AppImage`, + linuxAppImage: `${base}/${linuxAppImageAsset}`, linuxDeb: `${base}/Paseo-${version}-amd64.deb`, linuxRpm: `${base}/Paseo-${version}-x86_64.rpm`, windowsExeX64: `${base}/${windowsX64Asset ?? `Paseo-Setup-${version}.exe`}`, diff --git a/packages/website/src/release.ts b/packages/website/src/release.ts index 1b8566453..815e54ed1 100644 --- a/packages/website/src/release.ts +++ b/packages/website/src/release.ts @@ -12,9 +12,12 @@ interface GitHubRelease { draft: boolean; } +const LINUX_APPIMAGE_ASSET_PATTERN = + /^Paseo-(?:\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)-)?x86_64\.AppImage$/; + const REQUIRED_ASSET_PATTERNS = [ /Paseo-.*-arm64\.dmg$/, // Mac Apple Silicon - /Paseo-.*-x86_64\.AppImage$/, // Linux AppImage + LINUX_APPIMAGE_ASSET_PATTERN, // Linux AppImage /Paseo-Setup-.*\.exe$/, // Windows (any arch) ]; @@ -39,12 +42,17 @@ function pickWindowsAssets(assets: GitHubAsset[]) { }; } +function pickLinuxAppImageAsset(assets: GitHubAsset[]) { + return assets.find((a) => LINUX_APPIMAGE_ASSET_PATTERN.test(a.name))?.name ?? null; +} + function versionFromTag(tag: string): string { return tag.replace(/^v/, ""); } interface ReleaseInfo { version: string; + linuxAppImageAsset: string; windowsX64Asset: string | null; windowsArm64Asset: string | null; } @@ -70,8 +78,11 @@ async function fetchLatestReadyRelease(): Promise { const ready = releases.find((r) => !r.prerelease && !r.draft && hasRequiredAssets(r)); if (!ready) throw new Error("no ready GitHub release found"); const win = pickWindowsAssets(ready.assets); + const linuxAppImageAsset = pickLinuxAppImageAsset(ready.assets); + if (!linuxAppImageAsset) throw new Error("ready release missing Linux AppImage asset"); return { version: versionFromTag(ready.tag_name), + linuxAppImageAsset, windowsX64Asset: win.x64, windowsArm64Asset: win.arm64, }; @@ -83,6 +94,11 @@ function isReleaseInfo(value: unknown): value is ReleaseInfo { return ( typeof record.version === "string" && /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(record.version) && + typeof record.linuxAppImageAsset === "string" && + (record.linuxAppImageAsset === "Paseo-x86_64.AppImage" || + new RegExp(`^Paseo-${record.version.replaceAll(".", "\\.")}-x86_64\\.AppImage$`).test( + record.linuxAppImageAsset, + )) && (typeof record.windowsX64Asset === "string" || record.windowsX64Asset === null) && (typeof record.windowsArm64Asset === "string" || record.windowsArm64Asset === null) && (record.windowsX64Asset === null || diff --git a/packages/website/src/routes/__root.tsx b/packages/website/src/routes/__root.tsx index 845a21100..664ddd453 100644 --- a/packages/website/src/routes/__root.tsx +++ b/packages/website/src/routes/__root.tsx @@ -6,6 +6,7 @@ import { getStarCount } from "~/stars"; interface ReleaseContext { version: string; + linuxAppImageAsset: string; windowsX64Asset: string | null; windowsArm64Asset: string | null; } @@ -16,6 +17,7 @@ interface StarsContext { const ReleaseCtx = createContext({ version: "", + linuxAppImageAsset: "", windowsX64Asset: null, windowsArm64Asset: null, });