diff --git a/src/components/Sponsors.astro b/src/components/Sponsors.astro index 92a44e8..b16289b 100644 --- a/src/components/Sponsors.astro +++ b/src/components/Sponsors.astro @@ -1,5 +1,4 @@ --- -import h3 from '~/components/Description.astro' import { getLocale, getUI } from '~/utils/i18n' const locale = getLocale(Astro) diff --git a/src/components/download/PlatformDownload.astro b/src/components/download/PlatformDownload.astro index c974fa5..df96ae6 100644 --- a/src/components/download/PlatformDownload.astro +++ b/src/components/download/PlatformDownload.astro @@ -5,7 +5,6 @@ import Button from '../Button.astro' interface ReleaseInfo { label?: string link: string - checksum?: string } interface PlatformReleases { diff --git a/src/components/download/release-data.ts b/src/components/download/release-data.ts index 58ab556..0eb4466 100644 --- a/src/components/download/release-data.ts +++ b/src/components/download/release-data.ts @@ -59,3 +59,55 @@ export function getReleasesWithChecksums(locale: string) { } } } + +/** + * Returns the releases object, without checksums. + * @param locale The locale to use for labels + */ +export function getReleases(locale: string) { + const { + routes: { + download: { + links: { macos, windows, linux }, + }, + }, + } = getUI(locale) + return { + macos: { + universal: { + link: 'https://github.com/zen-browser/desktop/releases/latest/download/zen.macos-universal.dmg', + label: macos.universal, + }, + }, + windows: { + x86_64: { + link: 'https://github.com/zen-browser/desktop/releases/latest/download/zen.installer.exe', + label: windows['64bit'], + }, + arm64: { + link: 'https://github.com/zen-browser/desktop/releases/latest/download/zen.installer-arm64.exe', + label: windows.ARM64, + }, + }, + linux: { + x86_64: { + tarball: { + link: 'https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-x86_64.tar.xz', + label: linux.x86_64, + }, + }, + aarch64: { + tarball: { + link: 'https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-aarch64.tar.xz', + label: linux.aarch64, + }, + }, + flathub: { + all: { + link: 'https://flathub.org/apps/app.zen_browser.zen', + label: linux.flathub, + }, + }, + }, + } +} diff --git a/src/pages/[...locale]/download.astro b/src/pages/[...locale]/download.astro index 1ed3fb0..e1ac6e9 100644 --- a/src/pages/[...locale]/download.astro +++ b/src/pages/[...locale]/download.astro @@ -2,9 +2,8 @@ import Description from '~/components/Description.astro' import DownloadScript from '~/components/download/DownloadScript.astro' import PlatformDownload from '~/components/download/PlatformDownload.astro' -import { getReleasesWithChecksums } from '~/components/download/release-data' +import { getReleases } from '~/components/download/release-data' import Layout from '~/layouts/Layout.astro' -import { getChecksums } from '~/utils/githubChecksums' import { getLocale, getUI } from '~/utils/i18n' import { icon, library } from '@fortawesome/fontawesome-svg-core' @@ -27,8 +26,7 @@ const windowsIcon = icon({ prefix: 'fab', iconName: 'windows' }) const linuxIcon = icon({ prefix: 'fab', iconName: 'linux' }) const appleIcon = icon({ prefix: 'fab', iconName: 'apple' }) -const checksums = await getChecksums() -const releases = getReleasesWithChecksums(locale)(checksums) +const releases = getReleases(locale) const platformDescriptions = download.platformDescriptions --- diff --git a/src/utils/githubChecksums.ts b/src/utils/githubChecksums.ts index bf6243e..718b941 100644 --- a/src/utils/githubChecksums.ts +++ b/src/utils/githubChecksums.ts @@ -18,7 +18,6 @@ export async function getChecksums() { Accept: 'application/vnd.github+json', 'X-GitHub-Api-Version': '2022-11-28', 'User-Agent': 'zen-browser-checksum-fetcher', - ...(process.env.GITHUB_TOKEN ? { Authorization: `Bearer ${process.env.GITHUB_TOKEN}` } : {}), }, }) if (!res.ok) throw new Error(`Failed to fetch GitHub release: ${res.statusText}`)