@@ -177,19 +177,25 @@ The shared `"bundle"` key, plus a `"flatpak"` sub-key:
177177``` jsonc
178178" bundle" : {
179179 " name" : " MyApp" ,
180- " id" : " com.example.MyApp" , // MUST be your GApplication application-id
180+ " id" : " io.github.you.myapp" , // MUST be your GApplication application-id;
181+ // Flathub requires io.github.*/io.gitlab.*
182+ // for code-hosting-based ids
181183 " summary" : " Does the thing" , // .desktop comment + AppStream summary
182- " icon" : " assets/icon.svg" , // svg or png; required by Flathub
183184 " license" : " MIT" , // SPDX, defaults to package.json "license"
184185 " categories" : [" GTK" , " Utility" ],
185186 " flatpak" : {
186- " runtimeVersion" : " 49 " , // org.gnome.Platform version (50 is also current;
187- // pick one and test against it)
187+ " runtimeVersion" : " 50 " , // org.gnome.Platform version — pin the one
188+ // you tested against
188189 " node" : 26 , // SDK extension major (20/22/24/26)
189190 " finishArgs" : [ // sandbox permissions beyond the GUI defaults
190191 " --share=network" ,
191192 " --filesystem=home"
192- ]
193+ ],
194+ " lintExceptions" : { // linter errors your app stands by; each one
195+ // must be requested (with this justification)
196+ // in the Flathub submission PR
197+ " finish-args-host-filesystem-access" : " MyApp is a file manager; …"
198+ }
193199 }
194200}
195201```
@@ -203,6 +209,24 @@ Defaults grant only GUI access (`wayland`, `fallback-x11`, `ipc`, `dri`) —
203209network and filesystem are deliberately opt-in; request the minimum, Flathub
204210reviews it.
205211
212+ ## Desktop integration files
213+
214+ Ship your own files at the conventional locations and they are used as-is;
215+ anything missing gets a minimal generated stub:
216+
217+ - ` data/<id>.desktop ` — copied with only ` Exec= ` rewritten to the sandbox
218+ command, so one file serves host installs and the flatpak. Keep
219+ ` Icon=<id> ` : flatpak only exports icons named after the app id.
220+ - ` data/<id>.metainfo.xml ` — copied verbatim. The generated stub passes
221+ validation, but Flathub review wants a real description, screenshots and
222+ release notes only you can write — start from the stub in ` dist/flatpak/ ` .
223+ - ` data/icons/hicolor/<size>/apps/<id>.(svg|png) ` — the whole theme tree
224+ ships (sized, scalable and symbolic variants). Single-file alternative:
225+ ` "bundle": { "icon": "assets/icon.svg" } ` .
226+
227+ Override the discovery with `"bundle": { "desktopFile": …, "metainfo": …,
228+ "iconsDir": … }` when your layout differs.
229+
206230Three things that bite:
207231
208232- ** The flatpak id must equal your ` Gtk.Application ` ` applicationId ` ** —
@@ -231,19 +255,37 @@ npx node-gtk flatpak --release --lint
231255
232256- ` <Name>-<version>-flatpak-src.tar.gz ` — the staged sources (app +
233257 production node_modules + desktop files) as one tarball
234- - ` <id>.flathub .yml ` — the manifest referencing that tarball by URL + sha256
258+ - ` flathub/ <id>.yml` — the manifest referencing that tarball by URL + sha256
235259 (URL derived from package.json ` "repository" ` :
236260 ` https://github.com/<you>/<app>/releases/download/v<version>/<tarball> ` ;
237- override with ` --release-url ` )
238-
239- The flow: ** 1.** fix everything ` --lint ` reports (the metainfo TODOs —
240- description, screenshots, releases, content rating — and a real icon);
241- ** 2.** create the GitHub release ` v<version> ` and upload the tarball;
242- ** 3.** submit ` <id>.flathub.yml ` via PR to
243- [ flathub/flathub] ( https://github.com/flathub/flathub ) . After acceptance,
244- users find the app in GNOME Software and every update ships automatically —
245- new releases are a version bump + new tarball + manifest update in your
246- Flathub repo.
261+ override with ` --release-url ` ). The ` flathub/ ` directory is exactly what
262+ the submission PR contains, and the manifest is named ` <id>.yml ` because
263+ the linter requires it.
264+
265+ The flow:
266+
267+ 1 . Fix everything ` --lint ` reports. Common gates: the app id — Flathub
268+ rejects ` com.github.* ` ; a GitHub-hosted app must use ` io.github.<you>.<app> `
269+ (and ` applicationId ` must match) — and broad permissions like
270+ ` --filesystem=host ` , which are declared in ` "lintExceptions" ` with a
271+ justification and granted per-app during review.
272+ 2 . Create the GitHub release ` v<version> ` and upload the tarball:
273+ ` gh release create v<version> dist/flatpak/<tarball> ` .
274+ 3 . Fork [ flathub/flathub] ( https://github.com/flathub/flathub ) , branch off
275+ ` new-pr ` (not master), add the contents of ` dist/flatpak/flathub/ ` , and
276+ open a PR against ` new-pr ` . Request any ` lintExceptions ` in the PR
277+ description with their justifications.
278+
279+ After acceptance, users find the app in GNOME Software and every update
280+ ships automatically — new releases are a version bump + new tarball +
281+ manifest update in your Flathub repo.
282+
283+ One caveat if you run the deepest check locally
284+ (` flatpak-builder-lint repo dist/flatpak/repo ` ): it reports
285+ ` appstream-screenshots-not-mirrored-in-ostree ` /
286+ ` appstream-external-screenshot-url ` . Both are expected outside Flathub's
287+ infrastructure — their pipeline mirrors screenshots into
288+ ` dl.flathub.org/media ` automatically.
247289
248290Alternative without Flathub: host your own flatpak repository (an ostree
249291repo is static files — GitHub Pages works) and point users at a ` .flatpakref ` ;
0 commit comments