No description
  • Python 72.7%
  • Shell 27.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-13 17:20:59 -05:00
.forgejo/workflows feat: the Flatpak is the Longshot Launcher, the same program as its AppImage 2026-11-13 17:14:12 -05:00
scripts feat: the Flatpak is the Longshot Launcher, the same program as its AppImage 2026-11-13 17:14:12 -05:00
.gitignore feat: the Longshot Builder as a Flatpak, published to flat-manager 2026-11-13 03:33:17 -05:00
config.env feat: the Flatpak is the Longshot Launcher, the same program as its AppImage 2026-11-13 17:14:12 -05:00
dev.magicbean.Longshot.desktop feat: the Flatpak is the Longshot Launcher, the same program as its AppImage 2026-11-13 17:14:12 -05:00
dev.magicbean.Longshot.metainfo.xml feat: the Flatpak is the Longshot Launcher, the same program as its AppImage 2026-11-13 17:14:12 -05:00
dev.magicbean.Longshot.yml feat: the Flatpak is the Longshot Launcher, the same program as its AppImage 2026-11-13 17:14:12 -05:00
longshot-flatpak.sh feat: the Flatpak is the Longshot Launcher, the same program as its AppImage 2026-11-13 17:14:12 -05:00
README.md feat: the Flatpak is the Longshot Launcher, the same program as its AppImage 2026-11-13 17:14:12 -05:00
release_keys.json feat: the Flatpak is the Longshot Launcher, the same program as its AppImage 2026-11-13 17:14:12 -05:00

Longshot Flatpak

The Longshot Launcher as a Flatpak, dev.magicbean.Longshot, published to Magic Bean's Flatpak repository (Bean-Ops' flat-manager). It is the same program as the launcher's AppImage, LongshotLauncher (.NET, self-contained), installed in /app/bin. The release's signed AppImage is only the file it comes out of: the build unpacks it and keeps the program and its icon. Nothing of the AppImage runs: no AppImage runtime, no FUSE.

flatpak install https://flatpak.magicbean.gmatte.xyz/repo/stable/longshot-beta.flatpakref   # the release candidates
flatpak install https://flatpak.magicbean.gmatte.xyz/repo/stable/dev.magicbean.Longshot.flatpakref   # stable releases
flatpak run dev.magicbean.Longshot                  # the launcher
flatpak run dev.magicbean.Longshot --play           # the game it built last

Each release is on three kinds of branch (flatpak remote-ls magicbean --all):

Branch What Updates to
beta The newest release candidate, or stable release if newer each new rc and stable
release The newest stable release (none before Longshot's first) each new stable
1.0.0-rc.3, 1.0.0... That launcher release, for good nothing: to keep or go back to one

To change: flatpak install magicbean dev.magicbean.Longshot//1.0.0-rc.3, or //beta, //release. stable, where the first build went, has ended: flatpak says so, with the command to move to beta.

What's here

File What
config.env Every address, and the channel followed: Longshot's release list, the flat-manager URL and its repository, Flathub. Edit here, not in the workflow
release_keys.json The key Longshot's releases are signed with, pinned (Longshot's scripts/release_keys.json)
scripts/pick_release.py Finds the newest release on the channel and checks SHA256SUMS.sig with that key. Takes the launcher AppImage's SHA-256 from SHA256SUMS, then writes generated/ (that file as the source, and the metainfo with the version)
dev.magicbean.Longshot.yml The manifest: org.freedesktop.Platform 26.08, the launcher's program taken out of the AppImage (checked with --self-check), permissions
longshot-flatpak.sh /app/bin/longshot: starts /app/bin/LongshotLauncher with the AppImage's places (see "The same as the AppImage" below)
.forgejo/workflows/build.yml CI: builds on a pull request; on main, a manual run or the hourly check, publishes a release that isn't published yet

How a release gets published

  1. Every hour, on a push to main, or when started by hand, pick_release.py picks the channel's newest release.
  2. If the published commit's subject is already Longshot <that tag> (packaging <this repo's commit>), nothing else runs, so a change to the packaging publishes again. A manual run with force builds anyway.
  3. flatpak-builder builds it into an OSTree repo, on the version's branch (1.0.0-rc.3), and the same commit goes on the channel's: beta for an rc, release and beta for a stable. (stable in the URLs is flat-manager's repository, not a branch.)
  4. flat-manager-client create, then push --commit --publish --wait, with the FLAT_MANAGER_TOKEN secret. flat-manager signs the build with Magic Bean's key.

The job runs on the flatpak runner, which allows bubblewrap (SYS_ADMIN, seccomp unconfined). Its container is flat-manager's own image, at the commit Bean-Ops runs, so flat-manager-client matches the server. When Bean-Ops moves flat-manager to a new commit, move the image: in the workflow with it.

To build locally (needs flatpak-builder):

python3 -I scripts/pick_release.py
flatpak-builder --user --install-deps-from=flathub --force-clean --install build dev.magicbean.Longshot.yml

Permissions

  • Network: the launcher checks git.magicbean.dev for Longshot's releases and its own, downloads Longshot's builder and its build tools, and sends crash reports on Send Help. The launcher's own updates come through Flatpak (flatpak update): the hourly check publishes each new launcher release on its channel.
  • X11 and Wayland: the launcher's window takes X11; the game uses Wayland when it can.
  • PulseAudio.
  • All devices: the GPU and controllers.
  • Home, /mnt, /media, /run/media: your game dump and the folder the game is built into, wherever you keep them, and the launcher's places in ~/.local/share.

The same as the AppImage

longshot-flatpak.sh starts the launcher as the AppImage's own AppRun does, with three differences in the environment:

  • XDG_DATA_HOME is ~/.local/share, as outside the sandbox. The launcher's home (~/.local/share/longshot/launcher: builds, settings, Longshot's builder and its build tools), the game's saves and the shortcuts are where the AppImage puts them. The Flatpak and the AppImage share them, and the desktop sees the shortcuts.
  • LONGSHOT_LAUNCHER_EXE is the path the launcher writes into each game folder (builder=) and into its shortcuts, which start it from outside the sandbox. /app/bin exists only inside, so it is a small script written at every start, ~/.var/app/dev.magicbean.Longshot/data/longshot-launcher, the same path inside and outside: it runs /app/bin/longshot inside the sandbox, and flatpak run dev.magicbean.Longshot outside. longshot-builder beside it is the same script, for the game folders the first Flatpak (Longshot's builder) made.
  • No APPIMAGE: the launcher then doesn't offer to replace itself.

LONGSHOT_LAUNCHER_EXE needs a launcher that reads it (LongshotLauncher's SelfUpdate.StartPath). An older one writes /app/bin/LongshotLauncher instead, and its shortcuts work only from inside the sandbox (Play in the launcher works).

Known limits

  • Rolling back is Longshot's way: delete the bad release (or set it back to a draft), and the next hourly run publishes the channel's newest again. Publishing an older tag by hand while the bad release is still listed lasts only until the next hourly run.
  • Right after a publish, flat-manager updates the repository's summary a few seconds later, and a run in that gap may publish the same build again: harmless, one more commit.
  • The first Flatpak (Longshot's builder, v3.0.0-rc.3) kept its data in ~/.var/app/dev.magicbean.Longshot/data. The launcher doesn't read it: build again from the launcher, or copy the saves over.
  • The channel is rc until the launcher's first stable release (config.env).