Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/tauri-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1199,3 +1199,88 @@ jobs:
git commit -m "sable ${VERSION}"
# The tap may still be an empty repository on the first run.
git push origin HEAD:refs/heads/main

distribute-flathub:
name: Open the Flathub update PR
needs: [setup-release, linux]
runs-on: ubuntu-latest
timeout-minutes: 15
if: ${{ needs.setup-release.outputs.nightly != 'true' }}
permissions:
contents: read
env:
TAG: ${{ needs.setup-release.outputs.tag }}
VERSION: ${{ needs.setup-release.outputs.version }}
steps:
- name: Bump the Flathub manifest
shell: bash
env:
FLATHUB_TOKEN: ${{ secrets.FLATHUB_TOKEN }}
GH_TOKEN: ${{ secrets.FLATHUB_TOKEN }}
run: |
if [ -z "${FLATHUB_TOKEN:-}" ]; then
echo "::notice::FLATHUB_TOKEN is not set; skipping the Flathub PR."
exit 0
fi
git clone --depth 1 \
"https://x-access-token:${FLATHUB_TOKEN}@github.com/flathub/moe.sable.client.git" flathub

gh release view "$TAG" --json assets \
--jq '.assets[] | select(.name | test("-linux-(x86_64|aarch64)\\.tar\\.gz$"))
| "\(.name) \(.digest)"' > assets.txt

# The manifest pins these two by content, read from dev.
for name in moe.sable.client.metainfo.xml moe.sable.client.desktop; do
curl -fsSL "https://raw.githubusercontent.com/SableClient/Sable/dev/packaging/flatpak/$name" \
| sha256sum | awk -v n="$name" '{print n, "sha256:" $1}' >> assets.txt
done

VERSION="$VERSION" python3 - flathub/moe.sable.client.yml assets.txt <<'PY'
import os, re, sys

manifest, digests = sys.argv[1], sys.argv[2]
version = os.environ["VERSION"]
sha = {}
for line in open(digests):
name, digest = line.split()
sha[name] = digest.removeprefix("sha256:")

text = open(manifest).read()
for arch in ("x86_64", "aarch64"):
name = f"Sable-{version}-linux-{arch}.tar.gz"
url = f"https://github.com/SableClient/Sable/releases/download/v{version}/{name}"
text, count = re.subn(
rf"url: \S*Sable-\S+-linux-{arch}\.tar\.gz\n(\s+)sha256: \w+",
lambda m: f"url: {url}\n{m.group(1)}sha256: {sha[name]}",
text,
)
if count != 1:
sys.exit(f"expected one {arch} source, found {count}")

for name in ("moe.sable.client.metainfo.xml", "moe.sable.client.desktop"):
text, count = re.subn(
rf"(url: \S*/packaging/flatpak/{re.escape(name)}\n\s+)sha256: \w+",
lambda m: f"{m.group(1)}sha256: {sha[name]}",
text,
)
if count != 1:
sys.exit(f"expected one {name} source, found {count}")

open(manifest, "w").write(text)
PY

cd flathub
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add moe.sable.client.yml
if git diff --cached --quiet; then
echo "Nothing changed; skipping the Flathub PR."
exit 0
fi
git checkout -b "update-${VERSION}"
git commit -m "Update Sable to ${VERSION}"
git push origin "update-${VERSION}"
gh pr create --repo flathub/moe.sable.client \
--base master --head "update-${VERSION}" \
--title "Update Sable to ${VERSION}" \
--body "Bumps the x86_64 and aarch64 release tarballs to ${VERSION}."
15 changes: 15 additions & 0 deletions packaging/flatpak/moe.sable.client.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@
</screenshots>

<releases>
<release version="1.22.4" date="2026-09-18">
<url type="details">https://github.com/SableClient/Sable/releases/tag/v1.22.4</url>
</release>
<release version="1.22.3" date="2026-09-18">
<url type="details">https://github.com/SableClient/Sable/releases/tag/v1.22.3</url>
</release>
<release version="1.22.2" date="2026-09-18">
<url type="details">https://github.com/SableClient/Sable/releases/tag/v1.22.2</url>
</release>
<release version="1.22.1" date="2026-09-17">
<url type="details">https://github.com/SableClient/Sable/releases/tag/v1.22.1</url>
</release>
<release version="1.22.0" date="2026-09-17">
<url type="details">https://github.com/SableClient/Sable/releases/tag/v1.22.0</url>
</release>
<release version="1.21.0" date="2026-08-17">
<url type="details">https://github.com/SableClient/Sable/releases/tag/v1.21.0</url>
</release>
Expand Down
14 changes: 7 additions & 7 deletions packaging/flatpak/moe.sable.client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ modules:
sources:
- type: extra-data
filename: sable.tar.gz
url: https://github.com/SableClient/Sable/releases/download/v1.21.0/Sable-1.21.0-linux-x86_64.tar.gz
sha256: 57caeeaa7b4c4002afd1bc6bbc47ba5807a3e326d77b55545f7e6ea2d7f69df0
size: 159125471
url: https://github.com/SableClient/Sable/releases/download/v1.22.4/Sable-1.22.4-linux-x86_64.tar.gz
sha256: e83150f7ade969fbfbc26b849330167145b2621a75cc906f25c9c0d5304a1024
size: 174342420
only-arches: [x86_64]
x-checker-data:
type: json
Expand All @@ -72,9 +72,9 @@ modules:
is-main-source: true
- type: extra-data
filename: sable.tar.gz
url: https://github.com/SableClient/Sable/releases/download/v1.21.0/Sable-1.21.0-linux-aarch64.tar.gz
sha256: 2d732583c4016c00fc88356ae2148efb11e02e82b46f4b4f3293554279ed5715
size: 175287757
url: https://github.com/SableClient/Sable/releases/download/v1.22.4/Sable-1.22.4-linux-aarch64.tar.gz
sha256: 93ab363d0fdb305c5d059258d5074d3d13fa117e11c2e270b7e8722770d2211e
size: 189788268
only-arches: [aarch64]
x-checker-data:
type: json
Expand All @@ -94,7 +94,7 @@ modules:
- type: file
path: sable.sh
- type: file
url: https://raw.githubusercontent.com/SableClient/Sable/v1.21.0/LICENSE
url: https://raw.githubusercontent.com/SableClient/Sable/v1.22.4/LICENSE
sha256: 4df3c306dddaaf4baffdff5ca820cc679ac8cd6dc263c6a74517783e42fa7a3b
dest-filename: LICENSE
- type: file
Expand Down
Loading