Skip to content

feat: Integrate Snap and/or Flatpak distribution for Linux builds #1431

@SukuWc

Description

@SukuWc

Overview

Currently, the Linux build only produces an AppImage artifact (configured in electron-builder-config.js). To improve discoverability and ease of installation for Linux users, we should add Snap and/or Flatpak as additional distribution targets.

Current State

  • electron-builder-config.js sets linux.target: "AppImage" only
  • CI pipelines (build-matrix.yml, stable-matrix.yml, nightly-matrix.yml) build on ubuntu-22.04 but only publish the AppImage artifact
  • No Snap Store or Flathub publishing step exists in any workflow
  • The current AppImage is x64 only — the linux config has no arch field, so electron-builder defaults to the host (x64). ARM Linux users (Raspberry Pi, ARM Chromebooks, etc.) cannot run it. Compare: macOS already sets arch: ["arm64", "x64"] explicitly; Linux does not.

Goals

  • Add Snap packaging via electron-builder (snap target) and publish to the Snap Store
  • Add Flatpak packaging and publish to Flathub (requires a Flatpak manifest)
  • Integrate publishing into the stable-matrix.yml release workflow (triggered on tag)
  • Optionally include in nightly-matrix.yml for pre-release channels (Snap edge, Flatpak beta repo)
  • Add arch: ["x64", "arm64"] to the linux section to produce ARM64 AppImage artifacts

Implementation Notes

ARM64 AppImage

  • Add arch: ["x64", "arm64"] to the linux block in electron-builder-config.js (mirrors the macOS approach)
  • CI would need either a GitHub ARM runner (ubuntu-22.04-arm) or cross-compilation from x64
  • electron-builder supports cross-compiling to arm64 on Linux, but native modules (USB/serial) may need additional handling
  • Update the artifactName to include ${arch} so x64 and arm64 artifacts are distinguishable

Snap

  • electron-builder has built-in Snap support — add "snap" to linux.target in electron-builder-config.js
  • Requires snapcraft installed on the build runner (sudo snap install snapcraft --classic)
  • Publishing needs a SNAPCRAFT_STORE_CREDENTIALS secret added to GitHub Actions
  • Consider confinement: classic for USB/HID device access (Grid hardware uses serial/USB)
  • Snap supports multi-arch publishing, so ARM64 can be covered here too

Flatpak

  • electron-builder does not have native Flatpak support — requires a separate Flatpak manifest (com.intechstudio.GridEditor.yml)
  • Use flatpak-builder in CI or the electron-packager + flatpak-builder approach
  • Flathub submission requires a PR to the flathub/flathub repo
  • USB/HID device access requires --device=all or appropriate portal permissions in the sandbox
  • Flathub supports multi-arch (x86_64 + aarch64) if build infrastructure is set up

Hardware Access Concern

Grid Editor communicates with hardware over USB/serial. Both Snap (classic confinement or raw-usb interface) and Flatpak (device portal or --device=all) need explicit permission grants — this needs validation before shipping.

Questions to Resolve

  1. Snap, Flatpak, or both?
  2. Should nightly builds publish to Snap edge / a beta Flatpak repo?
  3. Do we need to create Snap Store / Flathub accounts and register the app name?
  4. Has USB device access been validated inside a Snap/Flatpak sandbox?
  5. Should we add an ARM64 AppImage alongside Snap/Flatpak, or rely on those formats for ARM coverage?

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions