From fb649be7005c9218fe49f18f2f9ab49cd6387872 Mon Sep 17 00:00:00 2001 From: enki Date: Tue, 30 Jun 2026 20:55:29 -0700 Subject: [PATCH] release-codeberg: upload all installers for the current version Include deb/flatpak/pacman/tar.gz (not just the Windows exe) so the release page has every platform's download for the Linux update-ping to link to. Filter by version so leftover artifacts from older builds in dist/ aren't uploaded. Co-Authored-By: Claude Opus 4.8 --- apps/desktop/scripts/release-codeberg.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/desktop/scripts/release-codeberg.mjs b/apps/desktop/scripts/release-codeberg.mjs index b2425bdd15..4805085111 100644 --- a/apps/desktop/scripts/release-codeberg.mjs +++ b/apps/desktop/scripts/release-codeberg.mjs @@ -35,7 +35,11 @@ const distDir = join(here, "..", "dist"); const authHeaders = { Authorization: `token ${token}` }; // Channel files electron-updater needs + the installers themselves. -const WANTED = [/^latest\.yml$/, /^latest-linux\.yml$/, /\.exe$/, /\.exe\.blockmap$/, /\.AppImage$/, /\.AppImage\.blockmap$/]; +// electron-updater channel files (always the current build) — uploaded regardless. +const CHANNEL_FILES = new Set(["latest.yml", "latest-linux.yml"]); +// Installers for this version. The version filter avoids grabbing leftover +// artifacts from previous builds sitting in dist/. +const INSTALLER_EXT = /\.(exe|exe\.blockmap|deb|flatpak|pacman|tar\.gz)$/; async function api(path, init = {}) { const res = await fetch(`${API}${path}`, { ...init, headers: { ...authHeaders, ...(init.headers ?? {}) } }); @@ -61,7 +65,10 @@ async function getOrCreateRelease() { } async function main() { - const files = (await readdir(distDir)).filter((f) => WANTED.some((re) => re.test(f))); + const version = pkg.version; + const files = (await readdir(distDir)).filter( + (f) => CHANNEL_FILES.has(f) || (f.includes(version) && INSTALLER_EXT.test(f)), + ); if (files.length === 0) { console.error(`No matching artifacts in ${distDir}. Run \`pnpm run build\` first.`); process.exit(1);