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 22, 20:45 UTC
ci(release): build Windows x64 on Linux like arm64 (#22584)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 20, 2026 at 18:16 UTC
569bd029ea446414f0bba171713ac290532dd58d
3 files changed
+28
-110
.github/workflows/release-desktop.yml
+15
-99
@@ -99,6 +99,11 @@ on:
99
required: true
100
type: string
101
102
+# electron-builder leaves the default arch (x64) out of the unpacked app's
103
+# directory name.
104
+env:
105
+ UNPACKED_DIR: ${{ inputs.platform }}-${{ inputs.arch != 'x64' && format('{0}-', inputs.arch) || '' }}unpacked
106
+
107
permissions:
108
# Windows builds read this run's artifact list to wait for the Linux CLI archive.
109
actions: read
@@ -136,17 +141,11 @@ jobs:
141
git sparse-checkout set --no-cone '/*' '!/.repos/'
142
git -c checkout.workers=0 checkout --detach FETCH_HEAD
143
139
- # Windows installs straight from the registry. There, linking the packages
140
- # takes the time, not downloading them, so a ~700 MB package cache did not
141
- # pay for its own restore. Across recent nightlies, restore plus install
142
- # took 183-233s on arm64 and 116-172s on x64, while a plain install took
143
- # 142-210s and 84-160s. The arm64 entries also filled 4 GB of the
144
- # repository's 10 GB Actions cache.
144
- name: Setup Vite+
145
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
146
with:
147
node-version-file: package.json
149
- cache: ${{ runner.os != 'Windows' }}
148
+ cache: true
149
run-install: false
150
151
# pnpm checks the lockfile and policy before reusing this result. A missing
@@ -215,28 +214,8 @@ jobs:
214
name: js-bundle
215
path: apps
216
218
- # Only the resource monitor build needs these libraries. With a cached
219
- # monitor, the desktop build's preflight skips its MSVC check, and node-pty
220
- # ships prebuilt Windows binaries, so the 30-60s install is skipped too.
221
- - name: Install Spectre-mitigated MSVC libs
222
- if: runner.os == 'Windows' && steps.resource_monitor_cache.outputs.cache-hit != 'true'
223
- shell: pwsh
224
- run: |
225
- $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
226
- $installPath = & $vswhere -products * -latest -property installationPath
227
- $setupExe = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe"
228
- $proc = Start-Process -FilePath $setupExe `
229
- -ArgumentList "modify", "--installPath", "`"$installPath`"", "--add", `
230
- "Microsoft.VisualStudio.Component.VC.Runtimes.${{ inputs.arch == 'arm64' && 'ARM64' || 'x86.x64' }}.Spectre", "--quiet", "--norestart" `
231
- -Wait -PassThru -NoNewWindow
232
- if ($null -eq $proc -or $proc.ExitCode -ne 0) {
233
- $code = if ($null -ne $proc) { $proc.ExitCode } else { 1 }
234
- Write-Error "Visual Studio Installer failed with exit code $code"
235
- exit $code
236
- }
237
-
217
- name: Install cargo-xwin
239
- if: runner.os != 'Windows' && inputs.platform == 'win' && steps.resource_monitor_cache.outputs.cache-hit != 'true'
218
+ if: inputs.platform == 'win' && steps.resource_monitor_cache.outputs.cache-hit != 'true'
219
uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2
220
with:
221
tool: cargo-xwin@0.23.1
@@ -246,74 +225,12 @@ jobs:
225
- name: Build resource monitor
226
if: steps.resource_monitor_cache.outputs.cache-hit != 'true'
227
shell: bash
249
- run: cargo ${{ runner.os != 'Windows' && inputs.platform == 'win' && 'xwin build' || 'build' }} --locked --release --manifest-path native/resource-monitor/Cargo.toml --target "${{ inputs.rust_target }}"
250
-
251
- - name: Prepare Azure Trusted Signing
252
- if: inputs.platform == 'win' && runner.os == 'Windows'
253
- shell: pwsh
254
- env:
255
- AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
256
- AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
257
- AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
258
- AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
259
- AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
260
- AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
261
- AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
262
- run: |
263
- $ErrorActionPreference = "Stop"
264
-
265
- $requiredSecrets = @(
266
- $env:AZURE_TENANT_ID,
267
- $env:AZURE_CLIENT_ID,
268
- $env:AZURE_CLIENT_SECRET,
269
- $env:AZURE_TRUSTED_SIGNING_ENDPOINT,
270
- $env:AZURE_TRUSTED_SIGNING_ACCOUNT_NAME,
271
- $env:AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME,
272
- $env:AZURE_TRUSTED_SIGNING_PUBLISHER_NAME
273
- )
274
- if ($requiredSecrets | Where-Object { [string]::IsNullOrWhiteSpace($_) }) {
275
- Write-Host "Azure Trusted Signing disabled; skipping TrustedSigning module preparation."
276
- exit 0
277
- }
278
-
279
- try {
280
- Install-PackageProvider `
281
- -Name NuGet `
282
- -MinimumVersion 2.8.5.201 `
283
- -Force `
284
- -Scope CurrentUser `
285
- -ErrorAction Stop
286
- } catch {
287
- Write-Warning "Could not bootstrap NuGet package provider. Continuing because the runner may already have a usable provider. $($_.Exception.Message)"
288
- }
289
-
290
- Install-Module `
291
- -Name TrustedSigning `
292
- -MinimumVersion 0.5.0 `
293
- -Force `
294
- -AllowClobber `
295
- -Repository PSGallery `
296
- -Scope CurrentUser `
297
- -ErrorAction Stop
298
-
299
- Import-Module TrustedSigning -MinimumVersion 0.5.0 -Force
300
- Get-Command Invoke-TrustedSigning -ErrorAction Stop
301
-
302
- $moduleRoots = @(
303
- [System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "PowerShell", "Modules"),
304
- [System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "WindowsPowerShell", "Modules"),
305
- [System.IO.Path]::Combine($env:ProgramFiles, "PowerShell", "Modules"),
306
- [System.IO.Path]::Combine($env:ProgramFiles, "WindowsPowerShell", "Modules")
307
- )
308
- $modulePathEntries = @($moduleRoots + ($env:PSModulePath -split ";")) |
309
- Where-Object { $_ -and (Test-Path $_) } |
310
- Select-Object -Unique
311
- "PSModulePath=$($modulePathEntries -join ';')" >> $env:GITHUB_ENV
228
+ run: cargo ${{ inputs.platform == 'win' && 'xwin build' || 'build' }} --locked --release --manifest-path native/resource-monitor/Cargo.toml --target "${{ inputs.rust_target }}"
229
230
# Off Windows, scripts/lib/windows-jsign.ts signs through jsign instead of
231
# the TrustedSigning PowerShell module.
232
- name: Install jsign
316
- if: inputs.platform == 'win' && runner.os != 'Windows'
233
+ if: inputs.platform == 'win'
234
shell: bash
235
run: |
236
set -euo pipefail
@@ -338,9 +255,8 @@ jobs:
255
256
# The single-executable is built with a Node that supports --build-sea
257
# (25.7+); the repo itself stays on the engines.node version. A native
341
- # build injects into the runner's own Node: tsdown's cross-target download
342
- # path runs `tar` on a drive-letter path on Windows, which GNU tar reads as
343
- # a remote host. Off Windows, a Windows target downloads its node.exe.
258
+ # build injects into the runner's own Node; a Windows target downloads its
259
+ # node.exe.
260
- name: Build CLI single-executable
261
if: inputs.cli_archive
262
shell: bash
@@ -352,7 +268,7 @@ jobs:
268
# The executable bundles the server again, so it needs the same stamp
269
# as release.yml's JS bundle.
270
T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && inputs.release_channel || 'dev' }}
355
- run: node apps/server/scripts/cli.ts build-exe --verbose ${{ runner.os != 'Windows' && inputs.platform == 'win' && format('--target win-{0}', inputs.arch) || '' }}
271
+ run: node apps/server/scripts/cli.ts build-exe --verbose ${{ inputs.platform == 'win' && format('--target win-{0}', inputs.arch) || '' }}
272
273
- name: Import macOS signing certificate for the CLI archive
274
if: inputs.cli_archive && inputs.platform == 'mac'
@@ -614,7 +530,7 @@ jobs:
530
run: |
531
set -euo pipefail
532
mkdir -p verify
617
- unpacked=$(ls -d "${TMPDIR:-/tmp}"/t3code-desktop-${{ inputs.platform }}-stage-*/app/dist/${{ inputs.platform }}-${{ inputs.arch }}-unpacked)
533
+ unpacked=$(ls -d "${TMPDIR:-/tmp}"/t3code-desktop-${{ inputs.platform }}-stage-*/app/dist/"$UNPACKED_DIR")
534
tar -C "$(dirname "$unpacked")" -cf verify/unpacked.tar "$(basename "$unpacked")"
535
esbuild=scripts/node_modules/.bin/esbuild
536
banner="import{createRequire as __cr}from'node:module';const require=__cr(import.meta.url);"
@@ -734,7 +650,7 @@ jobs:
650
set -euo pipefail
651
tar -C verify -xf verify/unpacked.tar
652
node verify/verify-windows-desktop-artifact.mjs \
737
- --app-dir "$(cygpath -w "$PWD/verify/${{ inputs.platform }}-${{ inputs.arch }}-unpacked")" \
653
+ --app-dir "$(cygpath -w "$PWD/verify/$UNPACKED_DIR")" \
654
--arch "${{ inputs.arch }}" --build-version "${{ inputs.version }}" --verbose
655
656
- name: Smoke-test CLI archive
@@ -749,7 +665,7 @@ jobs:
665
- name: Smoke-test resource monitor
666
shell: bash
667
env:
752
- MONITOR: verify/${{ inputs.platform }}-${{ inputs.arch }}-unpacked/resources/resource-monitor/t3-resource-monitor.exe
668
+ MONITOR: verify/${{ env.UNPACKED_DIR }}/resources/resource-monitor/t3-resource-monitor.exe
669
EXPECTED_ARCH: ${{ inputs.arch == 'arm64' && 'aarch64' || 'x86_64' }}
670
run: |
671
node --input-type=module <<'EOF'
.github/workflows/release.yml
+10
-8
@@ -573,8 +573,9 @@ jobs:
573
if-no-files-found: error
574
retention-days: 1
575
576
- # One job per platform and architecture (see release-desktop.yml), each on
577
- # hardware of its own architecture, and each gated only on the JS bundle.
576
+ # One job per platform and architecture (see release-desktop.yml), each
577
+ # gated only on the JS bundle. Windows targets build on Linux and run their
578
+ # native checks on a Windows runner of their own architecture.
579
# The Windows jobs also embed the same-arch Linux CLI archive as the WSL
580
# runtime; they wait for that artifact partway through instead of for the
581
# whole Linux job. Every job builds the desktop app; all but macOS x64 also
@@ -677,9 +678,11 @@ jobs:
678
resource_key: linux-arm64
679
cli_archive: true
680
680
- # The Windows jobs start with the other platforms. Their checkout, install,
681
- # and toolchain setup take longer than the same-arch Linux job needs to
682
- # upload its CLI archive, so the wait inside is usually instant.
681
+ # The Windows jobs start with the other platforms and wait for the same-arch
682
+ # Linux CLI archive after their other setup. Packaging is mostly CPU and
683
+ # small-file work, which Linux runners do faster than Windows ones, so both
684
+ # Windows targets build and sign on Linux and only the native checks run on
685
+ # Windows.
686
desktop_win_x64:
687
name: Desktop Windows x64
688
needs: [preflight, relay_public_config, build_bundle]
@@ -695,7 +698,8 @@ jobs:
698
clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
699
relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
700
label: Windows x64
698
- runner: blacksmith-32vcpu-windows-2025
701
+ runner: blacksmith-16vcpu-ubuntu-2404
702
+ verify_runner: windows-2025
703
platform: win
704
target: nsis
705
arch: x64
@@ -703,8 +707,6 @@ jobs:
707
resource_key: win32-x64
708
cli_archive: true
709
706
- # Windows arm64 runners have 4 vCPUs, and the packaging is mostly CPU-bound,
707
- # so the build runs on Linux and only the native checks run on arm64.
710
desktop_win_arm64:
711
name: Desktop Windows arm64
712
needs: [preflight, relay_public_config, build_bundle]
docs/operations/release.md
+3
-3
@@ -31,7 +31,7 @@ the version.
31
- Runs lint, typecheck, and tests alongside artifact builds. Publishing waits for every check.
32
- Reads the shared production T3 Connect relay URL and Clerk client configuration before packaging clients.
33
- Builds the platform-independent JS (server bundle, web client, Electron main) once in the `build_bundle` job and hands it to every platform job as the `js-bundle` artifact; the platform jobs only package it, so no runner rebuilds it.
34
-- Builds six desktop artifacts in parallel for both channels, each as its own job (`desktop_<platform>_<arch>`, one call of `release-desktop.yml`), gated only on the bundle. Every target builds on hardware of its own architecture except Windows arm64: its runners have 4 vCPUs, so it builds and signs (with jsign) on a Linux runner, and a `windows-11-arm` job runs the packaged natives and the CLI archive (`verify_runner`). The Windows jobs embed the same-arch Linux CLI archive as the WSL runtime and wait for that artifact partway through, not for the whole Linux job:
34
+- Builds six desktop artifacts in parallel for both channels, each as its own job (`desktop_<platform>_<arch>`, one call of `release-desktop.yml`), gated only on the bundle. macOS and Linux targets build on hardware of their own architecture. Both Windows targets build and sign (with jsign) on a Linux runner, which packages faster than Windows runners, and a Windows job of the target's architecture (`windows-2025` or `windows-11-arm`, the `verify_runner`) runs the packaged natives and the CLI archive. The Windows jobs embed the same-arch Linux CLI archive as the WSL runtime and wait for that artifact partway through, not for the whole Linux job:
35
- macOS `arm64` DMG
36
- macOS `x64` DMG
37
- Linux `x64` and `arm64` AppImage and `.deb`, from one electron-builder run. The `.deb` updates in the app through electron-updater, which installs it with `dpkg`.
@@ -42,11 +42,11 @@ the version.
42
- Nightly runs are always GitHub prereleases and never marked latest.
43
- Automatically generated release notes are pinned to the previous tag in the same channel, so stable compares to the previous stable tag and nightly compares to the previous nightly tag.
44
- Includes Electron auto-update metadata (for example `latest*.yml`, `nightly*.yml`, and `*.blockmap`) in release assets.
45
-- Builds a self-contained CLI archive per platform (`t3-<version>-<platform>-<arch>.tar.gz`, `.zip` on Windows) in the same job as that target's desktop artifact and attaches them to the GitHub Release with a `SHA256SUMS` file, on every channel, for five targets: macOS arm64, Linux x64 and arm64, Windows x64 and arm64. Every archive is smoke-tested on hardware of its own architecture, and every one but Windows arm64 is also built and signed there. There is no macOS x64 archive: Node single-executables are unsupported on x64 macOS (the SEA docs list macOS as arm64 only) and the binary segfaults on start; the x64 desktop app is Electron and unaffected.
45
+- Builds a self-contained CLI archive per platform (`t3-<version>-<platform>-<arch>.tar.gz`, `.zip` on Windows) in the same job as that target's desktop artifact and attaches them to the GitHub Release with a `SHA256SUMS` file, on every channel, for five targets: macOS arm64, Linux x64 and arm64, Windows x64 and arm64. Every archive is smoke-tested on hardware of its own architecture, and every one but the Windows archives is also built and signed there. There is no macOS x64 archive: Node single-executables are unsupported on x64 macOS (the SEA docs list macOS as arm64 only) and the binary segfaults on start; the x64 desktop app is Electron and unaffected.
46
- The archive holds the server as a Node single-executable (`scripts/build-cli-archive.ts`), so unpacking it needs neither Node, npm, nor a compiler. It is the only form in which T3 Code manages a runtime: the desktop's SSH environments, the boot service, `t3 update`, and the install scripts all download and verify this archive against `SHA256SUMS`. The `t3` npm package exists for people who run `npx t3` or `npm install -g t3` themselves, and it downloads this same archive too; nothing in the product installs from npm. The `curl | sh` installers are `scripts/install.sh` and `scripts/install.ps1`; the marketing site copies them into its `public/` at build time (`apps/marketing/scripts/stage-install-scripts.mjs`) and serves them at `t3.codes/install.sh` and `/install.ps1`.
47
- The executable is built with a Node that supports `--build-sea` (`VP_NODE_VERSION=26.8.2`, kept in step with `SEA_NODE_VERSION` in `apps/server/vite.config.ts`), while the repo stays on `engines.node`.
48
- macOS archives are signed with the Developer ID certificate and notarized when the Apple secrets are present (ad hoc otherwise, which still runs from `curl`/`tar` installs). Windows executables use the same Azure Trusted Signing setup as the installer. Every native addon in the macOS archive is signed too, since the hardened runtime refuses unsigned libraries.
49
- - Each archive is extracted and executed (`scripts/smoke-cli-archive.ts`) on its build runner, or on the `verify_runner` for Windows arm64.
49
+ - Each archive is extracted and executed (`scripts/smoke-cli-archive.ts`) on its build runner, or on the `verify_runner` for Windows.
50
- After the GitHub Release is published, publishes the `t3` npm package with OIDC trusted publishing from the same workflow file. It is only a launcher (`scripts/npm-launcher/t3.mjs`): on first run it downloads its exact version's CLI archive from the GitHub Release, verifies it against `SHA256SUMS`, and unpacks it into `<T3 home>/runtime/versions/<version>`, the layout the install scripts and `t3 update` share. The executables are not on npm. They used to be, as `@t3code/t3-<platform>-<arch>` optional dependencies, but npm's publish-time scanning held those 80-250 MB packages back for up to an hour after the launcher was live, and every install in that window got a launcher with no executable. Those packages stay on npm at their old versions and get no new ones. Because the launcher reads from the release, `publish_cli` runs after `release`, never before.
51
- stable releases publish npm dist-tag `latest`
52
- nightly releases publish npm dist-tag `nightly`