From ec74bed58ba435b6a052830c32f0856901fc5796 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Tue, 11 Aug 2026 23:17:41 +0200 Subject: [PATCH] feat: publish Flatpak bundles --- .github/workflows/tauri-build.yml | 35 ++++++++++++++++++++++++++ README.md | 2 +- packaging/flatpak/moe.sable.client.yml | 12 ++++----- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tauri-build.yml b/.github/workflows/tauri-build.yml index da3db2f2a..1f2af14cb 100644 --- a/.github/workflows/tauri-build.yml +++ b/.github/workflows/tauri-build.yml @@ -732,6 +732,39 @@ jobs: SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} run: goreleaser ${{ steps.gr.outputs.args }} + - name: Install Flatpak build tools + shell: bash + run: | + sudo apt-get update + sudo apt-get install --yes flatpak flatpak-builder + sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo + sudo flatpak install --system --noninteractive flathub \ + org.freedesktop.Platform//25.08 \ + org.freedesktop.Sdk//25.08 \ + org.electronjs.Electron2.BaseApp//25.08 + + - name: Build Flatpak bundle + shell: bash + run: | + archive=".goreleaser-dist/Sable-${VERSION}-linux-x86_64.tar.gz" + [ -f "$archive" ] || { echo "Linux tarball not found: $archive" >&2; exit 1; } + + flatpak_dir="$RUNNER_TEMP/flatpak" + cp -a packaging/flatpak "$flatpak_dir" + cp "$archive" "$flatpak_dir/sable.tar.gz" + sed -i \ + -e 's|^ url: https://github.com/SableClient/Sable/releases/download/.*| path: sable.tar.gz|' \ + -e '/^ sha256: /d' \ + "$flatpak_dir/moe.sable.client.yml" + + flatpak-builder --force-clean --disable-cache \ + --repo "$RUNNER_TEMP/flatpak-repo" \ + "$RUNNER_TEMP/flatpak-build" \ + "$flatpak_dir/moe.sable.client.yml" + flatpak build-bundle "$RUNNER_TEMP/flatpak-repo" \ + ".goreleaser-dist/Sable-${VERSION}-linux-x86_64.flatpak" \ + moe.sable.client + - name: Build the AppImage shell: bash run: | @@ -756,6 +789,7 @@ jobs: .goreleaser-dist/*.deb .goreleaser-dist/*.rpm .goreleaser-dist/*.pkg.tar.zst + .goreleaser-dist/*.flatpak src-tauri/target/release/bundle/appimage/*.AppImage src-tauri/target/release/bundle/appimage/*.sig @@ -768,6 +802,7 @@ jobs: .goreleaser-dist/Sable-*.rpm \ .goreleaser-dist/Sable-*.pkg.tar.zst \ .goreleaser-dist/Sable-*-linux-x86_64.tar.gz \ + .goreleaser-dist/Sable-*-linux-x86_64.flatpak \ src-tauri/target/release/bundle/appimage/Sable-*-linux-x86_64.AppImage \ src-tauri/target/release/bundle/appimage/Sable-*-linux-x86_64.AppImage.sig; do [ -e "$f" ] || continue diff --git a/README.md b/README.md index 629d4c209..720df36e1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You can also download our desktop app for Windows and Linux from [releases](http   Snap Store   -Flathub +Download Flatpak On macOS, via our [Homebrew tap](https://github.com/SableClient/homebrew-sable): diff --git a/packaging/flatpak/moe.sable.client.yml b/packaging/flatpak/moe.sable.client.yml index dcb7e4f27..b99415be0 100644 --- a/packaging/flatpak/moe.sable.client.yml +++ b/packaging/flatpak/moe.sable.client.yml @@ -1,9 +1,7 @@ -# Flathub manifest. Submit this to https://github.com/flathub/flathub by opening -# a PR against the `new-pr` branch; Flathub builds it on their own infra. -# -# It consumes the release tarball GoReleaser publishes rather than building from -# source: Flathub builds have no network, and a source build would need Cargo and -# pnpm vendored plus the ~1GB CEF distribution declared as a source. +# Direct-distribution Flatpak manifest. CI replaces the archive source with the +# GoReleaser tarball built in the same release job, then uploads the `.flatpak` +# bundle to GitHub Releases. It is not suitable for Flathub, which requires a +# source build. id: moe.sable.client runtime: org.freedesktop.Platform @@ -58,7 +56,7 @@ modules: - type: archive # The GoReleaser archive has no wrapper directory. strip-components: 0 - # Seed values rewritten by x-checker-data below on each release. + # CI replaces these seed values with its local release archive. url: https://github.com/SableClient/Sable/releases/download/v1.21.0/Sable-1.21.0-linux-x86_64.tar.gz sha256: '0000000000000000000000000000000000000000000000000000000000000000' only-arches: [x86_64]