diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index c863b0f..31d09fc 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -80,6 +80,15 @@ jobs: PLATFORM: ${{ matrix.os }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Install Flatpak Tooling and Runtimes + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y flatpak flatpak-builder + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + flatpak install -y --user flathub org.freedesktop.Platform//25.08 org.freedesktop.Sdk//25.08 + flatpak install -y --user flathub org.electronjs.Electron2.BaseApp//stable + - name: Publish Linux arm64 if: matrix.os == 'ubuntu-latest' run: pnpm run publish --arch=arm64 diff --git a/forge.config.ts b/forge.config.ts index 4a0ced6..732fca2 100644 --- a/forge.config.ts +++ b/forge.config.ts @@ -38,6 +38,63 @@ const makers: ForgeConfig["makers"] = [ copyright: "Copyright (C) 2025 Revolt Platforms LTD", }), new MakerZIP({}), + new MakerFlatpak({ + options: { + id: "chat.stoat.StoatDesktop", + description: STRINGS.description, + productName: STRINGS.name, + productDescription: STRINGS.description, + runtimeVersion: "25.08", + icon: { + "16x16": `${ASSET_DIR}/hicolor/16x16.png`, + "32x32": `${ASSET_DIR}/hicolor/32x32.png`, + "64x64": `${ASSET_DIR}/hicolor/64x64.png`, + "128x128": `${ASSET_DIR}/hicolor/128x128.png`, + "256x256": `${ASSET_DIR}/hicolor/256x256.png`, + "512x512": `${ASSET_DIR}/hicolor/512x512.png`, + } as unknown, + categories: ["Network"], + modules: [ + // use the latest zypak -- Electron sandboxing for Flatpak + { + name: "zypak", + sources: [ + { + type: "git", + url: "https://github.com/refi64/zypak", + tag: "v2025.09", + }, + ], + }, + ], + finishArgs: [ + // default arguments found by running + // DEBUG=electron-installer-flatpak* pnpm make + "--socket=fallback-x11", + "--socket=wayland", + "--share=ipc", + "--share=network", + "--device=dri", + "--device=all", + "--socket=pulseaudio", + "--filesystem=xdg-run/pipewire-0", + "--filesystem=xdg-videos:ro", + "--filesystem=xdg-pictures:ro", + "--filesystem=xdg-download", + "--filesystem=xdg-run/speech-dispatcher", + "--talk-name=org.freedesktop.ScreenSaver", + "--talk-name=org.freedesktop.Notifications", + "--talk-name=org.kde.StatusNotifierWatcher", + "--talk-name=com.canonical.AppMenu.Registrar", + "--talk-name=com.canonical.indicator.application", + "--talk-name=com.canonical.Unity", + "--env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons", + "--env=ELECTRON_TRASH=gio", + "--env=TMPDIR=xdg-run/app/chat.stoat.StoatDesktop", + ], + files: [], + } as MakerFlatpakOptionsConfig, + }), ]; // skip these makers in CI/CD @@ -50,65 +107,6 @@ if (!process.env.PLATFORM) { packageExecutable: `app\\${STRINGS.execName}.exe`, publisher: "CN=B040CC7E-0016-4AF5-957F-F8977A6CFA3B", }), - // flatpak publishing should occur through flathub repos. - // this is just for testing purposes - new MakerFlatpak({ - options: { - id: "chat.stoat.stoat-desktop", - description: STRINGS.description, - productName: STRINGS.name, - productDescription: STRINGS.description, - runtimeVersion: "25.08", - icon: { - "16x16": `${ASSET_DIR}/hicolor/16x16.png`, - "32x32": `${ASSET_DIR}/hicolor/32x32.png`, - "64x64": `${ASSET_DIR}/hicolor/64x64.png`, - "128x128": `${ASSET_DIR}/hicolor/128x128.png`, - "256x256": `${ASSET_DIR}/hicolor/256x256.png`, - "512x512": `${ASSET_DIR}/hicolor/512x512.png`, - } as unknown, - categories: ["Network"], - modules: [ - // use the latest zypak -- Electron sandboxing for Flatpak - { - name: "zypak", - sources: [ - { - type: "git", - url: "https://github.com/refi64/zypak", - tag: "v2025.09", - }, - ], - }, - ], - finishArgs: [ - // default arguments found by running - // DEBUG=electron-installer-flatpak* pnpm make - "--socket=fallback-x11", - "--socket=wayland", - "--share=ipc", - "--share=network", - "--device=dri", - "--device=all", - "--socket=pulseaudio", - "--filesystem=home", - "--filesystem=xdg-run/pipewire-0", - "--filesystem=xdg-videos:ro", - "--filesystem=xdg-pictures:ro", - "--filesystem=xdg-run/speech-dispatcher", - "--talk-name=org.freedesktop.ScreenSaver", - "--talk-name=org.freedesktop.Notifications", - "--talk-name=org.kde.StatusNotifierWatcher", - "--talk-name=com.canonical.AppMenu.Registrar", - "--talk-name=com.canonical.indicator.application", - "--talk-name=com.canonical.Unity", - "--env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons", - "--env=ELECTRON_TRASH=gio", - "--env=TMPDIR=xdg-run/app/chat.stoat.stoat-desktop", - ], - files: [], - } as MakerFlatpakOptionsConfig, - }), // testing purposes new MakerDeb({ options: { diff --git a/package.json b/package.json index d0f7837..8c113d7 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "make": "electron-forge make", "publish": "electron-forge publish", "lint": "eslint --ext .ts,.tsx .", - "install:flatpak": "flatpak --user install out/make/flatpak/x86_64/chat.stoat.stoat-desktop_stable_x86_64.flatpak", - "run:flatpak": "flatpak run --socket=session-bus chat.stoat.stoat-desktop", + "install:flatpak": "flatpak --user install out/make/flatpak/x86_64/chat.stoat.StoatDesktop_stable_x86_64.flatpak", + "run:flatpak": "flatpak run --socket=session-bus chat.stoat.StoatDesktop", "run:nix": "/usr/bin/env electron-nix ." }, "keywords": [], diff --git a/src/native/badges.ts b/src/native/badges.ts index 3eae4c7..4f2935b 100644 --- a/src/native/badges.ts +++ b/src/native/badges.ts @@ -47,7 +47,7 @@ export async function setBadgeCount(count: number) { signature: "sa{sv}", body: [ process.env.container === "1" - ? "application://chat.stoat.stoat-desktop.desktop" // flatpak handling + ? "application://chat.stoat.StoatDesktop.desktop" // flatpak handling : "application://stoat-desktop.desktop", [ ["count", ["x", Math.min(count, 0)]],