installer/flatpak/flathub/README.md
This folder holds the Flathub-ready variant of the Flatpak manifest. It differs from the
CI manifest (../dk.nikse.subtitleedit.yaml, which builds from a local type: dir checkout)
only in the app source: Flathub builds from the public repository at a pinned release tag +
commit.
Everything else (bundled mpv/ffmpeg/tesseract+eng, offline NuGet restore, desktop/metainfo/icon/
license install) is identical and already validated in CI by the regenerate-flatpak-nuget-sources /
build-linux-flatpak jobs in .github/workflows/build-ui.yml.
dk.nikse.subtitleedit.yaml: the manifest to submit (git source, pinned to a tag + commit).nuget-sources.json: offline NuGet packages for that exact pinned commit.prepare-flathub-release.sh: regenerates both of the above for a new tag in one step.The .desktop, .metainfo.xml and icon are installed from the git checkout during the build, so
they do not need to be copied here.
.github/workflows/build-ui.yml has a regenerate-flathub-nuget-sources → build-linux-flathub
job pair, the same pattern already used for the CI manifest's own
regenerate-flatpak-nuget-sources → build-linux-flatpak pair. On every dispatch it:
dk.nikse.subtitleedit.yaml, checks that
commit out directly (this job's own workspace is disposable, so a detached checkout is
safe), and regenerates nuget-sources.json for it, uploaded as the flathub-nuget-sources
artifact. This checks out in place rather than using prepare-flathub-release.sh's
git-worktree approach: that approach is fine for local/manual use, but the preferred NuGet
restore path shells out to a second, nested Flatpak sandbox, which failed to resolve the
worktree's path when this job already runs inside its own container. Checking out directly
sidesteps that instead of chasing it further.flathub-infra container Flathub itself uses, for both x86_64 and aarch64
(native ARM64 runner, not emulation), and uploads each as flathub-bundle-x86_64 /
flathub-bundle-aarch64.That last part is the real point: it validates this exact variant end to end on a real Linux
runner, without needing a contributor's own Linux box or local Flatpak install (see the
discussion on #11800). The two architectures matter because a contributor testing this ahead
of submission may well be on aarch64 hardware (e.g. Apple Silicon under a Linux VM); an
x86_64-only bundle would force them into qemu emulation just to try it. Run the workflow,
download whichever flathub-bundle-<arch> matches your machine, and if it built, the pin
is good; flathub-nuget-sources is the file to commit here (the same one covers both
architectures, since generate-nuget-sources.sh already restores for both).
nuget-sources.json is intentionally not committed to this repo until it has been generated
this way, so that it can never silently drift out of sync with whatever the manifest currently
pins (the CI job would recreate it fresh from the pin every time it runs).
Two mechanisms, doing two different halves of the job:
Tag/commit bump: the manifest's x-checker-data block lets Flathub's own
external-data-checker bot
watch this repo's tags and open a PR against flathub/dk.nikse.subtitleedit bumping
tag:/commit: automatically when a new stable tag (matching v<major>.<minor>.<patch>,
so pre-releases like -beta* are skipped) is pushed. This part is hands-off once the app
is accepted.
nuget-sources.json regeneration: the bot has no way to know how to run our custom NuGet
pre-fetch step, so it does not touch nuget-sources.json. After merging one of its PRs (or
before any manual release), either dispatch build-ui.yml and pull the refreshed file from
the flathub-nuget-sources artifact, or run locally:
./installer/flatpak/flathub/prepare-flathub-release.sh v5.1.0
from the repo root (only needed if bumping to a new tag outside of what the checker bot
already wrote into the manifest; with no argument it just regenerates for whatever is
currently pinned). This resolves the tag's commit, regenerates nuget-sources.json for
that exact commit in a disposable worktree (so it does not disturb whatever branch you are
on), and updates the manifest's tag:/commit: to match. That is the entire per-release
workflow; nothing else in this folder needs manual editing.
Also run ../update-metainfo-version.sh (bumps the AppStream <release> entry) and add a
matching entry to ../dk.nikse.subtitleedit.metainfo.xml if this is a new stable version,
same as before.
appstreamcli validate installer/flatpak/dk.nikse.subtitleedit.metainfo.xml
flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest \
installer/flatpak/flathub/dk.nikse.subtitleedit.yaml
build-linux-flathub in CI proves the
sandbox builds; it does not launch the app or exercise it. Download whichever
flathub-bundle-<arch> matches your machine and install/run it on Linux
(flatpak install SubtitleEdit-flathub-<arch>.flatpak && flatpak run dk.nikse.subtitleedit), open a subtitle file, load a video, try OCR, before submitting.https://github.com/flathub/flathub.dk.nikse.subtitleedit.dk.nikse.subtitleedit.yaml and nuget-sources.json at the repo root of that branch.new-pr branch of flathub/flathub. A bot builds it; reviewers review.flathub/dk.nikse.subtitleedit repo (you maintain it there).
Push updates there directly, or let the auto-update bot's PRs land after the
nuget-sources.json fixup described above.nikse.dk or the GitHub org).src/ui/Logic/Download/DownloadHashManager.cs), so this is a good,
concrete answer if reviewers ask about integrity, not just an "it's optional" hand-wave.--filesystem=home + --share=network: broad but standard for an editor with online
services (translation, TTS, speech-to-text).dk.nikse.subtitleedit: fine if nikse.dk is verified later on flathub.org;
io.github.SubtitleEdit.subtitleedit is the easier-to-verify alternative (but renaming the
app-id touches the desktop/metainfo/icon filenames and the settings directory).