Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

release.md

525 lines31.8 KB

1# Release Checklist
2​
3> For maintainers. Using T3 Code? See [docs/user](../user/).
4​
5This document covers the unified release workflow for stable and nightly desktop releases.
6​
7## What the workflow does
8​
9- Workflow: `.github/workflows/release.yml`
10- Triggers:
11 - manual `workflow_dispatch` with `channel=stable`, the normal way to ship stable. Stable
12 and nightly dispatches must select `main`; preview may select any branch. The channel defaults
13 to preview so an omitted selection cannot publish a stable release.
14 - push tag matching `v*.*.*` for a stable release of an explicit commit
15 - scheduled nightly check every 30 minutes
16 - manual `workflow_dispatch` with `channel=nightly`
17 - manual `workflow_dispatch` with `channel=preview`, the maintainers' test train. It exercises the whole release flow (build, sign, notarize, smoke, publish) for a commit that end users must never receive, which is how an unmerged branch or a risky change gets a real release run before it lands. It builds the triggering commit with nightly's versioning under the `preview` prerelease identifier (`0.0.41-preview.<date>.<run>`) and publishes a GitHub prerelease plus the npm packages under the `preview` dist-tag. Preview is not on the schedule, no default npm dist-tag points at it, its desktop builds carry no update feed, and no updater manifest (`latest*.yml`, `nightly*.yml`, blockmaps) is attached, so a stable or nightly install cannot be offered one. The only ways onto it are downloading the release by hand, `npx t3@preview`, `T3CODE_CHANNEL=preview` for the install scripts, or `t3 update --channel preview` from a terminal; each prints a warning, and the CLI asks for confirmation when the running build is not itself a preview. The release itself is named as a maintainer test build and its body is a warning rather than generated notes: a changelog of unmerged branch history is not a changelog, and nightly and stable notes are unaffected because each series resolves its previous tag within its own channel. The hosted web app, AUR, and Discord announcements are skipped. Keep it; it costs nothing when idle.
18- A manual stable release builds the commit of the latest published nightly, not `main` HEAD.
19 Nightly is the release candidate: verify the nightly, then promote it. Merges to `main` keep
20 landing while you verify and never leak into the stable build.
21 - The version defaults to the one the nightly previewed (`0.0.39-nightly.*` ships as `0.0.39`).
22 Pass the `version` input to override it, for example for a minor bump.
23 - The stable tag is created on the nightly's commit when the GitHub Release is published.
24 - Pushing a `vX.Y.Z` tag by hand still works and builds exactly the tagged commit. Use it when
25 the commit to ship is not the latest nightly, such as a cherry-picked fix on a release branch.
26- Runs lint, typecheck, and tests alongside artifact builds. Publishing waits for every check.
27- Reads the shared production T3 Connect relay URL and Clerk client configuration before packaging clients.
28- 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.
29- Builds six desktop artifacts in parallel for both channels, each as its own job (`desktop_<platform>_<arch>`, one call of `release-desktop.yml`) on hardware of its own architecture, gated only on the bundle (the Windows jobs also wait for the same-arch Linux job, whose CLI archive they embed as the WSL runtime):
30 - macOS `arm64` DMG
31 - macOS `x64` DMG
32 - Linux `x64` and `arm64` AppImage
33 - Windows `x64` and `arm64` NSIS installer
34- Publishes one GitHub Release with all produced files.
35 - Stable tags with a suffix after `X.Y.Z` (for example `1.2.3-alpha.1`) are published as GitHub prereleases.
36 - Only plain stable `X.Y.Z` releases are marked as the repository's latest release.
37 - Nightly runs are always GitHub prereleases and never marked latest.
38 - 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.
39- Includes Electron auto-update metadata (for example `latest*.yml`, `nightly*.yml`, and `*.blockmap`) in release assets.
40- 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 built, signed, and smoke-tested on hardware of its own architecture. 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.
41 - 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 npm packages exist for people who run `npx t3` or `npm install -g t3` themselves and carry the same archive contents; 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`.
42 - 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`.
43 - 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.
44 - Each archive is extracted and executed on its build runner (`scripts/smoke-cli-archive.ts`) before it is uploaded.
45- Publishes the CLI to npm with OIDC trusted publishing from the same workflow file, as the same bytes the GitHub Release carries: `scripts/build-npm-platform-packages.ts` unpacks the five CLI archives into `@t3code/t3-<platform>-<arch>` packages (each with `os`/`cpu` set so npm installs only the matching one) and generates the `t3` launcher, whose `bin/t3.js` lists them as `optionalDependencies` and execs the installed executable. `npx t3` therefore needs Node only to run the launcher, never to run the server. `node apps/server/scripts/cli.ts publish` publishes the platform packages first and the launcher last, after a `--dry-run` pass over all of them so an auth or scope error fails before anything is live.
46 - stable releases publish npm dist-tag `latest`
47 - nightly releases publish npm dist-tag `nightly`
48 - preview releases publish npm dist-tag `preview`, which nothing resolves unless asked for by name
49 - one-time setup: the `@t3code` npm scope (org) must exist, and `t3` and each `@t3code/t3-<platform>-<arch>` package needs a trusted publisher registered for this workflow file (see below).
50- Deploys the hosted web app to Vercel only after a release is published:
51 - stable releases are aliased to the `latest` hosted app channel
52 - nightly releases are aliased to the `nightly` hosted app channel
53- Signing is optional and auto-detected per platform from secrets.
54​
55## Pull request macOS previews
56​
57Labeling a PR `preview:mac` publishes a signed, notarized Apple Silicon DMG with T3 Connect enabled
58to the rolling `desktop-preview` prerelease, and works for fork PRs. The label is a one-shot request
59for the commit it is applied to: the trusted workflow removes it once the build is in hand, and later
60pushes do not build until a maintainer applies it again. Every signed preview is therefore a
61per-commit maintainer decision, which matters because the result carries the Developer ID signature.
62Vouching a contributor lets their labeled commits be signed; it is not a standing grant. The build is
63split so the Developer ID certificate never shares a job with PR code:
64​
65- `.github/workflows/desktop-macos-preview.yml` runs on `pull_request` with no secrets and builds
66 only the JS bundle from the PR (the same `js-bundle` artifact `release.yml` produces).
67- `.github/workflows/desktop-macos-preview-publish.yml` runs on `workflow_run` from `main`. It
68 refuses unless the PR is open, still labeled, its head is the built commit, and the author is a
69 bot, a collaborator, or listed in `.github/VOUCHED.td` (read from the default branch, so a PR cannot vouch
70 for itself). It then packages and signs the bundle through `release-desktop.yml` checked out at
71 `main`, so packaging, native helpers, and the Electron/desktop dependencies come from `main`, not
72 the PR. Only the version and the public T3 Connect identifiers in `.env.example` are read from the
73 PR commit, as data, so the signed app's passkey entitlement matches the bundle. A PR that changes
74 packaging must use the `channel=preview` release train above instead.
75​
76Before handing the bundle to the signing runner, the trusted workflow validates its ZIP entries
77and accepts only regular files under `server/dist` and `desktop/dist-electron`, plus the directory
78entries that lead to those roots. The artifact cannot
79overwrite packaging code or installed dependencies. The bundle is copied into the app, never executed,
80on the signing runner. The
81`pull_request_target` cleanup job in the publish workflow removes the download when the PR closes, or
82when the label is removed by hand before a build consumed it, and never checks out PR code.
83​
84## Required release credentials
85​
86Stable releases require these GitHub Actions secrets in addition to the platform and deployment
87credentials documented below:
88​
89- `RELEASE_APP_ID`
90- `RELEASE_APP_PRIVATE_KEY`
91​
92The finalize job uses them to commit and push aligned package versions to `main` as the Release App.
93GitHub Release publication uses the repository-scoped workflow token so it has a rate-limit quota
94independent from the shared Release App installation.
95​
96## T3 Connect relay deployment
97​
98The relay is a shared control plane versioned separately from client releases. Stable and nightly
99client builds must point at the same relay so users see the same linked environments when switching
100release channels.
101​
102`.github/workflows/deploy-relay.yml` deploys Alchemy stage `prod` on every push to `main`. The
103release workflow reads the relay URL and Clerk client configuration from the existing `production`
104GitHub Actions environment before building desktop, CLI, or hosted web artifacts.
105​
106Required repository variables shared by relay deployments:
107​
108- `CLOUDFLARE_ACCOUNT_ID`
109- `PLANETSCALE_ORGANIZATION`
110- `AXIOM_ORG_ID`
111​
112Required repository secrets shared by relay deployments:
113​
114- `CLOUDFLARE_API_TOKEN`
115- `PLANETSCALE_API_TOKEN_ID`
116- `PLANETSCALE_API_TOKEN`
117- `AXIOM_TOKEN`
118​
119Required `production` environment variables:
120​
121- `RELAY_API_ZONE_NAME`
122- `RELAY_TUNNEL_ZONE_NAME`
123- `CLERK_PUBLISHABLE_KEY`
124- `CLERK_JWT_AUDIENCE`
125- `CLERK_JWT_TEMPLATE`
126- `CLERK_CLI_OAUTH_CLIENT_ID`
127- `APNS_ENVIRONMENT`
128- `APNS_TEAM_ID`
129- `APNS_KEY_ID`
130- `APNS_BUNDLE_ID`
131​
132Optional `production` environment variables:
133​
134- `RELAY_DOMAIN` when overriding the derived `relay.<RELAY_API_ZONE_NAME>` domain
135- `RELAY_TUNNEL_CLEANUP_MODE` with `off`, `dry-run`, or `enabled`. Missing and blank values use
136 `off`.
137​
138Required `production` environment secrets:
139​
140- `CLERK_SECRET_KEY`
141- `APNS_PRIVATE_KEY`
142​
143The account-scoped repository credentials are consumed by Alchemy while provisioning relay stages; they
144are not bound into the relay Worker. The production deployment uses an Axiom personal access token,
145so `AXIOM_ORG_ID` must accompany `AXIOM_TOKEN`. The `prod` stage owns the retained PlanetScale
146database. Local personal stages provision isolated branches from it and are never deployed by CI.
147Production adopts the configured relay API and tunnel DNS zones as retained Cloudflare resources.
148Personal stages reference the production-owned zones.
149​
150Developers deploy personal stages locally rather than through pull-request automation:
151​
152```sh
153vp run --filter t3code-relay deploy -- --stage "$USER" --env-file .env.local
154```
155​
156### Managed tunnel cleanup rollout
157​
158Keep `RELAY_TUNNEL_CLEANUP_MODE=off` for the first production deploy. That deploy applies the
159nullable allocation migration and adds the recovery endpoints. Web and mobile clients need no
160coordinated release. CLI and desktop server builds must reach users before cleanup is enabled,
161because those builds register recovery and replace a deleted tunnel after wake.
162​
1631. Deploy the relay and migration with cleanup `off`.
1642. Release the server build and confirm current hosts register recovery. Older hosts stay marked
165 legacy and are never candidates.
1663. Set `dry-run`, deploy, and read the sweep counters (`scanned`, `wouldDelete`, `skippedLegacy`,
167 `skippedOrphan`, `failed`, `truncated`) across several sweeps.
1684. Run the disposable-host canary below.
1695. Set `enabled` only after the canary recovers without a server restart.
170​
171The job runs every five minutes with a five-minute grace period for tunnels that lost their
172connector, so a candidate is usually removed five to ten minutes after it goes down. Tunnels that
173never connected wait an hour. One sweep attempts at most 100 deletions, so a backlog takes longer.
174`RELAY_TUNNEL_CLEANUP_MODE` is read at deploy time. Changing it, including turning cleanup off during
175an incident, needs a relay deploy.
176​
177To roll back, set cleanup to `off` and deploy the relay before downgrading any host. Keep the
178recovery endpoints deployed while current server builds are in use. The nullable columns can stay.
179​
180### Disposable-host canary
181​
182This test has not been run against a real Cloudflare account. Run it against a disposable relay
183stage, test Cloudflare account, disposable host, and disposable T3 home. Keep production cleanup at
184`off` or `dry-run` until it passes. Do not stop a daily-use T3 server.
185​
1861. Deploy the disposable stage with cleanup `dry-run`. Link a first disposable environment through
187 web or mobile settings and confirm its tunnel is healthy and recovery is registered.
1882. Stop that host and restart the same T3 home on a different local port. Confirm the public
189 hostname reaches the new port and sends nothing to the old one.
1903. Link a second disposable environment with a server build that predates recovery registration.
191 Capture its managed `cloudflared` child PID, confirm it belongs to that host, and pause only that
192 child with `kill -STOP <legacy-pid>`. Wait until Cloudflare reports it down for over five minutes.
1934. Capture the first environment's `cloudflared` child PID from its server logs, confirm ownership,
194 and pause it with `kill -STOP <first-pid>`. Wait until Cloudflare reports it down for over five
195 minutes.
1965. Confirm dry-run counts the first tunnel in `wouldDelete` and the second in `skippedLegacy`.
1976. Set cleanup `enabled` on the disposable stage and deploy. Confirm in the test Cloudflare account
198 that the first tunnel is deleted and the legacy tunnel still exists.
1997. Resume the first child with `kill -CONT <first-pid>`. Confirm the running server detects the
200 repeated rejection, requests recovery, and becomes reachable at the same hostname without a
201 restart.
2028. Resume the legacy child with `kill -CONT <legacy-pid>` and confirm its tunnel reconnects.
2039. Repeat with a physical sleep and wake cycle on a disposable laptop before broad rollout.
204​
205## Marketing site deployment
206​
207After a nightly release is published, the release workflow deploys the same commit
208to the marketing site's Vercel production project. Stable releases do not deploy
209the marketing site because they can promote an older nightly commit.
210​
211The job looks up the `t3code-marketing` project using the existing `VERCEL_TOKEN`
212and `VERCEL_ORG_ID` secrets. It also respects the optional `VERCEL_TEAM_SLUG`
213variable. The Vercel project's root directory must be `apps/marketing`.
214Git deployments remain disabled in `apps/marketing/vercel.ts`.
215​
216## Hosted web app release deployment
217​
218The hosted app is intentionally not deployed by Vercel's Git integration. The
219web project disables automatic Git deployments in `apps/web/vercel.ts` via
220`git.deploymentEnabled: false`, and `.github/workflows/release.yml` deploys the
221web app with Vercel CLI after the GitHub Release succeeds.
222​
223Required GitHub Actions secrets:
224​
225- `VERCEL_TOKEN`
226- `VERCEL_ORG_ID`
227- `VERCEL_PROJECT_ID`
228​
229Optional GitHub Actions variables:
230​
231- `VERCEL_TEAM_SLUG`: overrides the Vercel CLI scope when the team slug is preferred over the `VERCEL_ORG_ID` secret.
232- `T3CODE_WEB_ROUTER_URL`: defaults to `https://app.t3.codes`.
233- `T3CODE_WEB_LATEST_DOMAIN`: defaults to `latest.app.t3.codes`.
234- `T3CODE_WEB_NIGHTLY_DOMAIN`: defaults to `nightly.app.t3.codes`.
235​
236Required Vercel domains:
237​
238- `app.t3.codes`: the router domain users open, updated by stable releases.
239- `latest.app.t3.codes`: channel alias updated by stable releases.
240- `nightly.app.t3.codes`: channel alias updated by nightly releases.
241​
242The router domain uses `apps/web/vercel.ts` routes. Users opt into a channel by
243visiting `/__t3code/channel?channel=latest` or
244`/__t3code/channel?channel=nightly`; the router stores the
245`t3code_web_channel` cookie and rewrites future requests on `app.t3.codes` to
246the matching channel alias.
247​
248The release deploy job rewrites release package versions before upload so the
249hosted app's About panel renders the release version. Stable deploys alias the
250same deployment to both the `latest` channel and the router domain so the router
251rules stay current. Nightly deploys only alias the `nightly` channel. The job
252also passes `VITE_HOSTED_APP_CHANNEL=latest|nightly`, which renders the hosted
253update track selector in the About panel. Changing the selector navigates
254through `/__t3code/channel` on the router domain so the user's channel cookie is
255updated before redirecting to the hosted app root.
256​
257One-time Vercel dashboard setup:
258​
2591. Confirm the web project root directory remains `apps/web`.
2602. Add the three domains above to the web project.
2613. Disable automatic Git deployments in the dashboard if desired; the committed
262 `vercel.ts` setting is the source-of-truth, but disconnecting Git in the
263 dashboard is also safe.
2644. Run one stable release deployment, or manually alias the current stable
265 deployment, so `app.t3.codes` points at a deployment containing the router
266 rules in `apps/web/vercel.ts`. Future stable releases keep this alias current.
267​
268## Nightly builds
269​
270- Workflow: `.github/workflows/release.yml`
271- Triggers:
272 - scheduled check every 30 minutes
273 - manual `workflow_dispatch` with `channel=nightly`
274- Automatic nightlies require new commits and at least six hours since the last nightly was published, including manual nightlies.
275- Manual nightlies bypass the time and change checks. Nightly runs remain serialized. Scheduled runs wait for an active nightly to finish, then check the publication gap before building.
276- Runs the same desktop quality gates and artifact matrix as the tagged release flow.
277- Publishes a GitHub prerelease only:
278 - current tag format: `vX.Y.Z-nightly.YYYYMMDD.<run_number>`
279 - `nightly-v...` is accepted only as a legacy previous-nightly tag
280 - release name includes the short commit SHA
281 - `make_latest` is always `false`
282- Uses the next stable patch version as the nightly base. For example, `0.0.17` produces nightlies on `0.0.18-nightly.*`.
283- Publishes Electron auto-update metadata to the dedicated `nightly` updater channel, so desktop users can opt into that track independently from stable.
284- Publishes the CLI npm packages (`t3` and `@t3code/t3-<platform>-<arch>`) to the `nightly` npm dist-tag using the same nightly version.
285- Does not commit version bumps back to `main`.
286​
287## Server self-update release invariant
288​
289Connected servers update to the client's exact version, not to an npm dist-tag. Every released
290desktop or hosted client version must therefore have a matching `t3@<version>` package available on
291npm before users can receive that client.
292​
293The workflow enforces this ordering:
294​
2951. `publish_cli` publishes the exact release version to npm, on every channel.
2962. `release` depends on `publish_cli` before exposing desktop artifacts in GitHub Releases.
2973. `deploy_web` depends on `release` before moving the hosted channel to the new client.
298​
299Preserve these dependencies when changing the release graph. Publishing a client first would leave
300the **Update server** action targeting a package version that does not exist yet.
301​
302For a release smoke test, confirm `npm view t3@<version> version` returns the expected version, then
303connect the new client to a server on the previous version and verify that the update action
304reconnects to the matching server. When the release adds database migrations, verify that the
305remote update applies them and reconnects. A failed trial must restore the database snapshot and
306restart the previous server. If the installed launcher does not support the target protocol,
307verify that the update stops before restart and run `npx t3@<version> service update` once on the
308server machine. Also test the manual or desktop-managed guidance when those environments are
309available.
310​
311## Desktop auto-update notes
312​
313- Updater runtime: `apps/desktop/src/updates/DesktopUpdates.ts`.
314- `electron-updater` adapter: `apps/desktop/src/electron/ElectronUpdater.ts`.
315- `apps/desktop/src/main.ts` only wires the updater layers into the desktop runtime.
316- Update UX:
317 - Background checks run on startup delay + interval.
318 - No automatic download or install.
319 - The desktop UI shows a rocket update button when an update is available; click once to download, click again after download to restart/install.
320- Provider: GitHub Releases (`provider: github`) configured at build time.
321- Repository slug source:
322 - `T3CODE_DESKTOP_UPDATE_REPOSITORY` (format `owner/repo`), if set.
323 - otherwise `GITHUB_REPOSITORY` from GitHub Actions.
324- Required release assets for updater:
325 - platform installers (`.exe`, `.dmg`, `.AppImage`, plus macOS `.zip` for Squirrel.Mac update payloads)
326 - channel metadata: `latest*.yml` for stable releases, `nightly*.yml` for nightly releases
327 - `*.blockmap` files (used for differential downloads)
328- macOS metadata note:
329 - `electron-updater` reads `latest-mac.yml` on stable and `nightly-mac.yml` on nightly, for both Intel and Apple Silicon.
330 - The workflow merges the per-arch mac manifests into one channel-specific mac manifest before publishing the GitHub Release.
331​
332### Windows payload topology and update validation
333​
334Windows packages the bundled server and only its runtime-external/native
335dependency closure in `resources/server.asar`. Native modules and helper
336executables declared as unpacked by that archive must be present at the matching
337paths below `resources/server.asar.unpacked`. The Windows-native backend reads
338the archive in place through Electron. Packaged Windows builds also ship
339`resources/wsl-runtime.tar.gz` plus its SHA-256 sidecar: the Linux CLI archive
340(`t3-<version>-linux-<arch>.tar.gz`, the same arch as the Windows host) built
341by the Linux desktop job and handed to the Windows desktop build as
342`--wsl-runtime`, copied in verbatim so WSL runs the exact bytes a Linux user
343downloads. WSL verifies and extracts that archive
344into `~/.t3/wsl-runtime/sha256-<archive-digest>` inside the selected distro,
345then reuses it for later launches of the same update.
346​
347Windows keeps JavaScript and package metadata inside `app.asar` and unpacks only
348native libraries and helper executables. Avoid enabling whole-package smart
349unpacking: each loose file adds work to NSIS installation and counts against
350the payload limit.
351​
352The artifact builder rejects a Windows package when any of these invariants
353break:
354​
355- `resources/server.asar` is absent or does not contain the server entry.
356- Any file marked unpacked in the ASAR header is absent from
357 `resources/server.asar.unpacked`.
358- On same-architecture Windows builds, the packaged primary cannot load the fff
359 native library from inside `server.asar` through its `.unpacked` sibling.
360- The isolated, extracted sidecar cannot load the server entry with plain Node.
361- A Windows build given `--wsl-runtime` omits the WSL archive or SHA-256
362 sidecar, or the sidecar digest does not match the emitted archive.
363- The emitted WSL archive is not a Linux CLI release archive: it must unpack to
364 a single `t3-<version>-linux-<arch>` directory holding `t3`, `client/`, and
365 `node_modules/` with the Linux node-pty binary, and must not carry a loose
366 server bundle (`bin.mjs`).
367- The external Windows resource monitor is absent.
368- The unpacked Windows application contains more than 80 files.
369​
370Cross-architecture Windows builds retain every structural and extracted-sidecar
371check, but skip executing the target Electron binary. A same-architecture build
372for each release target must exercise the primary native-load probe.
373​
374NSIS differential packaging remains enabled. A sidecar layout transition can
375produce a larger one-time download; subsequent small releases retain their
376blockmaps, with a 60 MB maximum for a representative sidecar-to-sidecar update.
377​
378## 0) npm OIDC trusted publishing setup (CLI)
379​
380The workflow runs `node scripts/build-npm-platform-packages.ts` on the downloaded CLI archives, then
381`node apps/server/scripts/cli.ts publish --packages-dir npm-packages`, which runs `npm publish` on
382each `@t3code/t3-<platform>-<arch>.tgz` and finally on `t3.tgz`, the launcher. The script publishes
383tarballs it built itself rather than directories: `npm publish <dir>` strips `node_modules/` from the
384tarball no matter what `files` says, and the executable loads its native addons from there. Seven
385packages are published per release: `t3`, `@t3code/t3-darwin-arm64`, `@t3code/t3-darwin-x64`,
386`@t3code/t3-linux-arm64`, `@t3code/t3-linux-x64`, `@t3code/t3-win32-arm64`,
387`@t3code/t3-win32-x64`.
388​
389Checklist:
390​
3911. Confirm the npm org owns package `t3` and the `@t3code` scope exists on npm (create the org if
392 it does not).
3932. For `t3` and each `@t3code/t3-<platform>-<arch>` package, configure a Trusted Publisher in the
394 npm package settings (a package that has never been published needs a first publish or a
395 placeholder before the setting exists; the `--dry-run` step in `publish_cli` reports which
396 names are still rejected):
397 - Provider: GitHub Actions
398 - Repository: this repo
399 - Workflow file: `.github/workflows/release.yml`
400 - Environment (if used): match your npm trusted publishing config
4013. Ensure npm account and org policies allow trusted publishing for every package.
4024. Create release tag `vX.Y.Z` and push; workflow will:
403 - build and smoke-test the five CLI archives
404 - build the npm packages from those archives
405 - publish them with npm dist-tag `latest`
4065. Nightly runs publish with npm dist-tag `nightly`; preview runs with `preview`.
407​
408## 1) Release validation and unsigned builds
409​
410There is no dry-run tag path. Pushing any accepted non-nightly tag, including
411`v0.0.0-test.1`, classifies the run as the stable channel. It publishes `t3` with npm dist-tag
412`latest`, creates a real GitHub Release, aliases the hosted app to `latest.app.t3.codes` and
413`app.t3.codes`, and can commit a version bump to `main` in the finalize job. Do not push a test tag
414to validate the workflow.
415​
416The workflow has no non-publishing `workflow_dispatch` mode. Use normal CI or local quality gates to
417validate checks and builds without shipping. To exercise the complete release graph at lower stable
418risk, manually dispatch `channel=nightly`; this still publishes a real nightly npm package, GitHub
419prerelease, desktop updater release, hosted nightly alias, and marketing site, but it does not update stable app aliases or
420commit a version bump to `main`. Only run it when a real nightly release is acceptable.
421​
422Manual `channel=stable` is also a real stable-channel release. Omitting signing secrets only makes
423platform artifacts unsigned; it does not prevent publication.
424​
425## 2) Apple signing + notarization setup (macOS)
426​
427Required secrets used by the workflow:
428​
429- `CSC_LINK`
430- `CSC_KEY_PASSWORD`
431- `APPLE_API_KEY`
432- `APPLE_API_KEY_ID`
433- `APPLE_API_ISSUER`
434- `MACOS_PROVISIONING_PROFILE` (base64-encoded provisioning profile with Associated Domains)
435​
436Required repository variables:
437​
438- `APPLE_TEAM_ID`
439​
440Optional repository variables:
441​
442- `CLERK_PASSKEY_RP_DOMAINS`: comma-separated RP-domain override. By default, the build derives the
443 domain from the production Clerk publishable key.
444​
445Checklist:
446​
4471. Apple Developer account access:
448 - Team has rights to create Developer ID certificates.
4492. Create an explicit App ID for `com.t3tools.t3code` and enable Associated Domains.
4503. Create a `Developer ID Application` certificate and a compatible provisioning profile for that
451 App ID with Associated Domains enabled.
4524. Export the certificate + private key as `.p12` from Keychain.
4535. Base64-encode the `.p12` and store as `CSC_LINK`.
4546. Base64-encode the provisioning profile and store it as `MACOS_PROVISIONING_PROFILE`.
4557. Store the `.p12` export password as `CSC_KEY_PASSWORD`, and set `APPLE_TEAM_ID` to the
456 10-character Apple Developer Team ID.
4578. In App Store Connect, create an API key (Team key).
4589. Add API key values:
459 - `APPLE_API_KEY`: contents of the downloaded `.p8`
460 - `APPLE_API_KEY_ID`: Key ID
461 - `APPLE_API_ISSUER`: Issuer ID
46210. Complete the Clerk Native API and AASA setup in [T3 Connect setup](./connect-setup.md#desktop-passkeys).
46311. Re-run a tag release and confirm macOS artifacts are signed/notarized and contain the expected
464 `com.apple.developer.associated-domains` entitlement.
465​
466Notes:
467​
468- `APPLE_API_KEY` is stored as raw key text in secrets.
469- The workflow writes it to a temporary `AuthKey_<id>.p8` file at runtime.
470- The workflow decodes `MACOS_PROVISIONING_PROFILE`, validates it with `security cms`, and passes it
471 to the desktop packager.
472​
473## 3) Azure Trusted Signing setup (Windows)
474​
475Required secrets used by the workflow:
476​
477- `AZURE_TENANT_ID`
478- `AZURE_CLIENT_ID`
479- `AZURE_CLIENT_SECRET`
480- `AZURE_TRUSTED_SIGNING_ENDPOINT`
481- `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME`
482- `AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME`
483- `AZURE_TRUSTED_SIGNING_PUBLISHER_NAME`
484​
485Checklist:
486​
4871. Create Azure Trusted Signing account and certificate profile.
4882. Record ATS values:
489 - Endpoint
490 - Account name
491 - Certificate profile name
492 - Publisher name
4933. Create/choose an Entra app registration (service principal).
4944. Grant service principal permissions required by Trusted Signing.
4955. Create a client secret for the service principal.
4966. Add Azure secrets listed above in GitHub Actions secrets.
4977. Re-run a tag release and confirm Windows installer is signed.
498​
499## 4) Ongoing release checklist
500​
5011. Pick the latest nightly and verify it: run the smoke test above against its artifacts and
502 check the nightly channel for regressions.
5032. Dispatch the Release workflow with `channel=stable`. Leave `version` empty unless the version
504 should differ from the one the nightly previewed.
5053. Confirm the `Resolve release commit` notice names the nightly tag and commit you verified. If a
506 newer nightly published in between, the run builds that one instead.
5074. Verify workflow steps:
508 - preflight passes
509 - release quality checks pass
510 - `build_bundle` and all platform builds pass
511 - `publish_cli` publishes the exact release version before the release job
512 - release job uploads expected files
5135. Smoke test downloaded artifacts.
514​
515## 5) Troubleshooting
516​
517- macOS build unsigned when expected signed:
518 - Check all Apple secrets plus `APPLE_TEAM_ID` are populated and non-empty.
519 - Confirm the provisioning profile belongs to `APPLE_TEAM_ID.com.t3tools.t3code` and includes
520 Associated Domains.
521- Windows build unsigned when expected signed:
522 - Check all Azure ATS and auth secrets are populated and non-empty.
523- Build fails with signing error:
524 - Retry with secrets removed to confirm unsigned path still works.
525 - Re-check certificate/profile names and tenant/client credentials.