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
9 changes: 5 additions & 4 deletions .github/workflows/tauri-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1232,9 +1232,9 @@ jobs:
--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.
# The manifest pins these two by content, read from the release tag.
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" \
curl -fsSL "https://raw.githubusercontent.com/SableClient/Sable/${TAG}/packaging/flatpak/$name" \
| sha256sum | awk -v n="$name" '{print n, "sha256:" $1}' >> assets.txt
done

Expand All @@ -1261,9 +1261,10 @@ jobs:
sys.exit(f"expected one {arch} source, found {count}")

for name in ("moe.sable.client.metainfo.xml", "moe.sable.client.desktop"):
url = f"https://raw.githubusercontent.com/SableClient/Sable/v{version}/packaging/flatpak/{name}"
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]}",
rf"url: \S*/packaging/flatpak/{re.escape(name)}\n(\s+)sha256: \w+",
lambda m: f"url: {url}\n{m.group(1)}sha256: {sha[name]}",
text,
)
if count != 1:
Expand Down
5 changes: 5 additions & 0 deletions knope.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ type = "PrepareRelease"
type = "Command"
command = "node scripts/fastlane-changelog.js $version && git add fastlane/metadata/android/en-US/changelogs"

# Flathub reads the metainfo from the tagged commit for the same reason.
[[workflows.steps]]
type = "Command"
command = "node scripts/flatpak-metainfo-release.js $version && git add packaging/flatpak/moe.sable.client.metainfo.xml"

[[workflows.steps]]
type = "Command"
command = "git commit -m \"chore: prepare release $version\""
Expand Down
6 changes: 6 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,12 @@
</screenshots>

<releases>
<release version="1.22.6" date="2026-09-20">
<url type="details">https://github.com/SableClient/Sable/releases/tag/v1.22.6</url>
</release>
<release version="1.22.5" date="2026-09-20">
<url type="details">https://github.com/SableClient/Sable/releases/tag/v1.22.5</url>
</release>
<release version="1.22.4" date="2026-09-18">
<url type="details">https://github.com/SableClient/Sable/releases/tag/v1.22.4</url>
</release>
Expand Down
41 changes: 41 additions & 0 deletions scripts/flatpak-metainfo-release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env node
//MISE hide=true
//MISE description="Add the current version to the Flatpak metainfo releases"
/* oxlint-disable no-console */

import { readFileSync, writeFileSync } from 'node:fs';
import process from 'node:process';

const version = process.argv[2];
if (!version || !/^\d+\.\d+\.\d+/.test(version)) {
console.error(
`Usage: node scripts/flatpak-metainfo-release.js <version> (got: ${version ?? '<none>'})`
);
process.exit(1);
}

const changelog = readFileSync('CHANGELOG.md', 'utf8');
const heading = `\n## ${version} (`;
const start = changelog.indexOf(heading);
const date =
start === -1
? undefined
: changelog.slice(start + heading.length).match(/^(\d{4}-\d{2}-\d{2})\)/)?.[1];
if (!date) {
console.error(`No "## ${version} (YYYY-MM-DD)" section in CHANGELOG.md`);
process.exit(1);
}

const path = 'packaging/flatpak/moe.sable.client.metainfo.xml';
const metainfo = readFileSync(path, 'utf8');
if (metainfo.includes(`<release version="${version}"`)) {
console.log(`${path} already lists ${version}`);
process.exit(0);
}

const entry = ` <release version="${version}" date="${date}">
<url type="details">https://github.com/SableClient/Sable/releases/tag/v${version}</url>
</release>
`;
writeFileSync(path, metainfo.replace(' <releases>\n', ` <releases>\n${entry}`));
console.log(`Added ${version} to ${path}`);
Loading