feat: the Longshot Builder as a Flatpak, published to flat-manager #1
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/flatpak"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
dev.magicbean.Longshotis the Longshot Builder as a Flatpak. CI publishes it to Bean-Ops' flat-manager (stable). It wraps Longshot's signed release AppImage, unpacked into/appon org.freedesktop.Platform 26.08 (24.08 reached end of life in August). The README has the details.config.envrcuntil the first stable), flat-manager's URL and repo, Flathub. Nothing is hard-coded elsewhererelease_keys.jsonscripts/release_keys.json)scripts/pick_release.pySHA256SUMS.sigagainst the pinned key, then writesgenerated/appimage.json(the AppImage's URL and SHA-256 fromSHA256SUMS) and the metainfo with the versiondev.magicbean.Longshot.yml--appimage-extract(no FUSE), not stripped. Permissions: network, X11 (Tk) and Wayland, PulseAudio, all devices (GPU, controllers), home,/mnt,/media,/run/medialongshot-flatpak.sh/app/bin/longshot: starts the AppImage'sAppRun(below).forgejo/workflows/build.ymlmain, a manual run (force,tag) and an hourly check publish, and only a release that isn't already the published oneThe builder's path, inside and outside the sandbox
The builder writes
builder=<its path>into each game folder. That path gets started by two things:/appexists only inside the sandbox. So the start script writes~/.var/app/dev.magicbean.Longshot/data/longshot-builderat every start: the same path on both sides. That script runs/app/bin/longshotinside the sandbox andflatpak run dev.magicbean.Longshotoutside, and the builder is given it as its own path (APPIMAGE, whichAppRunturns intoLONGSHOT_BUILDER_EXE).CI
runs-on: flatpak(bubblewrap: SYS_ADMIN, seccomp unconfined). This repository has its own runner,longshot-flatpak-…(homelab-gitops46-longshot-flatpak-runner.yaml, registered with this repository's token), so the privileged job stays with one repository per runner, as Jellium's does.c72715c8…). It is Ubuntu 24.04 and already has flatpak, ostree and the Rustflat-manager-client, so the client matches the server. That image has no Node, so the checkout is a plaingit fetchwith the job's token.flatpak-builder --default-branch=stable --repo=repo --subject="Longshot <tag>".flat-manager-client create, thenpush --commit --publish --wait, with theFLAT_MANAGER_TOKENsecret (set).Longshot <tag>.Checked
05489f1) and 2 (8ff9327) both passed on the new runner, 2 to 3 minutes each. A pull request builds and doesn't publish. I couldn't read the job logs through the API (this Forgejo has no job-log endpoint), so the build steps' output itself is not checked here.scripts/pick_release.pyagainst the live release list: it pickedv3.0.0-rc.1, the signature checked with the pinned key, and the SHA-256 matches the downloaded AppImage.AppRun,usr/,longshot.png(512×512).flatpak run --command=sh, the AppImage's own Python works: Tk 9.0 opens a window, OpenSSL 3.5, andmake_game.py --helpruns.flatpak remote-infoprintsSubject:, which the skip step reads (checked on the gmatte remote)./code-review(high): see the comments.Not checked yet
Known limits
image:with it.🤖 Generated with Claude Code
https://claude.ai/code/session_015KgSKoUqUvce5UXG89NBgi
Updated to
8ff9327after a/code-review(high), which found 10 things.Fixed:
Longshot <tag> (packaging <sha>)), so a packaging change publishes again.name=in/.flatpak-info;flatpak-spawn --hostwhen started from another Flatpak (Steam, Heroic, Lutris);LONGSHOT_LAUNCHER_HOME) instead of being downloaded a second time.Documented in the README instead of changed:
docs/releases.mdsays. An oldertagpublished by hand lasts until the next hourly run.APPIMAGEstays set, becauseAppRunneeds it to pass the builder its own path. So a report built from the builder's own facts says "the AppImage". That's a small follow-up for Longshot: tell the two apart byFLATPAK_ID.Blocked: no runner has picked up the job. Run 1 has been
waitingsince the PR opened. Theflatpakrunner (homelab-gitopsforgejo-runner/45-flatpak-runner.yaml) is registered withforgejo-jellium-runner-secret. That is a repository-level token for gmatte/jellium-flatpak-builder, so this repository can't use the runner. It needs registering at the MagicBean-Mirror org level (or the instance level), for example with a second runner or a new registration token. Once that's done, this PR's run will do the first full build. I can't do that registration withclaude's access.🤖 Generated with Claude Code