Skip to content

Add Linux packaging (deb, rpm, AppImage, Arch) and CI - #42

Open
Tsurgcom wants to merge 2 commits into
diffusionstudio:mainfrom
Tsurgcom:linux-packaging
Open

Add Linux packaging (deb, rpm, AppImage, Arch) and CI#42
Tsurgcom wants to merge 2 commits into
diffusionstudio:mainfrom
Tsurgcom:linux-packaging

Conversation

@Tsurgcom

Copy link
Copy Markdown

Summary

Adds Linux packaging for the desktop app so it can ship alongside the macOS build: deb, rpm, zip, AppImage, and Arch Linux (.pkg.tar.zst), plus CI jobs to publish them on release.

What changed

  • Electron Forge makers (apps/desktop/forge.config.ts): added MakerDeb (Debian/Ubuntu) and enabled MakerZIP for Linux.
  • RPM (apps/desktop/scripts/make-rpm.mjs): a self-generated .spec + rpmbuild script instead of @electron-forge/maker-rpm. electron-installer-redhat@3.4.0 stages to BUILD/usr but runs cp -r usr/* from the build subdir, which breaks on RPM 6's build-directory layout; the custom spec works on RPM 4 and 6.
  • AppImage (apps/desktop/scripts/make-appimage.mjs): builds via appimagetool (auto-downloaded, run FUSE-less so it works in CI).
  • Arch (apps/desktop/scripts/make-arch.mjs + packaging/arch/{PKGBUILD,launcher,diffusion-studio.desktop}): stages the packaged app and runs makepkg.
  • CLI wrapper fix (apps/desktop/scripts/stage-cli.mjs): the shipped dapi wrapper hardcoded the macOS Contents/MacOS/… path; it now resolves the binary/app-root per platform so dapi works from a Linux install.
  • CI (.github/workflows/release.yml): new publish-linux (ubuntu: deb + rpm + zip + AppImage) and publish-arch (archlinux container) jobs that upload to the release.
  • Docs: Linux download badge, an Install section, and contributor build instructions.

New npm scripts

npm run make:linux --workspace=@diffusionstudio/desktop   # deb, rpm, zip, AppImage
npm run make:arch --workspace=@diffusionstudio/desktop    # Arch (.pkg.tar.zst)

Testing

Built and inspected all five artifacts on an Arch host (Node 20):

Target Artifact
deb diffusion-studio_0.201.0_amd64.deb
rpm diffusion-studio-0.201.0-1.x86_64.rpm
zip Diffusion Studio-linux-x64-0.201.0.zip
AppImage Diffusion-Studio-0.201.0-x86_64.AppImage
Arch diffusion-studio-0.201.0-1-x86_64.pkg.tar.zst

Each package installs to /usr/lib/diffusion-studio/ with a diffusion-studio launcher, the dapi CLI, a .desktop entry, and an icon; chrome-sandbox is setuid 4755. The AppImage extracts cleanly with a correct AppRun/.desktop/icon, and the packaged dapi runs via the app's Electron binary (dapi --version0.201.0).

Notes

  • Builds require Node 20 (newer Node versions can break Electron Packager's zip extraction).
  • System tools per format: dpkg + fakeroot (deb), rpmbuild (rpm), makepkg (Arch); AppImage fetches appimagetool itself.
  • macOS is unchanged — the new makers are linux-only.

Builds and ships the desktop app for Linux across five targets:

- deb (Debian/Ubuntu) and zip via Electron Forge makers
- rpm (Fedora) via a custom spec + rpmbuild script, since
  electron-installer-redhat is incompatible with RPM 6's build layout
- AppImage via appimagetool
- Arch Linux (.pkg.tar.zst) via makepkg + a PKGBUILD

Also makes the staged `dapi` CLI wrapper platform-aware so it resolves
the app binary on Linux (it previously hardcoded the macOS
Contents/MacOS path), and adds `publish-linux` / `publish-arch` jobs to
the release workflow.
Add a Download badge and an Install section covering the deb, rpm, Arch,
and AppImage artifacts, plus build instructions for contributors.
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Tsurgcom is attempting to deploy a commit to the Diffusion Studio Team on Vercel.

A member of the Team first needs to authorize it.

@Tsurgcom Tsurgcom mentioned this pull request Aug 31, 2026
@Tsurgcom

Copy link
Copy Markdown
Author

We got all of the infinity stones (distros) 🚀

@Tsurgcom Tsurgcom left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I looked through the code.

zbcoding added a commit to zbcoding/editor that referenced this pull request Sep 4, 2026
Dry-running the deb and rpm makers against the packaged tree, rather than
trusting their config, turned up two builds that could never have
succeeded, and comparing notes with diffusionstudio#42 turned up a third:

- The deb had no `Maintainer`, one of the five fields dpkg-deb requires.
  It defaults to `package.json`'s `author`, which this workspace does not
  set, and the control template silently omits the field when it is
  undefined - so the release job would have failed on its first run.
- `@electron-forge/maker-rpm` (electron-installer-redhat 3.4.0) writes a
  spec whose `%install` runs `cp -r usr/*` relative to the build
  directory. rpm 4.20 moved that directory, so the copy fails on Fedora
  41+ and on recent Debian and Ubuntu
  (electron-userland/electron-installer-redhat#343, electron/forge#3701).
  Diagnosed in diffusionstudio#42, which worked around it with a hand-written spec; this
  patches the template through the patch-package setup the repo already
  runs, so the maker keeps generating dependencies and metadata.
- MakerZIP shells out to `zip`, which is not installed everywhere. Named
  in the README with the other per-maker tools, and installed in CI.

Arch Linux support comes from diffusionstudio#42: it has no Electron Forge maker, so a
script stages the forge output and runs makepkg. The PKGBUILD drops the
launcher shim that PR needed, because the Linux executable is renamed to
`diffusion-studio` and /usr/bin can link straight to it, and it puts
`dapi` on PATH directly, which a package can do and the AppImage cannot.

All four formats now install one desktop entry, kept in packaging/linux
so the makers and the PKGBUILD cannot drift: two of the three formats in
diffusionstudio#42 registered `x-scheme-handler/diffusion` and the deb did not, which
is the difference between the auth and checkout deep links working and
silently doing nothing.

The CLI install dialog now only claims `dapi` is ready to run when the
link target is on the session PATH, and otherwise says which directory
to add - Debian and Fedora put ~/.local/bin there, Arch does not.

Co-authored-by: Tsurg <info@tsurg.com>
@zbcoding

zbcoding commented Sep 4, 2026

Copy link
Copy Markdown

Added export fixes and more.
#58

I opened #58 for Linux support before spotting this PR. It covers packaging too, plus the mp4 export failure (Chromium has no AAC encoder on Linux, so every template's audio: { codec: "aac" } kills the export after the video track has started), dapi open/dapi fonts, and the missing app menu.

I folded your work into #58 with a Co-authored-by on the commit and a section crediting this PR:

Two things I did differently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants