Skip to content

Commit a37813e

Browse files
committed
feat(release): publish a Linux .deb alongside the AppImage
Linux users can only install T3 Code from an AppImage today, which means no desktop entry, no icon, no dependency resolution, and no package manager integration unless they wire it up themselves. The build script already forwarded `--target` to electron-builder, but a deb build aborted because fpm requires a project homepage and a `Name <email>` maintainer that the generated config never set. Adding those two fields makes `--target deb` work, and the release workflow now repackages the already-compiled Linux app into a .deb and attaches it to the GitHub Release. electron-builder writes update metadata for every fpm target, so the deb build would clobber the AppImage updater manifest. Since Linux auto-update only supports the AppImage, the workflow stashes and restores that manifest around the deb step. Built and verified locally on Ubuntu 24.04: correct control fields, all nine hicolor icon sizes, valid desktop entry, and every declared dependency resolvable. Generated with claude-opus-5 running in opencode.
1 parent a8e05cb commit a37813e

6 files changed

Lines changed: 75 additions & 2 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,37 @@ jobs:
573573
574574
vp run dist:desktop:artifact "${args[@]}"
575575
576+
- name: Build Linux deb package
577+
if: matrix.platform == 'linux'
578+
shell: bash
579+
run: |
580+
set -euo pipefail
581+
shopt -s nullglob
582+
583+
# electron-builder writes update metadata for every fpm target, so the
584+
# deb build would overwrite the AppImage updater manifest. Linux
585+
# auto-update only supports the AppImage, so stash the manifest and put
586+
# it back once the deb is packaged.
587+
manifest_backup="$RUNNER_TEMP/linux-update-manifest"
588+
mkdir -p "$manifest_backup"
589+
for manifest in release/*-linux*.yml; do
590+
cp "$manifest" "$manifest_backup/"
591+
done
592+
593+
# --skip-build reuses the app compiled by the previous step; this only
594+
# reruns packaging.
595+
vp run dist:desktop:artifact \
596+
--platform linux \
597+
--target deb \
598+
--arch "${{ matrix.arch }}" \
599+
--build-version "${{ needs.preflight.outputs.version }}" \
600+
--skip-build \
601+
--verbose
602+
603+
for manifest in "$manifest_backup"/*.yml; do
604+
cp "$manifest" release/
605+
done
606+
576607
- name: Collect release assets
577608
shell: bash
578609
run: |
@@ -584,6 +615,7 @@ jobs:
584615
"release/*.dmg" \
585616
"release/*.zip" \
586617
"release/*.AppImage" \
618+
"release/*.deb" \
587619
"release/*.exe" \
588620
"release/*.blockmap" \
589621
"release/*.yml"; do
@@ -804,6 +836,7 @@ jobs:
804836
release-assets/*.dmg
805837
release-assets/*.zip
806838
release-assets/*.AppImage
839+
release-assets/*.deb
807840
release-assets/*.exe
808841
release-assets/*.blockmap
809842
release-assets/*.yml
@@ -824,6 +857,7 @@ jobs:
824857
release-assets/*.dmg
825858
release-assets/*.zip
826859
release-assets/*.AppImage
860+
release-assets/*.deb
827861
release-assets/*.exe
828862
release-assets/*.blockmap
829863
release-assets/*.yml

‎docs/operations/release.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ This document covers the unified release workflow for stable and nightly desktop
1111
- manual `workflow_dispatch` for either channel
1212
- Runs quality gates first: lint, typecheck, test.
1313
- Reads the shared production T3 Connect relay URL and Clerk client configuration before packaging clients.
14-
- Builds four artifacts in parallel for both channels:
14+
- Builds four platform bundles in parallel for both channels:
1515
- macOS `arm64` DMG
1616
- macOS `x64` DMG
17-
- Linux `x64` AppImage
17+
- Linux `x64` AppImage, plus a `.deb` repackaged from the same build
1818
- Windows `x64` NSIS installer
1919
- Publishes one GitHub Release with all produced files.
2020
- Stable tags with a suffix after `X.Y.Z` (for example `1.2.3-alpha.1`) are published as GitHub prereleases.
@@ -194,6 +194,12 @@ guidance when those environments are available.
194194
- platform installers (`.exe`, `.dmg`, `.AppImage`, plus macOS `.zip` for Squirrel.Mac update payloads)
195195
- channel metadata: `latest*.yml` for stable releases, `nightly*.yml` for nightly releases
196196
- `*.blockmap` files (used for differential downloads)
197+
- Linux packaging note:
198+
- The `.deb` is published for installation only; `DesktopUpdates` disables in-app
199+
updates unless the app is running from the AppImage.
200+
- `electron-builder` rewrites `latest-linux.yml` for every fpm target, so the
201+
workflow restores the AppImage manifest after building the `.deb`. Without
202+
that, the updater would advertise a `.deb` the app refuses to install.
197203
- macOS metadata note:
198204
- `electron-updater` reads `latest-mac.yml` on stable and `nightly-mac.yml` on nightly, for both Intel and Apple Silicon.
199205
- The workflow merges the per-arch mac manifests into one channel-specific mac manifest before publishing the GitHub Release.

‎docs/reference/scripts.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- `vp run dist:desktop:dmg` — Builds a shareable macOS `.dmg` into `./release`.
1919
- `vp run dist:desktop:dmg:x64` — Builds an Intel macOS `.dmg`.
2020
- `vp run dist:desktop:linux` — Builds a Linux AppImage into `./release`.
21+
- `vp run dist:desktop:linux:deb` — Builds a Linux `.deb` into `./release`.
2122
- `vp run dist:desktop:win` — Builds a Windows NSIS installer into `./release`.
2223

2324
## Desktop `.dmg` packaging notes

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"dist:desktop:dmg:arm64": "node scripts/build-desktop-artifact.ts --platform mac --target dmg --arch arm64",
3737
"dist:desktop:dmg:x64": "node scripts/build-desktop-artifact.ts --platform mac --target dmg --arch x64",
3838
"dist:desktop:linux": "node scripts/build-desktop-artifact.ts --platform linux --target AppImage --arch x64",
39+
"dist:desktop:linux:deb": "node scripts/build-desktop-artifact.ts --platform linux --target deb --arch x64",
3940
"dist:desktop:win": "node scripts/build-desktop-artifact.ts --platform win --target nsis",
4041
"dist:desktop:win:arm64": "node scripts/build-desktop-artifact.ts --platform win --target nsis --arch arm64",
4142
"dist:desktop:win:x64": "node scripts/build-desktop-artifact.ts --platform win --target nsis --arch x64",

‎scripts/build-desktop-artifact.test.ts‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,29 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
356356
}).pipe(Effect.provide(ConfigProvider.layer(ConfigProvider.fromEnv({ env: {} })))),
357357
);
358358

359+
it.effect("supplies the package maintainer that fpm-backed Linux targets require", () =>
360+
Effect.gen(function* () {
361+
const linux = yield* createBuildConfig(
362+
"linux",
363+
"deb",
364+
"1.2.3",
365+
false,
366+
false,
367+
undefined,
368+
undefined,
369+
);
370+
const linuxConfig = linux.linux as {
371+
readonly target: ReadonlyArray<string>;
372+
readonly maintainer?: string;
373+
};
374+
375+
assert.deepStrictEqual(linuxConfig.target, ["deb"]);
376+
// electron-builder's FpmTarget aborts the build unless it can resolve a
377+
// `Name <email>` maintainer, so this is what keeps deb/rpm buildable.
378+
assert.match(linuxConfig.maintainer ?? "", /^.+ <[^@\s]+@[^@\s]+>$/u);
379+
}).pipe(Effect.provide(ConfigProvider.layer(ConfigProvider.fromEnv({ env: {} })))),
380+
);
381+
359382
it.effect("preserves both Linux icon resize failures with structural context", () => {
360383
const commands: Array<{ readonly command: string; readonly args: ReadonlyArray<string> }> = [];
361384

‎scripts/build-desktop-artifact.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
3636

3737
const LINUX_ICON_SIZES = [16, 22, 24, 32, 48, 64, 128, 256, 512] as const;
3838
const DESKTOP_APP_ID = "com.t3tools.t3code";
39+
// fpm-backed Linux targets (deb, rpm) refuse to build without a project URL and
40+
// a `Name <email>` maintainer; AppImage never asked for either. The maintainer
41+
// string becomes both the deb Maintainer and Vendor fields.
42+
const DESKTOP_HOMEPAGE = "https://t3.codes";
43+
const DESKTOP_LINUX_MAINTAINER = "pingdotgg <[email protected]>";
3944
const APPLE_TEAM_ID_PATTERN = /^[A-Z0-9]{10}$/u;
4045

4146
const BuildPlatform = Schema.Literals(["mac", "linux", "win"]);
@@ -617,6 +622,7 @@ interface StagePackageJson {
617622
readonly packageManager: string;
618623
readonly description: string;
619624
readonly author: string;
625+
readonly homepage: string;
620626
readonly main: string;
621627
readonly build: Record<string, unknown>;
622628
readonly dependencies: Record<string, unknown>;
@@ -1589,6 +1595,7 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
15891595
executableName: "t3code",
15901596
icon: "icons",
15911597
category: "Development",
1598+
maintainer: DESKTOP_LINUX_MAINTAINER,
15921599
desktop: {
15931600
entry: {
15941601
StartupWMClass: "t3code",
@@ -1911,6 +1918,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
19111918
packageManager: rootPackageJson.packageManager,
19121919
description: "T3 Code desktop build",
19131920
author: "T3 Tools",
1921+
homepage: DESKTOP_HOMEPAGE,
19141922
main: "apps/desktop/dist-electron/main.cjs",
19151923
build: yield* createBuildConfig(
19161924
options.platform,

0 commit comments

Comments
 (0)