Skip to content

Commit a81713a

Browse files
benthecarmanclaude
andcommitted
feat(desktop): Add a Linux .deb to releases
Linux shipped only the AppImage, leaving users who install through a package manager without a supported path: no desktop entry, no /usr/bin entry, and no dpkg/apt upgrades. electron-builder builds the .deb from the same staged app as the AppImage, so the release gains a package without a second build. The AppImage stays the artifact that self-updates in place; .deb installs upgrade through their package manager instead, which is what the updater already reports on non-AppImage Linux. The .deb also needs metadata the AppImage never required: a project homepage, which electron-builder reads only from the packaged app's manifest, and an RFC 822 maintainer address for the control file. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent e482960 commit a81713a

6 files changed

Lines changed: 64 additions & 3 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ jobs:
608608
"release/*.dmg" \
609609
"release/*.zip" \
610610
"release/*.AppImage" \
611+
"release/*.deb" \
611612
"release/*.exe" \
612613
"release/*.blockmap" \
613614
"release/*.yml"; do
@@ -836,6 +837,7 @@ jobs:
836837
release-assets/*.dmg
837838
release-assets/*.zip
838839
release-assets/*.AppImage
840+
release-assets/*.deb
839841
release-assets/*.exe
840842
release-assets/*.blockmap
841843
release-assets/*.yml
@@ -856,6 +858,7 @@ jobs:
856858
release-assets/*.dmg
857859
release-assets/*.zip
858860
release-assets/*.AppImage
861+
release-assets/*.deb
859862
release-assets/*.exe
860863
release-assets/*.blockmap
861864
release-assets/*.yml

‎apps/marketing/src/pages/download.astro‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ import { ANDROID_PLAY_STORE_URL, IOS_APP_STORE_URL } from "../lib/site";
5656
<span class="card-arch">x86_64</span>
5757
<span class="card-format">AppImage</span>
5858
</a>
59+
<a class="download-card" data-asset="amd64.deb" href={RELEASES_URL}>
60+
<span class="card-arch">Debian, Ubuntu (x86_64)</span>
61+
<span class="card-format">.deb</span>
62+
</a>
5963
</div>
6064
</section>
6165

‎docs/internals/scripts.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ authenticated.
6767
- `vp run dist:desktop:dmg`: Builds a shareable macOS `.dmg` into `./release`. Architecture defaults
6868
to the host, so this produces an arm64 DMG on Apple Silicon. Use `dist:desktop:dmg:arm64` or
6969
`dist:desktop:dmg:x64`, or pass `--arch <arm64|x64|universal>`, to force one.
70-
- `vp run dist:desktop:linux`: Builds a Linux AppImage into `./release`.
70+
- `vp run dist:desktop:linux`: Builds a Linux AppImage and `.deb` into `./release`.
7171
- `vp run dist:desktop:win`: Builds a Windows NSIS installer into `./release`. `:arm64` and `:x64`
7272
variants exist.
7373

‎docs/operations/release.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This document covers the unified release workflow for stable and nightly desktop
1616
- Builds four artifacts in parallel for both channels:
1717
- macOS `arm64` DMG
1818
- macOS `x64` DMG
19-
- Linux `x64` AppImage
19+
- Linux `x64` AppImage plus a `.deb` package built from the same job
2020
- Windows `x64` NSIS installer
2121
- Publishes one GitHub Release with all produced files.
2222
- Stable tags with a suffix after `X.Y.Z` (for example `1.2.3-alpha.1`) are published as GitHub prereleases.
@@ -205,6 +205,7 @@ guidance when those environments are available.
205205
- otherwise `GITHUB_REPOSITORY` from GitHub Actions.
206206
- Required release assets for updater:
207207
- platform installers (`.exe`, `.dmg`, `.AppImage`, plus macOS `.zip` for Squirrel.Mac update payloads)
208+
- the Linux `.deb` ships in the same release but is a manual-install package; in-app updates on Linux stay AppImage-only, so `.deb` users upgrade with `dpkg`/`apt`
208209
- channel metadata: `latest*.yml` for stable releases, `nightly*.yml` for nightly releases
209210
- `*.blockmap` files (used for differential downloads)
210211
- macOS metadata note:

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ import {
1616
DESKTOP_ELECTRON_LANGUAGES,
1717
DESKTOP_FILE_EXCLUSIONS,
1818
DESKTOP_EXTRA_RESOURCES,
19+
DESKTOP_LINUX_MAINTAINER,
1920
InvalidMacPasskeyRpDomainError,
2021
InvalidMacPasskeyPublishableKeyError,
2122
InvalidMockUpdateServerPortError,
2223
UnsupportedDesktopBuildArchitectureError,
2324
isMacPasskeySigningConfigurationError,
25+
LINUX_APPIMAGE_COMPANION_TARGETS,
2426
LinuxIconResizeError,
2527
MacPasskeySigningConfigurationResolutionError,
2628
MissingMacPasskeyProvisioningProfileError,
@@ -356,6 +358,41 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
356358
}).pipe(Effect.provide(ConfigProvider.layer(ConfigProvider.fromEnv({ env: {} })))),
357359
);
358360

361+
it.effect("packages a companion .deb alongside the Linux AppImage", () =>
362+
Effect.gen(function* () {
363+
const appImage = yield* createBuildConfig(
364+
"linux",
365+
"AppImage",
366+
"1.2.3",
367+
false,
368+
false,
369+
undefined,
370+
undefined,
371+
);
372+
const debOnly = yield* createBuildConfig(
373+
"linux",
374+
"deb",
375+
"1.2.3",
376+
false,
377+
false,
378+
undefined,
379+
undefined,
380+
);
381+
382+
assert.deepStrictEqual((appImage.linux as { target: ReadonlyArray<string> }).target, [
383+
"AppImage",
384+
...LINUX_APPIMAGE_COMPANION_TARGETS,
385+
]);
386+
assert.deepStrictEqual((debOnly.linux as { target: ReadonlyArray<string> }).target, ["deb"]);
387+
388+
// fpm refuses to build a .deb without a maintainer address.
389+
for (const config of [appImage, debOnly]) {
390+
assert.equal((config.linux as { maintainer: string }).maintainer, DESKTOP_LINUX_MAINTAINER);
391+
}
392+
assert.match(DESKTOP_LINUX_MAINTAINER, /^.+ <[^@\s]+@[^@\s]+>$/u);
393+
}).pipe(Effect.provide(ConfigProvider.layer(ConfigProvider.fromEnv({ env: {} })))),
394+
);
395+
359396
it.effect("preserves both Linux icon resize failures with structural context", () => {
360397
const commands: Array<{ readonly command: string; readonly args: ReadonlyArray<string> }> = [];
361398

‎scripts/build-desktop-artifact.ts‎

Lines changed: 17 additions & 1 deletion
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+
export const DESKTOP_HOMEPAGE_URL = "https://github.com/pingdotgg/t3code";
40+
// Debian control files need an RFC 822 maintainer address. Reuses the project
41+
// identity the server already commits checkpoints under (see GitVcsDriver), so
42+
// the contact survives team changes.
43+
export const DESKTOP_LINUX_MAINTAINER = "T3 Tools <[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>;
@@ -627,6 +633,9 @@ interface StagePackageJson {
627633

628634
export const STAGE_INSTALL_ARGS = ["install", "--prod"] as const;
629635
export const DESKTOP_ELECTRON_LANGUAGES = ["en-US"] as const;
636+
// Extra Linux packages built alongside the AppImage. electron-builder produces
637+
// them from the same staged app, so the release only pays the packaging cost.
638+
export const LINUX_APPIMAGE_COMPANION_TARGETS = ["deb"] as const;
630639
export const DESKTOP_FILE_EXCLUSIONS = [
631640
// T3 Code always passes the user's installed Claude executable to the SDK,
632641
// so the SDK's optional platform packages (each a ~200MB bundled executable)
@@ -1585,7 +1594,11 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
15851594

15861595
if (platform === "linux") {
15871596
buildConfig.linux = {
1588-
target: [target],
1597+
// The AppImage stays the download that self-updates in place; a companion
1598+
// .deb from the same build serves users who install through dpkg/apt and
1599+
// upgrade there instead.
1600+
target: target === "AppImage" ? [target, ...LINUX_APPIMAGE_COMPANION_TARGETS] : [target],
1601+
maintainer: DESKTOP_LINUX_MAINTAINER,
15891602
executableName: "t3code",
15901603
icon: "icons",
15911604
category: "Development",
@@ -1911,6 +1924,9 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
19111924
packageManager: rootPackageJson.packageManager,
19121925
description: "T3 Code desktop build",
19131926
author: "T3 Tools",
1927+
// The .deb control file requires a project URL, and electron-builder only
1928+
// reads it from the packaged app's metadata (never from the build config).
1929+
homepage: DESKTOP_HOMEPAGE_URL,
19141930
main: "apps/desktop/dist-electron/main.cjs",
19151931
build: yield* createBuildConfig(
19161932
options.platform,

0 commit comments

Comments
 (0)