Chore/flatpak update (#2121)

<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->

### Description

<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->

Fixes #

#### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings

### AI disclosure:

- [ ] Created without the usage of AI
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).

<!--
Write any explanation required here, but do not generate the explanation
using AI!! You MUST prove you understand what the code in this PR does.
You MUST explain what modifications you have made in order to ensure
that the result is compatible with THE LICENSE
By deleting this section or comment, in code or in body, the PR should
be rejected and closed.
-->
This commit is contained in:
Erwan Leboucher authored and GitHub committed 2026-09-19 23:46:47 +02:00
commit 078723a17a
3 files changed
+107 -7

No files matched your search

+85
View File
@@ -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}."
@@ -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>
+7 -7
View File
@@ -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
@@ -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
@@ -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