Move releases + auto-update feed from Codeberg to git.utn.lol

Codeberg is now mirror-only. Feed URL -> git.utn.lol/enki/blap rolling
"updates" release; release-codeberg.mjs renamed release-forge.mjs with
git.utn.lol defaults (FORGE_* env overrides unchanged).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 12:50:02 -07:00
parent a264351fea
commit 6a83022a24
3 changed files with 23 additions and 22 deletions
+15 -15
View File
@@ -1,14 +1,14 @@
#!/usr/bin/env node
/*
* Upload built desktop artifacts to a Gitea/Forgejo release (Codeberg IS Forgejo, and
* git.utn.lol is Gitea — same API) so electron-updater (generic provider ->
* .../releases/latest/download/) can find them.
* Upload built desktop artifacts to a Gitea/Forgejo release (git.utn.lol is Gitea,
* Codeberg is Forgejo — same API) so electron-updater (generic provider) can find them.
*
* Run AFTER `pnpm run build` from apps/desktop. Defaults target Codeberg:
* CODEBERG_TOKEN=xxxx node scripts/release-codeberg.mjs [tag]
* Target a different forge (e.g. the git.utn.lol Gitea) via env overrides:
* FORGE_API=https://git.utn.lol/api/v1 FORGE_OWNER=enki FORGE_REPO=blap \
* FORGE_TOKEN=xxxx node scripts/release-codeberg.mjs [tag]
* Run AFTER `pnpm run build` from apps/desktop. Defaults target git.utn.lol (the
* primary repo — Codeberg is a mirror only and no longer hosts releases):
* FORGE_TOKEN=xxxx node scripts/release-forge.mjs [tag]
* Target a different forge (e.g. Codeberg) via env overrides:
* FORGE_API=https://codeberg.org/api/v1 FORGE_OWNER=Enkisu FORGE_REPO=Blap \
* FORGE_TOKEN=xxxx node scripts/release-forge.mjs [tag]
*
* - tag defaults to "v<version>" from package.json.
* - Uploads latest.yml / latest-linux.yml + installers + blockmaps.
@@ -22,9 +22,9 @@ import { execFileSync } from "node:child_process";
import { basename, join } from "node:path";
import { fileURLToPath } from "node:url";
const OWNER = process.env.FORGE_OWNER ?? "Enkisu";
const REPO = process.env.FORGE_REPO ?? "Blap";
const API = process.env.FORGE_API ?? "https://codeberg.org/api/v1";
const OWNER = process.env.FORGE_OWNER ?? "enki";
const REPO = process.env.FORGE_REPO ?? "blap";
const API = process.env.FORGE_API ?? "https://git.utn.lol/api/v1";
const token = process.env.FORGE_TOKEN ?? process.env.CODEBERG_TOKEN;
if (!token) {
@@ -57,10 +57,10 @@ async function api(path, init = {}) {
async function getOrCreateRelease(tagName, { prerelease = false } = {}) {
let res = await api(`/repos/${OWNER}/${REPO}/releases/tags/${encodeURIComponent(tagName)}`);
if (res.status === 404) {
// The tag MUST already exist on the forge, arriving via the git.utn.lol
// push-mirror. If we let the release API auto-create it, the next mirror
// sync prunes the forge-only tag and Forgejo silently demotes the release
// to a hidden draft (this ate v1.0.2's release page overnight).
// The tag MUST already exist on the forge (git push origin <tag> first).
// On a mirror target, letting the release API auto-create the tag means the
// next mirror sync prunes it and the release silently demotes to a hidden
// draft (this ate v1.0.2's Codeberg release page overnight).
const tagRes = await api(`/repos/${OWNER}/${REPO}/tags/${encodeURIComponent(tagName)}`);
if (tagRes.status === 404) {
throw new Error(