Blap 1.0.1: desktop screen-share audio + release tooling
- Desktop: capture system audio with the shared screen via Electron "loopback" audio, gated to Windows/macOS (Electron doesn't support loopback on Linux). Fixes screen shares having no audio for Windows users. - release script: make it host-agnostic (FORGE_API/OWNER/REPO/TOKEN env) so it can publish to the git.utn.lol Gitea as well as Codeberg. Defaults unchanged. - Bump version to 1.0.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"productName": "Element",
|
||||
"main": "lib/electron-main.js",
|
||||
"exports": "./lib/electron-main.js",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "Element: the future of secure communication",
|
||||
"author": {
|
||||
"name": "Element",
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
#!/usr/bin/env node
|
||||
/*
|
||||
* Upload built desktop artifacts to a Codeberg (Forgejo) release so electron-updater
|
||||
* (generic provider -> .../releases/latest/download/) can find them.
|
||||
* 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.
|
||||
*
|
||||
* Run AFTER `pnpm run build` from apps/desktop:
|
||||
* 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]
|
||||
*
|
||||
* - owner/repo are fixed to Enkisu/Blap (must match the electron-builder publish url).
|
||||
* - tag defaults to "v<version>" from package.json.
|
||||
* - Uploads latest.yml / latest-linux.yml + installers (.exe/.AppImage) + blockmaps.
|
||||
* - Uploads latest.yml / latest-linux.yml + installers + blockmaps.
|
||||
* - Replaces assets of the same name so re-runs are idempotent.
|
||||
* - The release is created non-draft / non-prerelease so Forgejo's "latest" alias
|
||||
* resolves to it (that's what the updater feed URL points at).
|
||||
* - The release is created non-draft / non-prerelease so the "latest" alias resolves
|
||||
* to it (that's what the updater feed URL points at).
|
||||
*/
|
||||
import { readFile, readdir } from "node:fs/promises";
|
||||
import { statSync } from "node:fs";
|
||||
@@ -19,13 +22,13 @@ import { execFileSync } from "node:child_process";
|
||||
import { basename, join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const OWNER = "Enkisu";
|
||||
const REPO = "Blap";
|
||||
const API = "https://codeberg.org/api/v1";
|
||||
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 token = process.env.CODEBERG_TOKEN;
|
||||
const token = process.env.FORGE_TOKEN ?? process.env.CODEBERG_TOKEN;
|
||||
if (!token) {
|
||||
console.error("CODEBERG_TOKEN env var is required (a Codeberg access token with repo scope).");
|
||||
console.error("A token is required: set FORGE_TOKEN (or CODEBERG_TOKEN) to an access token with repo scope.");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -114,7 +117,8 @@ async function main() {
|
||||
console.log("done");
|
||||
}
|
||||
|
||||
console.log(`\nDone. Updater feed: https://codeberg.org/${OWNER}/${REPO}/releases/latest/download/latest.yml`);
|
||||
const webBase = API.replace(/\/api\/v1\/?$/, "");
|
||||
console.log(`\nDone. Updater feed: ${webBase}/${OWNER}/${REPO}/releases/latest/download/latest.yml`);
|
||||
}
|
||||
|
||||
await main();
|
||||
|
||||
@@ -145,7 +145,15 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
|
||||
}));
|
||||
break;
|
||||
case "callDisplayMediaCallback":
|
||||
await getDisplayMediaCallback()?.({ video: args[0] });
|
||||
// Blap: capture system audio alongside the shared screen. Electron's
|
||||
// "loopback" audio is supported on Windows and macOS only (not Linux), so we
|
||||
// gate on platform — passing it on Linux would fail the whole share.
|
||||
await getDisplayMediaCallback()?.({
|
||||
video: args[0],
|
||||
...(process.platform === "win32" || process.platform === "darwin"
|
||||
? { audio: "loopback" as const }
|
||||
: {}),
|
||||
});
|
||||
setDisplayMediaCallback(null);
|
||||
ret = null;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user