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

release.md

422 lines20.4 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
12 - push tag matching `v*.*.*` for a stable release of an explicit commit
13 - scheduled nightly check every 30 minutes
14 - manual `workflow_dispatch` with `channel=nightly`
15- A manual stable release builds the commit of the latest published nightly, not `main` HEAD.
16 Nightly is the release candidate: verify the nightly, then promote it. Merges to `main` keep
17 landing while you verify and never leak into the stable build.
18 - The version defaults to the one the nightly previewed (`0.0.39-nightly.*` ships as `0.0.39`).
19 Pass the `version` input to override it, for example for a minor bump.
20 - The stable tag is created on the nightly's commit when the GitHub Release is published.
21 - Pushing a `vX.Y.Z` tag by hand still works and builds exactly the tagged commit. Use it when
22 the commit to ship is not the latest nightly, such as a cherry-picked fix on a release branch.
23- Runs lint, typecheck, and tests alongside artifact builds. Publishing waits for every check.
24- Reads the shared production T3 Connect relay URL and Clerk client configuration before packaging clients.
25- Builds four artifacts in parallel for both channels:
26 - macOS `arm64` DMG
27 - macOS `x64` DMG
28 - Linux `x64` AppImage
29 - Windows `x64` NSIS installer
30- Publishes one GitHub Release with all produced files.
31 - Stable tags with a suffix after `X.Y.Z` (for example `1.2.3-alpha.1`) are published as GitHub prereleases.
32 - Only plain stable `X.Y.Z` releases are marked as the repository's latest release.
33 - Nightly runs are always GitHub prereleases and never marked latest.
34 - 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.
35- Includes Electron auto-update metadata (for example `latest*.yml`, `nightly*.yml`, and `*.blockmap`) in release assets.
36- Publishes the CLI package (`apps/server`, npm package `t3`) with OIDC trusted publishing from the same workflow file:
37 - stable releases publish npm dist-tag `latest`
38 - nightly releases publish npm dist-tag `nightly`
39- Deploys the hosted web app to Vercel only after a release is published:
40 - stable releases are aliased to the `latest` hosted app channel
41 - nightly releases are aliased to the `nightly` hosted app channel
42- Signing is optional and auto-detected per platform from secrets.
43​
44## Required release credentials
45​
46Stable releases require these GitHub Actions secrets in addition to the platform and deployment
47credentials documented below:
48​
49- `RELEASE_APP_ID`
50- `RELEASE_APP_PRIVATE_KEY`
51​
52The finalize job uses them to commit and push aligned package versions to `main` as the Release App.
53GitHub Release publication uses the repository-scoped workflow token so it has a rate-limit quota
54independent from the shared Release App installation.
55​
56## T3 Connect relay deployment
57​
58The relay is a shared control plane versioned separately from client releases. Stable and nightly
59client builds must point at the same relay so users see the same linked environments when switching
60release channels.
61​
62`.github/workflows/deploy-relay.yml` deploys Alchemy stage `prod` on every push to `main`. The
63release workflow reads the relay URL and Clerk client configuration from the existing `production`
64GitHub Actions environment before building desktop, CLI, or hosted web artifacts.
65​
66Required repository variables shared by relay deployments:
67​
68- `CLOUDFLARE_ACCOUNT_ID`
69- `PLANETSCALE_ORGANIZATION`
70- `AXIOM_ORG_ID`
71​
72Required repository secrets shared by relay deployments:
73​
74- `CLOUDFLARE_API_TOKEN`
75- `PLANETSCALE_API_TOKEN_ID`
76- `PLANETSCALE_API_TOKEN`
77- `AXIOM_TOKEN`
78​
79Required `production` environment variables:
80​
81- `RELAY_API_ZONE_NAME`
82- `RELAY_TUNNEL_ZONE_NAME`
83- `CLERK_PUBLISHABLE_KEY`
84- `CLERK_JWT_AUDIENCE`
85- `CLERK_JWT_TEMPLATE`
86- `CLERK_CLI_OAUTH_CLIENT_ID`
87- `APNS_ENVIRONMENT`
88- `APNS_TEAM_ID`
89- `APNS_KEY_ID`
90- `APNS_BUNDLE_ID`
91​
92Optional `production` environment variables:
93​
94- `RELAY_DOMAIN` when overriding the derived `relay.<RELAY_API_ZONE_NAME>` domain
95​
96Required `production` environment secrets:
97​
98- `CLERK_SECRET_KEY`
99- `APNS_PRIVATE_KEY`
100​
101The account-scoped repository credentials are consumed by Alchemy while provisioning relay stages; they
102are not bound into the relay Worker. The production deployment uses an Axiom personal access token,
103so `AXIOM_ORG_ID` must accompany `AXIOM_TOKEN`. The `prod` stage owns the retained PlanetScale
104database. Local personal stages provision isolated branches from it and are never deployed by CI.
105Production adopts the configured relay API and tunnel DNS zones as retained Cloudflare resources.
106Personal stages reference the production-owned zones.
107​
108Developers deploy personal stages locally rather than through pull-request automation:
109​
110```sh
111vp run --filter t3code-relay deploy -- --stage "$USER" --env-file .env.local
112```
113​
114## Marketing site deployment
115​
116After a nightly release is published, the release workflow deploys the same commit
117to the marketing site's Vercel production project. Stable releases do not deploy
118the marketing site because they can promote an older nightly commit.
119​
120The job looks up the `t3code-marketing` project using the existing `VERCEL_TOKEN`
121and `VERCEL_ORG_ID` secrets. It also respects the optional `VERCEL_TEAM_SLUG`
122variable. The Vercel project's root directory must be `apps/marketing`.
123Git deployments remain disabled in `apps/marketing/vercel.ts`.
124​
125## Hosted web app release deployment
126​
127The hosted app is intentionally not deployed by Vercel's Git integration. The
128web project disables automatic Git deployments in `apps/web/vercel.ts` via
129`git.deploymentEnabled: false`, and `.github/workflows/release.yml` deploys the
130web app with Vercel CLI after the GitHub Release succeeds.
131​
132Required GitHub Actions secrets:
133​
134- `VERCEL_TOKEN`
135- `VERCEL_ORG_ID`
136- `VERCEL_PROJECT_ID`
137​
138Optional GitHub Actions variables:
139​
140- `VERCEL_TEAM_SLUG`: overrides the Vercel CLI scope when the team slug is preferred over the `VERCEL_ORG_ID` secret.
141- `T3CODE_WEB_ROUTER_URL`: defaults to `https://app.t3.codes`.
142- `T3CODE_WEB_LATEST_DOMAIN`: defaults to `latest.app.t3.codes`.
143- `T3CODE_WEB_NIGHTLY_DOMAIN`: defaults to `nightly.app.t3.codes`.
144​
145Required Vercel domains:
146​
147- `app.t3.codes`: the router domain users open, updated by stable releases.
148- `latest.app.t3.codes`: channel alias updated by stable releases.
149- `nightly.app.t3.codes`: channel alias updated by nightly releases.
150​
151The router domain uses `apps/web/vercel.ts` routes. Users opt into a channel by
152visiting `/__t3code/channel?channel=latest` or
153`/__t3code/channel?channel=nightly`; the router stores the
154`t3code_web_channel` cookie and rewrites future requests on `app.t3.codes` to
155the matching channel alias.
156​
157The release deploy job rewrites release package versions before upload so the
158hosted app's About panel renders the release version. Stable deploys alias the
159same deployment to both the `latest` channel and the router domain so the router
160rules stay current. Nightly deploys only alias the `nightly` channel. The job
161also passes `VITE_HOSTED_APP_CHANNEL=latest|nightly`, which renders the hosted
162update track selector in the About panel. Changing the selector navigates
163through `/__t3code/channel` on the router domain so the user's channel cookie is
164updated before redirecting to the hosted app root.
165​
166One-time Vercel dashboard setup:
167​
1681. Confirm the web project root directory remains `apps/web`.
1692. Add the three domains above to the web project.
1703. Disable automatic Git deployments in the dashboard if desired; the committed
171 `vercel.ts` setting is the source-of-truth, but disconnecting Git in the
172 dashboard is also safe.
1734. Run one stable release deployment, or manually alias the current stable
174 deployment, so `app.t3.codes` points at a deployment containing the router
175 rules in `apps/web/vercel.ts`. Future stable releases keep this alias current.
176​
177## Nightly builds
178​
179- Workflow: `.github/workflows/release.yml`
180- Triggers:
181 - scheduled check every 30 minutes
182 - manual `workflow_dispatch` with `channel=nightly`
183- Automatic nightlies require new commits and at least six hours since the last nightly was published, including manual nightlies.
184- 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.
185- Runs the same desktop quality gates and artifact matrix as the tagged release flow.
186- Publishes a GitHub prerelease only:
187 - current tag format: `vX.Y.Z-nightly.YYYYMMDD.<run_number>`
188 - `nightly-v...` is accepted only as a legacy previous-nightly tag
189 - release name includes the short commit SHA
190 - `make_latest` is always `false`
191- Uses the next stable patch version as the nightly base. For example, `0.0.17` produces nightlies on `0.0.18-nightly.*`.
192- Publishes Electron auto-update metadata to the dedicated `nightly` updater channel, so desktop users can opt into that track independently from stable.
193- Publishes the CLI package (`apps/server`, npm package `t3`) to the `nightly` npm dist-tag using the same nightly version.
194- Does not commit version bumps back to `main`.
195​
196## Server self-update release invariant
197​
198Connected servers update to the client's exact version, not to an npm dist-tag. Every released
199desktop or hosted client version must therefore have a matching `t3@<version>` package available on
200npm before users can receive that client.
201​
202The workflow enforces this ordering:
203​
2041. `publish_cli` publishes the exact stable or nightly version to npm.
2052. `release` depends on `publish_cli` before exposing desktop artifacts in GitHub Releases.
2063. `deploy_web` depends on `release` before moving the hosted channel to the new client.
207​
208Preserve these dependencies when changing the release graph. Publishing a client first would leave
209the **Update server** action targeting a package version that does not exist yet.
210​
211For a release smoke test, confirm `npm view t3@<version> version` returns the expected version, then
212connect the new client to a server on the previous version and verify that the update action
213reconnects to the matching server. When the release adds database migrations, verify that the
214remote update applies them and reconnects. A failed trial must restore the database snapshot and
215restart the previous server. If the installed launcher does not support the target protocol,
216verify that the update stops before restart and run `npx t3@<version> service update` once on the
217server machine. Also test the manual or desktop-managed guidance when those environments are
218available.
219​
220## Desktop auto-update notes
221​
222- Updater runtime: `apps/desktop/src/updates/DesktopUpdates.ts`.
223- `electron-updater` adapter: `apps/desktop/src/electron/ElectronUpdater.ts`.
224- `apps/desktop/src/main.ts` only wires the updater layers into the desktop runtime.
225- Update UX:
226 - Background checks run on startup delay + interval.
227 - No automatic download or install.
228 - The desktop UI shows a rocket update button when an update is available; click once to download, click again after download to restart/install.
229- Provider: GitHub Releases (`provider: github`) configured at build time.
230- Repository slug source:
231 - `T3CODE_DESKTOP_UPDATE_REPOSITORY` (format `owner/repo`), if set.
232 - otherwise `GITHUB_REPOSITORY` from GitHub Actions.
233- Required release assets for updater:
234 - platform installers (`.exe`, `.dmg`, `.AppImage`, plus macOS `.zip` for Squirrel.Mac update payloads)
235 - channel metadata: `latest*.yml` for stable releases, `nightly*.yml` for nightly releases
236 - `*.blockmap` files (used for differential downloads)
237- macOS metadata note:
238 - `electron-updater` reads `latest-mac.yml` on stable and `nightly-mac.yml` on nightly, for both Intel and Apple Silicon.
239 - The workflow merges the per-arch mac manifests into one channel-specific mac manifest before publishing the GitHub Release.
240​
241### Windows payload topology and update validation
242​
243Windows packages the bundled server and only its runtime-external/native
244dependency closure in `resources/server.asar`. Native modules and helper
245executables declared as unpacked by that archive must be present at the matching
246paths below `resources/server.asar.unpacked`. The Windows-native backend reads
247the archive in place through Electron. Packaged Windows builds also ship a
248Linux-only `resources/wsl-runtime.tar.gz` plus its SHA-256 sidecar. WSL verifies
249and extracts that archive into `~/.t3/wsl-runtime/sha256-<archive-digest>` inside
250the selected distro, then reuses it for later launches of the same update. The
251Windows-side `wsl-server-tree/<version>` extraction remains a fallback and is
252removed after the distro-local runtime passes preflight.
253​
254Windows keeps JavaScript and package metadata inside `app.asar` and unpacks only
255native libraries and helper executables. Avoid enabling whole-package smart
256unpacking: each loose file adds work to NSIS installation and counts against
257the payload limit.
258​
259The artifact builder rejects a Windows package when any of these invariants
260break:
261​
262- `resources/server.asar` is absent or does not contain the server entry.
263- Any file marked unpacked in the ASAR header is absent from
264 `resources/server.asar.unpacked`.
265- On same-architecture Windows builds, the packaged primary cannot load the fff
266 native library from inside `server.asar` through its `.unpacked` sibling.
267- The isolated, extracted sidecar cannot load the server entry with plain Node.
268- A Windows build with a WSL node-pty prebuild omits the WSL archive or SHA-256
269 sidecar, the sidecar digest does not match the emitted archive, or required
270 Linux runtime members are absent.
271- The emitted WSL archive contains Windows/Darwin node-pty payloads, ConPTY,
272 pnpm install metadata, or Windows-only FFF, ffi-rs, or msgpackr bindings.
273- The external Windows resource monitor is absent.
274- The unpacked Windows application contains more than 80 files.
275​
276Cross-architecture Windows builds retain every structural and extracted-sidecar
277check, but skip executing the target Electron binary. A same-architecture build
278for each release target must exercise the primary native-load probe.
279​
280NSIS differential packaging remains enabled. A sidecar layout transition can
281produce a larger one-time download; subsequent small releases retain their
282blockmaps, with a 60 MB maximum for a representative sidecar-to-sidecar update.
283​
284## 0) npm OIDC trusted publishing setup (CLI)
285​
286The workflow invokes `node apps/server/scripts/cli.ts publish` after aligning package versions. That
287script temporarily prepares the `t3` package, then runs `vp pm publish --filter t3 ...` from the
288repository root so workspace publish configuration is applied correctly.
289​
290Checklist:
291​
2921. Confirm npm org/user owns package `t3` (or rename package first if needed).
2932. In npm package settings, configure Trusted Publisher:
294 - Provider: GitHub Actions
295 - Repository: this repo
296 - Workflow file: `.github/workflows/release.yml`
297 - Environment (if used): match your npm trusted publishing config
2983. Ensure npm account and org policies allow trusted publishing for the package.
2994. Create release tag `vX.Y.Z` and push; workflow will:
300 - align the release package versions to `X.Y.Z`
301 - build web + server
302 - invoke the CLI publish script with npm dist-tag `latest`
3035. Nightly runs invoke the same publish script with npm dist-tag `nightly`.
304​
305## 1) Release validation and unsigned builds
306​
307There is no dry-run tag path. Pushing any accepted non-nightly tag, including
308`v0.0.0-test.1`, classifies the run as the stable channel. It publishes `t3` with npm dist-tag
309`latest`, creates a real GitHub Release, aliases the hosted app to `latest.app.t3.codes` and
310`app.t3.codes`, and can commit a version bump to `main` in the finalize job. Do not push a test tag
311to validate the workflow.
312​
313The workflow has no non-publishing `workflow_dispatch` mode. Use normal CI or local quality gates to
314validate checks and builds without shipping. To exercise the complete release graph at lower stable
315risk, manually dispatch `channel=nightly`; this still publishes a real nightly npm package, GitHub
316prerelease, desktop updater release, hosted nightly alias, and marketing site, but it does not update stable app aliases or
317commit a version bump to `main`. Only run it when a real nightly release is acceptable.
318​
319Manual `channel=stable` is also a real stable-channel release. Omitting signing secrets only makes
320platform artifacts unsigned; it does not prevent publication.
321​
322## 2) Apple signing + notarization setup (macOS)
323​
324Required secrets used by the workflow:
325​
326- `CSC_LINK`
327- `CSC_KEY_PASSWORD`
328- `APPLE_API_KEY`
329- `APPLE_API_KEY_ID`
330- `APPLE_API_ISSUER`
331- `MACOS_PROVISIONING_PROFILE` (base64-encoded provisioning profile with Associated Domains)
332​
333Required repository variables:
334​
335- `APPLE_TEAM_ID`
336​
337Optional repository variables:
338​
339- `CLERK_PASSKEY_RP_DOMAINS`: comma-separated RP-domain override. By default, the build derives the
340 domain from the production Clerk publishable key.
341​
342Checklist:
343​
3441. Apple Developer account access:
345 - Team has rights to create Developer ID certificates.
3462. Create an explicit App ID for `com.t3tools.t3code` and enable Associated Domains.
3473. Create a `Developer ID Application` certificate and a compatible provisioning profile for that
348 App ID with Associated Domains enabled.
3494. Export the certificate + private key as `.p12` from Keychain.
3505. Base64-encode the `.p12` and store as `CSC_LINK`.
3516. Base64-encode the provisioning profile and store it as `MACOS_PROVISIONING_PROFILE`.
3527. Store the `.p12` export password as `CSC_KEY_PASSWORD`, and set `APPLE_TEAM_ID` to the
353 10-character Apple Developer Team ID.
3548. In App Store Connect, create an API key (Team key).
3559. Add API key values:
356 - `APPLE_API_KEY`: contents of the downloaded `.p8`
357 - `APPLE_API_KEY_ID`: Key ID
358 - `APPLE_API_ISSUER`: Issuer ID
35910. Complete the Clerk Native API and AASA setup in [T3 Connect setup](./connect-setup.md#desktop-passkeys).
36011. Re-run a tag release and confirm macOS artifacts are signed/notarized and contain the expected
361 `com.apple.developer.associated-domains` entitlement.
362​
363Notes:
364​
365- `APPLE_API_KEY` is stored as raw key text in secrets.
366- The workflow writes it to a temporary `AuthKey_<id>.p8` file at runtime.
367- The workflow decodes `MACOS_PROVISIONING_PROFILE`, validates it with `security cms`, and passes it
368 to the desktop packager.
369​
370## 3) Azure Trusted Signing setup (Windows)
371​
372Required secrets used by the workflow:
373​
374- `AZURE_TENANT_ID`
375- `AZURE_CLIENT_ID`
376- `AZURE_CLIENT_SECRET`
377- `AZURE_TRUSTED_SIGNING_ENDPOINT`
378- `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME`
379- `AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME`
380- `AZURE_TRUSTED_SIGNING_PUBLISHER_NAME`
381​
382Checklist:
383​
3841. Create Azure Trusted Signing account and certificate profile.
3852. Record ATS values:
386 - Endpoint
387 - Account name
388 - Certificate profile name
389 - Publisher name
3903. Create/choose an Entra app registration (service principal).
3914. Grant service principal permissions required by Trusted Signing.
3925. Create a client secret for the service principal.
3936. Add Azure secrets listed above in GitHub Actions secrets.
3947. Re-run a tag release and confirm Windows installer is signed.
395​
396## 4) Ongoing release checklist
397​
3981. Pick the latest nightly and verify it: run the smoke test above against its artifacts and
399 check the nightly channel for regressions.
4002. Dispatch the Release workflow with `channel=stable`. Leave `version` empty unless the version
401 should differ from the one the nightly previewed.
4023. Confirm the `Resolve release commit` notice names the nightly tag and commit you verified. If a
403 newer nightly published in between, the run builds that one instead.
4044. Verify workflow steps:
405 - preflight passes
406 - release quality checks pass
407 - all matrix builds pass
408 - `publish_cli` publishes the exact release version before the release job
409 - release job uploads expected files
4105. Smoke test downloaded artifacts.
411​
412## 5) Troubleshooting
413​
414- macOS build unsigned when expected signed:
415 - Check all Apple secrets plus `APPLE_TEAM_ID` are populated and non-empty.
416 - Confirm the provisioning profile belongs to `APPLE_TEAM_ID.com.t3tools.t3code` and includes
417 Associated Domains.
418- Windows build unsigned when expected signed:
419 - Check all Azure ATS and auth secrets are populated and non-empty.
420- Build fails with signing error:
421 - Retry with secrets removed to confirm unsigned path still works.
422 - Re-check certificate/profile names and tenant/client credentials.