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

release.md

349 lines15.5 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 quality gates first: lint, typecheck, test.
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​
37The release workflow requires 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 GitHub Release job uses them to mint the token that publishes release assets. Stable releases use
44them again in the finalize job, which can commit and push aligned package versions to `main`.
45​
46## T3 Connect relay deployment
47​
48The relay is a shared control plane versioned separately from client releases. Stable and nightly
49client builds must point at the same relay so users see the same linked environments when switching
50release channels.
51​
52`.github/workflows/deploy-relay.yml` deploys Alchemy stage `prod` on every push to `main`. The
53release workflow reads the relay URL and Clerk client configuration from the existing `production`
54GitHub Actions environment before building desktop, CLI, or hosted web artifacts.
55​
56Required repository variables shared by relay deployments:
57​
58- `CLOUDFLARE_ACCOUNT_ID`
59- `PLANETSCALE_ORGANIZATION`
60- `AXIOM_ORG_ID`
61​
62Required repository secrets shared by relay deployments:
63​
64- `CLOUDFLARE_API_TOKEN`
65- `PLANETSCALE_API_TOKEN_ID`
66- `PLANETSCALE_API_TOKEN`
67- `AXIOM_TOKEN`
68​
69Required `production` environment variables:
70​
71- `RELAY_API_ZONE_NAME`
72- `RELAY_TUNNEL_ZONE_NAME`
73- `CLERK_PUBLISHABLE_KEY`
74- `CLERK_JWT_AUDIENCE`
75- `CLERK_JWT_TEMPLATE`
76- `CLERK_CLI_OAUTH_CLIENT_ID`
77- `APNS_ENVIRONMENT`
78- `APNS_TEAM_ID`
79- `APNS_KEY_ID`
80- `APNS_BUNDLE_ID`
81​
82Optional `production` environment variables:
83​
84- `RELAY_DOMAIN` when overriding the derived `relay.<RELAY_API_ZONE_NAME>` domain
85​
86Required `production` environment secrets:
87​
88- `CLERK_SECRET_KEY`
89- `APNS_PRIVATE_KEY`
90​
91The account-scoped repository credentials are consumed by Alchemy while provisioning relay stages; they
92are not bound into the relay Worker. The production deployment uses an Axiom personal access token,
93so `AXIOM_ORG_ID` must accompany `AXIOM_TOKEN`. The `prod` stage owns the retained PlanetScale
94database. Local personal stages provision isolated branches from it and are never deployed by CI.
95Production adopts the configured relay API and tunnel DNS zones as retained Cloudflare resources.
96Personal stages reference the production-owned zones.
97​
98Developers deploy personal stages locally rather than through pull-request automation:
99​
100```sh
101vp run --filter t3code-relay deploy -- --stage "$USER" --env-file .env.local
102```
103​
104## Hosted web app release deployment
105​
106The hosted app is intentionally not deployed by Vercel's Git integration. The
107web project disables automatic Git deployments in `apps/web/vercel.ts` via
108`git.deploymentEnabled: false`, and `.github/workflows/release.yml` deploys the
109web app with Vercel CLI after the GitHub Release succeeds.
110​
111Required GitHub Actions secrets:
112​
113- `VERCEL_TOKEN`
114- `VERCEL_ORG_ID`
115- `VERCEL_PROJECT_ID`
116​
117Optional GitHub Actions variables:
118​
119- `VERCEL_TEAM_SLUG`: overrides the Vercel CLI scope when the team slug is preferred over the `VERCEL_ORG_ID` secret.
120- `T3CODE_WEB_ROUTER_URL`: defaults to `https://app.t3.codes`.
121- `T3CODE_WEB_LATEST_DOMAIN`: defaults to `latest.app.t3.codes`.
122- `T3CODE_WEB_NIGHTLY_DOMAIN`: defaults to `nightly.app.t3.codes`.
123​
124Required Vercel domains:
125​
126- `app.t3.codes`: the router domain users open, updated by stable releases.
127- `latest.app.t3.codes`: channel alias updated by stable releases.
128- `nightly.app.t3.codes`: channel alias updated by nightly releases.
129​
130The router domain uses `apps/web/vercel.ts` routes. Users opt into a channel by
131visiting `/__t3code/channel?channel=latest` or
132`/__t3code/channel?channel=nightly`; the router stores the
133`t3code_web_channel` cookie and rewrites future requests on `app.t3.codes` to
134the matching channel alias.
135​
136The release deploy job rewrites release package versions before upload so the
137hosted app's About panel renders the release version. Stable deploys alias the
138same deployment to both the `latest` channel and the router domain so the router
139rules stay current. Nightly deploys only alias the `nightly` channel. The job
140also passes `VITE_HOSTED_APP_CHANNEL=latest|nightly`, which renders the hosted
141update track selector in the About panel. Changing the selector navigates
142through `/__t3code/channel` on the router domain so the user's channel cookie is
143updated before redirecting to the hosted app root.
144​
145One-time Vercel dashboard setup:
146​
1471. Confirm the web project root directory remains `apps/web`.
1482. Add the three domains above to the web project.
1493. Disable automatic Git deployments in the dashboard if desired; the committed
150 `vercel.ts` setting is the source-of-truth, but disconnecting Git in the
151 dashboard is also safe.
1524. Run one stable release deployment, or manually alias the current stable
153 deployment, so `app.t3.codes` points at a deployment containing the router
154 rules in `apps/web/vercel.ts`. Future stable releases keep this alias current.
155​
156## Nightly builds
157​
158- Workflow: `.github/workflows/release.yml`
159- Triggers:
160 - scheduled check every three hours
161 - manual `workflow_dispatch` with `channel=nightly`
162- Runs the same desktop quality gates and artifact matrix as the tagged release flow.
163- Publishes a GitHub prerelease only:
164 - current tag format: `vX.Y.Z-nightly.YYYYMMDD.<run_number>`
165 - `nightly-v...` is accepted only as a legacy previous-nightly tag
166 - release name includes the short commit SHA
167 - `make_latest` is always `false`
168- Uses the next stable patch version as the nightly base. For example, `0.0.17` produces nightlies on `0.0.18-nightly.*`.
169- Publishes Electron auto-update metadata to the dedicated `nightly` updater channel, so desktop users can opt into that track independently from stable.
170- Publishes the CLI package (`apps/server`, npm package `t3`) to the `nightly` npm dist-tag using the same nightly version.
171- Does not commit version bumps back to `main`.
172​
173## Server self-update release invariant
174​
175Connected servers update to the client's exact version, not to an npm dist-tag. Every released
176desktop or hosted client version must therefore have a matching `t3@<version>` package available on
177npm before users can receive that client.
178​
179The workflow enforces this ordering:
180​
1811. `publish_cli` publishes the exact stable or nightly version to npm.
1822. `release` depends on `publish_cli` before exposing desktop artifacts in GitHub Releases.
1833. `deploy_web` depends on `release` before moving the hosted channel to the new client.
184​
185Preserve these dependencies when changing the release graph. Publishing a client first would leave
186the **Update server** action targeting a package version that does not exist yet.
187​
188For a release smoke test, confirm `npm view t3@<version> version` returns the expected version, then
189connect the new client to a server on the previous version and verify that the update action
190reconnects to the matching server. Test one automatic path and the manual or desktop-managed
191guidance when those environments are available.
192​
193## Desktop auto-update notes
194​
195- Updater runtime: `apps/desktop/src/updates/DesktopUpdates.ts`.
196- `electron-updater` adapter: `apps/desktop/src/electron/ElectronUpdater.ts`.
197- `apps/desktop/src/main.ts` only wires the updater layers into the desktop runtime.
198- Update UX:
199 - Background checks run on startup delay + interval.
200 - No automatic download or install.
201 - The desktop UI shows a rocket update button when an update is available; click once to download, click again after download to restart/install.
202- Provider: GitHub Releases (`provider: github`) configured at build time.
203- Repository slug source:
204 - `T3CODE_DESKTOP_UPDATE_REPOSITORY` (format `owner/repo`), if set.
205 - otherwise `GITHUB_REPOSITORY` from GitHub Actions.
206- Required release assets for updater:
207 - platform installers (`.exe`, `.dmg`, `.AppImage`, plus macOS `.zip` for Squirrel.Mac update payloads)
208 - channel metadata: `latest*.yml` for stable releases, `nightly*.yml` for nightly releases
209 - `*.blockmap` files (used for differential downloads)
210- macOS metadata note:
211 - `electron-updater` reads `latest-mac.yml` on stable and `nightly-mac.yml` on nightly, for both Intel and Apple Silicon.
212 - The workflow merges the per-arch mac manifests into one channel-specific mac manifest before publishing the GitHub Release.
213​
214## 0) npm OIDC trusted publishing setup (CLI)
215​
216The workflow invokes `node apps/server/scripts/cli.ts publish` after aligning package versions. That
217script temporarily prepares the `t3` package, then runs `vp pm publish --filter t3 ...` from the
218repository root so workspace publish configuration is applied correctly.
219​
220Checklist:
221​
2221. Confirm npm org/user owns package `t3` (or rename package first if needed).
2232. In npm package settings, configure Trusted Publisher:
224 - Provider: GitHub Actions
225 - Repository: this repo
226 - Workflow file: `.github/workflows/release.yml`
227 - Environment (if used): match your npm trusted publishing config
2283. Ensure npm account and org policies allow trusted publishing for the package.
2294. Create release tag `vX.Y.Z` and push; workflow will:
230 - align the release package versions to `X.Y.Z`
231 - build web + server
232 - invoke the CLI publish script with npm dist-tag `latest`
2335. Nightly runs invoke the same publish script with npm dist-tag `nightly`.
234​
235## 1) Release validation and unsigned builds
236​
237There is no dry-run tag path. Pushing any accepted non-nightly tag, including
238`v0.0.0-test.1`, classifies the run as the stable channel. It publishes `t3` with npm dist-tag
239`latest`, creates a real GitHub Release, aliases the hosted app to `latest.app.t3.codes` and
240`app.t3.codes`, and can commit a version bump to `main` in the finalize job. Do not push a test tag
241to validate the workflow.
242​
243The workflow has no non-publishing `workflow_dispatch` mode. Use normal CI or local quality gates to
244validate checks and builds without shipping. To exercise the complete release graph at lower stable
245risk, manually dispatch `channel=nightly`; this still publishes a real nightly npm package, GitHub
246prerelease, desktop updater release, and hosted nightly alias, but it does not update stable aliases or
247commit a version bump to `main`. Only run it when a real nightly release is acceptable.
248​
249Manual `channel=stable` with a version input is also a real stable-channel release. Omitting signing
250secrets only makes platform artifacts unsigned; it does not prevent publication.
251​
252## 2) Apple signing + notarization setup (macOS)
253​
254Required secrets used by the workflow:
255​
256- `CSC_LINK`
257- `CSC_KEY_PASSWORD`
258- `APPLE_API_KEY`
259- `APPLE_API_KEY_ID`
260- `APPLE_API_ISSUER`
261- `MACOS_PROVISIONING_PROFILE` (base64-encoded provisioning profile with Associated Domains)
262​
263Required repository variables:
264​
265- `APPLE_TEAM_ID`
266​
267Optional repository variables:
268​
269- `CLERK_PASSKEY_RP_DOMAINS`: comma-separated RP-domain override. By default, the build derives the
270 domain from the production Clerk publishable key.
271​
272Checklist:
273​
2741. Apple Developer account access:
275 - Team has rights to create Developer ID certificates.
2762. Create an explicit App ID for `com.t3tools.t3code` and enable Associated Domains.
2773. Create a `Developer ID Application` certificate and a compatible provisioning profile for that
278 App ID with Associated Domains enabled.
2794. Export the certificate + private key as `.p12` from Keychain.
2805. Base64-encode the `.p12` and store as `CSC_LINK`.
2816. Base64-encode the provisioning profile and store it as `MACOS_PROVISIONING_PROFILE`.
2827. Store the `.p12` export password as `CSC_KEY_PASSWORD`, and set `APPLE_TEAM_ID` to the
283 10-character Apple Developer Team ID.
2848. In App Store Connect, create an API key (Team key).
2859. Add API key values:
286 - `APPLE_API_KEY`: contents of the downloaded `.p8`
287 - `APPLE_API_KEY_ID`: Key ID
288 - `APPLE_API_ISSUER`: Issuer ID
28910. Complete the Clerk Native API and AASA setup in [T3 Connect Clerk Setup](../internals/t3-connect.md#desktop-passkeys).
29011. Re-run a tag release and confirm macOS artifacts are signed/notarized and contain the expected
291 `com.apple.developer.associated-domains` entitlement.
292​
293Notes:
294​
295- `APPLE_API_KEY` is stored as raw key text in secrets.
296- The workflow writes it to a temporary `AuthKey_<id>.p8` file at runtime.
297- The workflow decodes `MACOS_PROVISIONING_PROFILE`, validates it with `security cms`, and passes it
298 to the desktop packager.
299​
300## 3) Azure Trusted Signing setup (Windows)
301​
302Required secrets used by the workflow:
303​
304- `AZURE_TENANT_ID`
305- `AZURE_CLIENT_ID`
306- `AZURE_CLIENT_SECRET`
307- `AZURE_TRUSTED_SIGNING_ENDPOINT`
308- `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME`
309- `AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME`
310- `AZURE_TRUSTED_SIGNING_PUBLISHER_NAME`
311​
312Checklist:
313​
3141. Create Azure Trusted Signing account and certificate profile.
3152. Record ATS values:
316 - Endpoint
317 - Account name
318 - Certificate profile name
319 - Publisher name
3203. Create/choose an Entra app registration (service principal).
3214. Grant service principal permissions required by Trusted Signing.
3225. Create a client secret for the service principal.
3236. Add Azure secrets listed above in GitHub Actions secrets.
3247. Re-run a tag release and confirm Windows installer is signed.
325​
326## 4) Ongoing release checklist
327​
3281. Ensure `main` is green in CI.
3292. Bump app version as needed.
3303. Create release tag: `vX.Y.Z`.
3314. Push tag.
3325. Verify workflow steps:
333 - preflight passes
334 - all matrix builds pass
335 - `publish_cli` publishes the exact release version before the release job
336 - release job uploads expected files
3376. Smoke test downloaded artifacts.
338​
339## 5) Troubleshooting
340​
341- macOS build unsigned when expected signed:
342 - Check all Apple secrets plus `APPLE_TEAM_ID` are populated and non-empty.
343 - Confirm the provisioning profile belongs to `APPLE_TEAM_ID.com.t3tools.t3code` and includes
344 Associated Domains.
345- Windows build unsigned when expected signed:
346 - Check all Azure ATS and auth secrets are populated and non-empty.
347- Build fails with signing error:
348 - Retry with secrets removed to confirm unsigned path still works.
349 - Re-check certificate/profile names and tenant/client credentials.