The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 08:45 UTC
Handle prerelease tags in GitHub release publishing (#344)
* Handle prerelease tags when publishing GitHub releases - Derive `is_prerelease` and `make_latest` from the version format in preflight - Mark suffixed versions (for example `1.2.3-alpha.1`) as prereleases - Keep only plain `X.Y.Z` releases marked as latest - Document prerelease/latest behavior in `docs/release.md` * Force desktop auto-updates to stable latest channel - set Electron updater channel to `latest` - disable prerelease and downgrade updates regardless of app version
Theo Browne committed
Mar 7, 2026 at 04:05 UTC
b74c7a79abbfbb7f6e8c5c4affb20784cea2b11c
3 files changed
+19
-2
.github/workflows/release.yml
+11
-1
@@ -22,6 +22,8 @@ jobs:
22
outputs:
23
version: ${{ steps.release_meta.outputs.version }}
24
tag: ${{ steps.release_meta.outputs.tag }}
25
+ is_prerelease: ${{ steps.release_meta.outputs.is_prerelease }}
26
+ make_latest: ${{ steps.release_meta.outputs.make_latest }}
27
ref: ${{ github.sha }}
28
steps:
29
- name: Checkout
@@ -45,6 +47,13 @@ jobs:
47
48
echo "version=$version" >> "$GITHUB_OUTPUT"
49
echo "tag=v$version" >> "$GITHUB_OUTPUT"
50
+ if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
51
+ echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
52
+ echo "make_latest=true" >> "$GITHUB_OUTPUT"
53
+ else
54
+ echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
55
+ echo "make_latest=false" >> "$GITHUB_OUTPUT"
56
+ fi
57
58
- name: Setup Bun
59
uses: oven-sh/setup-bun@v2
@@ -260,7 +269,8 @@ jobs:
269
target_commitish: ${{ needs.preflight.outputs.ref }}
270
name: T3 Code v${{ needs.preflight.outputs.version }}
271
generate_release_notes: true
263
- make_latest: true
272
+ prerelease: ${{ needs.preflight.outputs.is_prerelease }}
273
+ make_latest: ${{ needs.preflight.outputs.make_latest }}
274
files: |
275
release-assets/*.dmg
276
release-assets/*.zip
apps/desktop/src/main.ts
+6
-1
@@ -58,6 +58,8 @@ const LOG_FILE_MAX_FILES = 10;
58
const APP_RUN_ID = Crypto.randomBytes(6).toString("hex");
59
const AUTO_UPDATE_STARTUP_DELAY_MS = 15_000;
60
const AUTO_UPDATE_POLL_INTERVAL_MS = 4 * 60 * 60 * 1000;
61
+const DESKTOP_UPDATE_CHANNEL = "latest";
62
+const DESKTOP_UPDATE_ALLOW_PRERELEASE = false;
63
64
type DesktopUpdateErrorContext = DesktopUpdateState["errorContext"];
65
@@ -725,7 +727,10 @@ function configureAutoUpdater(): void {
727
728
autoUpdater.autoDownload = false;
729
autoUpdater.autoInstallOnAppQuit = false;
728
- autoUpdater.allowPrerelease = app.getVersion().includes("-");
730
+ // Keep alpha branding, but force all installs onto the stable update track.
731
+ autoUpdater.channel = DESKTOP_UPDATE_CHANNEL;
732
+ autoUpdater.allowPrerelease = DESKTOP_UPDATE_ALLOW_PRERELEASE;
733
+ autoUpdater.allowDowngrade = false;
734
let lastLoggedDownloadMilestone = -1;
735
736
autoUpdater.on("checking-for-update", () => {
docs/release.md
+2
@@ -12,6 +12,8 @@ This document covers how to run desktop releases from one tag, first without sig
12
- Linux `x64` AppImage
13
- Windows `x64` NSIS installer
14
- Publishes one GitHub Release with all produced files.
15
+ - Versions with a suffix after `X.Y.Z` (for example `1.2.3-alpha.1`) are published as GitHub prereleases.
16
+ - Only plain `X.Y.Z` releases are marked as the repository's latest release.
17
- Includes Electron auto-update metadata (for example `latest*.yml` and `*.blockmap`) in release assets.
18
- Publishes the CLI package (`apps/server`, npm package `t3`) with OIDC trusted publishing.
19
- Signing is optional and auto-detected per platform from secrets.