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

release.md

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