Skip to content

feat(packaging): build .deb and .rpm packages#2466

Merged
charlesvien merged 3 commits into
mainfrom
georges/linux-publish-deb-rpm
Jun 4, 2026
Merged

feat(packaging): build .deb and .rpm packages#2466
charlesvien merged 3 commits into
mainfrom
georges/linux-publish-deb-rpm

Conversation

@gantoine
Copy link
Copy Markdown
Member

@gantoine gantoine commented Jun 2, 2026

What

Adds .deb and .rpm Linux packages to the release, alongside the existing AppImage and zip.

  • forge.config.ts: add MakerDeb and MakerRpm. Both declare mimeType: ["x-scheme-handler/posthog-code"], so installing registers the posthog-code:// deep-link handler system-wide via the generated .desktop file + the package manager's update-desktop-database trigger (the same mechanism VS Code's deb/rpm use). Package name/bin yield /usr/bin/posthog-code, consistent with the AUR package.
  • package.json / lockfile: add @electron-forge/maker-deb and @electron-forge/maker-rpm.
  • code-release.yml: the publish-linux job (x64 + arm64) now installs fakeroot (maker-deb) and rpm (maker-rpm), so both arches build and upload automatically.
  • scripts/build-linux-docker.sh: install fakeroot + rpm so local pnpm --filter code make:linux doesn't break on the new makers, and add optional --target/--targets (aliases: deb, rpm, zip, appimage, or a full maker package name) to build a subset.

Why

Native Arch/Debian/Fedora-style installs that also register the URL scheme handler at install time, so the browser can launch the app after login without runtime registration.

Testing / validation

  • forge.config.ts typechecks against the real maker types (no errors from the new blocks).
  • Confirmed the makers' default dependency lists are Electron-version-gated, so the stale libgconf/GConf2 dep is excluded for our Electron — packages should be installable with default deps on modern Ubuntu/Debian/Fedora.
  • build-linux-docker.sh target parser validated under bash across flag/=/comma/env forms (case-insensitive, rejects unknowns).
  • Not yet built end-to-end here (needs a full Linux app build); the first CI run produces real artifacts. Smoke-test with apt-get install ./*.deb / dnf install ./*.rpm and xdg-mime query default x-scheme-handler/posthog-code.

Notes

  • AUR packaging is a separate branch/PR (georges/linux-publish-aur).
  • AppImage scheme registration (no install step) remains an open question — VS Code doesn't register from its portable build either.

🤖 Generated with Claude Code

Add MakerDeb and MakerRpm to the Electron Forge config so Linux releases
also produce .deb and .rpm packages alongside the AppImage and zip. Both
declare mimeType x-scheme-handler/posthog-code, so installing registers the
posthog-code:// deep-link handler system-wide via the generated .desktop
file and the package manager's update-desktop-database trigger. The package
name/bin yield /usr/bin/posthog-code, consistent with the AUR package.

The publish-linux CI job (x64 + arm64) now installs fakeroot (maker-deb)
and rpm (maker-rpm), so both arches are built and uploaded automatically.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gantoine gantoine requested a review from Copilot June 4, 2026 18:57
@gantoine gantoine marked this pull request as ready for review June 4, 2026 18:57
@gantoine gantoine requested a review from a team June 4, 2026 18:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds native Linux packaging to the Electron Forge release pipeline by introducing .deb and .rpm makers, wiring required build tooling into CI and the local Docker build script, and updating dependencies/lockfile accordingly.

Changes:

  • Add Electron Forge MakerDeb and MakerRpm configuration (including URL scheme MIME registration).
  • Update Linux build environments (CI + local Docker script) to install fakeroot and rpm, and allow selecting specific maker targets.
  • Add new maker dependencies to package.json and pnpm-lock.yaml.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds lock entries for new Electron Forge maker dependencies.
apps/code/scripts/build-linux-docker.sh Installs deb/rpm tooling in container and adds target selection flag parsing.
apps/code/package.json Adds @electron-forge/maker-deb and @electron-forge/maker-rpm devDependencies.
apps/code/forge.config.ts Registers deb/rpm makers and configures package metadata + scheme handler MIME type.
.github/workflows/code-release.yml Installs fakeroot and rpm in the Linux publish workflow.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/code/scripts/build-linux-docker.sh Outdated
Comment thread apps/code/forge.config.ts Outdated
Comment thread apps/code/forge.config.ts Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 4, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/forge.config.ts:211-239
Nine of the eleven options in `MakerDeb` and `MakerRpm` are identical. Extracting the shared fields into a single constant satisfies the OnceAndOnlyOnce rule and makes a future field change (e.g. updating the description or homepage) a one-line edit rather than two.

```suggestion
    new MakerDeb({
      options: {
        ...sharedLinuxOptions,
        section: "devel",
        maintainer: "PostHog <eng@posthog.com>",
      },
    }),
    new MakerRpm({
      options: {
        ...sharedLinuxOptions,
        license: "MIT",
      },
    }),
```

Reviews (1): Last reviewed commit: "feat(packaging): build .deb and .rpm pac..." | Re-trigger Greptile

Comment thread apps/code/forge.config.ts
gantoine and others added 2 commits June 4, 2026 15:37
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@charlesvien charlesvien merged commit d451156 into main Jun 4, 2026
18 checks passed
@charlesvien charlesvien deleted the georges/linux-publish-deb-rpm branch June 4, 2026 21:24
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.

3 participants