Open History to see the last commit
1name: Release
2
3on:
4 push:
5 tags:
6 - "v*.*.*"
7 - "!v*-nightly.*"
8 - "!v*-preview.*"
9 schedule:
10 # Avoid minute zero, when GitHub scheduled jobs are busiest.
11 - cron: "8,38 * * * *"
12 workflow_dispatch:
13 inputs:
14 channel:
15 description: "Release channel"
16 required: false
17 default: preview
18 type: choice
19 options:
20 - preview
21 - stable
22 - nightly
23 version:
24 description: "Stable version override (for example 1.2.3). Defaults to the version the latest nightly previewed."
25 required: false
26 type: string
27
28# Serialize nightlies (scheduled and manual) so overlapping runs cannot build
29# the same commit twice or publish out of order. Stable tag releases get their
30# own group so a nightly never blocks them. Running publishers are never
31# canceled, and queue: max keeps every pending run instead of the default
32# newest-wins single slot, so a queued stable tag can never be silently
33# dropped. Automatic nightlies recheck the release gap after leaving the queue.
34concurrency:
35 group: release-${{ (github.event_name == 'schedule' || inputs.channel == 'nightly' || inputs.channel == 'preview') && 'nightly' || 'stable' }}
36 cancel-in-progress: false
37 queue: max
38
39permissions:
40 contents: read
41 id-token: none
42
43jobs:
44 # Picks the commit every later job builds. Nightlies and tag pushes build the
45 # triggering commit. Manual stable releases build the commit of the latest
46 # published nightly, so stable only ever ships a build that nightly users
47 # have already run. Scheduled runs also decide here whether a nightly is due.
48 resolve_commit:
49 name: Resolve release commit
50 runs-on: blacksmith-8vcpu-ubuntu-2404
51 timeout-minutes: 5
52 outputs:
53 ref: ${{ steps.resolve.outputs.ref }}
54 nightly_version: ${{ steps.resolve.outputs.nightly_version }}
55 has_changes: ${{ steps.resolve.outputs.has_changes }}
56 steps:
57 - name: Checkout
58 uses: actions/checkout@v6
59 with:
60 sparse-checkout: .github/scripts
61
62 - id: resolve
63 name: Resolve release commit
64 uses: actions/github-script@v8
65 env:
66 DISPATCH_CHANNEL: ${{ inputs.channel }}
67 with:
68 script: |
69 const {
70 assertCommitOnDefaultBranch,
71 assertReleaseSource,
72 shouldReleaseNightly,
73 resolveLatestNightlyCommit,
74 } = require('./.github/scripts/check-nightly-release.cjs');
75
76 const dispatchChannel = process.env.DISPATCH_CHANNEL || 'preview';
77 const releaseChannel = context.eventName === 'schedule'
78 ? 'nightly'
79 : context.eventName === 'workflow_dispatch'
80 ? dispatchChannel
81 : 'stable';
82
83 await assertReleaseSource({ github, context, releaseChannel });
84
85 if (context.eventName === 'schedule') {
86 core.setOutput('has_changes', await shouldReleaseNightly({ github, context, core }));
87 core.setOutput('ref', context.sha);
88 } else if (context.eventName === 'workflow_dispatch' && dispatchChannel === 'stable') {
89 const { tag, sha, version } = await resolveLatestNightlyCommit({ github, context, core });
90 await assertCommitOnDefaultBranch({ github, context, sha });
91 core.notice(`Stable release builds ${sha}, the commit shipped by ${tag}.`);
92 core.setOutput('ref', sha);
93 core.setOutput('nightly_version', version);
94 } else {
95 core.setOutput('ref', context.sha);
96 }
97
98 preflight:
99 name: Preflight
100 needs: [resolve_commit]
101 if: |
102 needs.resolve_commit.result == 'success' &&
103 (github.event_name != 'schedule' || needs.resolve_commit.outputs.has_changes == 'true')
104 runs-on: blacksmith-8vcpu-ubuntu-2404
105 timeout-minutes: 10
106 outputs:
107 release_channel: ${{ steps.release_meta.outputs.release_channel }}
108 version: ${{ steps.release_meta.outputs.version }}
109 tag: ${{ steps.release_meta.outputs.tag }}
110 release_name: ${{ steps.release_meta.outputs.name }}
111 short_sha: ${{ steps.release_meta.outputs.short_sha }}
112 previous_tag: ${{ steps.previous_tag.outputs.previous_tag }}
113 cli_dist_tag: ${{ steps.release_meta.outputs.cli_dist_tag }}
114 is_prerelease: ${{ steps.release_meta.outputs.is_prerelease }}
115 make_latest: ${{ steps.release_meta.outputs.make_latest }}
116 ref: ${{ needs.resolve_commit.outputs.ref }}
117 steps:
118 - name: Checkout
119 uses: actions/checkout@v6
120 with:
121 ref: ${{ needs.resolve_commit.outputs.ref }}
122 fetch-depth: 0
123 sparse-checkout: |
124 /*
125 !/.repos/
126 sparse-checkout-cone-mode: false
127
128 - name: Setup Vite+
129 uses: voidzero-dev/setup-vp@v1
130 with:
131 node-version-file: package.json
132 cache: true
133 run-install: true
134 env:
135 pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
136
137 - id: release_meta
138 name: Resolve release version
139 shell: bash
140 env:
141 DISPATCH_CHANNEL: ${{ github.event.inputs.channel }}
142 DISPATCH_VERSION: ${{ github.event.inputs.version }}
143 NIGHTLY_VERSION: ${{ needs.resolve_commit.outputs.nightly_version }}
144 NIGHTLY_DATE: ${{ github.run_started_at }}
145 NIGHTLY_SHA: ${{ needs.resolve_commit.outputs.ref }}
146 NIGHTLY_RUN_NUMBER: ${{ github.run_number }}
147 run: |
148 if [[ "${GITHUB_EVENT_NAME}" == "schedule" || ( "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${DISPATCH_CHANNEL:-preview}" == "nightly" ) ]]; then
149 nightly_date="$(date -u -d "$NIGHTLY_DATE" +%Y%m%d)"
150
151 node scripts/resolve-nightly-release.ts \
152 --date "$nightly_date" \
153 --run-number "$NIGHTLY_RUN_NUMBER" \
154 --sha "$NIGHTLY_SHA" \
155 --github-output
156
157 echo "release_channel=nightly" >> "$GITHUB_OUTPUT"
158 echo "cli_dist_tag=nightly" >> "$GITHUB_OUTPUT"
159 echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
160 echo "make_latest=false" >> "$GITHUB_OUTPUT"
161 elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${DISPATCH_CHANNEL:-preview}" == "preview" ]]; then
162 # Manual-only test train: exercises the whole release flow for a
163 # commit end users must never receive. Never scheduled.
164 # Same versioning as nightly under its own prerelease identifier.
165 # A preview release is reachable only by asking for it: npm gets it
166 # under the `preview` dist-tag, which nothing resolves by default,
167 # its desktop builds carry no update feed, and no updater manifest
168 # is attached to the release, so neither stable nor nightly
169 # installs can ever be offered one.
170 nightly_date="$(date -u -d "$NIGHTLY_DATE" +%Y%m%d)"
171
172 node scripts/resolve-nightly-release.ts \
173 --channel preview \
174 --date "$nightly_date" \
175 --run-number "$NIGHTLY_RUN_NUMBER" \
176 --sha "$NIGHTLY_SHA" \
177 --github-output
178
179 echo "release_channel=preview" >> "$GITHUB_OUTPUT"
180 echo "cli_dist_tag=preview" >> "$GITHUB_OUTPUT"
181 echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
182 echo "make_latest=false" >> "$GITHUB_OUTPUT"
183 else
184 if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
185 raw="${DISPATCH_VERSION:-$NIGHTLY_VERSION}"
186 if [[ -z "$raw" ]]; then
187 echo "workflow_dispatch stable releases need a version input or a published nightly." >&2
188 exit 1
189 fi
190 else
191 raw="${GITHUB_REF_NAME}"
192 fi
193
194 version="${raw#v}"
195 if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
196 echo "Invalid release version: $raw" >&2
197 exit 1
198 fi
199
200 echo "release_channel=stable" >> "$GITHUB_OUTPUT"
201 echo "version=$version" >> "$GITHUB_OUTPUT"
202 echo "tag=v$version" >> "$GITHUB_OUTPUT"
203 echo "name=T3 Code v$version" >> "$GITHUB_OUTPUT"
204 echo "cli_dist_tag=latest" >> "$GITHUB_OUTPUT"
205 if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
206 echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
207 echo "make_latest=true" >> "$GITHUB_OUTPUT"
208 else
209 echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
210 echo "make_latest=false" >> "$GITHUB_OUTPUT"
211 fi
212 fi
213
214 - id: previous_tag
215 name: Resolve previous release tag
216 run: |
217 node scripts/resolve-previous-release-tag.ts \
218 --channel "${{ steps.release_meta.outputs.release_channel }}" \
219 --current-tag "${{ steps.release_meta.outputs.tag }}" \
220 --github-output
221
222 # Share only the verification results, not the large registry metadata cache.
223 - name: Upload dependency verification
224 continue-on-error: true
225 uses: actions/upload-artifact@v7
226 with:
227 name: release-dependency-verification
228 path: ${{ runner.temp }}/pnpm-metadata/lockfile-verified.jsonl
229
230 quality:
231 name: Release quality checks
232 needs: [preflight]
233 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' }}
234 runs-on: blacksmith-8vcpu-ubuntu-2404
235 timeout-minutes: 10
236 steps:
237 - name: Checkout
238 uses: actions/checkout@v6
239 with:
240 ref: ${{ needs.preflight.outputs.ref }}
241 sparse-checkout: |
242 /*
243 !/.repos/
244 sparse-checkout-cone-mode: false
245
246 - name: Setup Vite+
247 uses: voidzero-dev/setup-vp@v1
248 with:
249 node-version-file: package.json
250 cache: true
251 run-install: true
252
253 - name: Ensure Electron runtime is installed
254 run: vp run --filter @t3tools/desktop ensure:electron
255
256 - name: Check
257 run: vp check
258
259 - name: Typecheck
260 run: vp run typecheck
261
262 - uses: ./.github/actions/setup-apt-mirrors
263
264 - name: Install browser secret helper build libraries
265 run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
266
267 - name: Test
268 run: vp run test
269
270 relay_public_config:
271 name: Resolve T3 Connect public config
272 # Consumes only the release commit, not preflight's resolved version, so it
273 # runs alongside preflight instead of after it. The condition mirrors preflight's.
274 needs: [resolve_commit]
275 if: |
276 needs.resolve_commit.result == 'success' &&
277 (github.event_name != 'schedule' || needs.resolve_commit.outputs.has_changes == 'true')
278 runs-on: blacksmith-8vcpu-ubuntu-2404
279 timeout-minutes: 5
280 environment:
281 name: production
282 outputs:
283 clerk_publishable_key: ${{ steps.public_config.outputs.clerk_publishable_key }}
284 clerk_jwt_template: ${{ steps.public_config.outputs.clerk_jwt_template }}
285 clerk_cli_oauth_client_id: ${{ steps.public_config.outputs.clerk_cli_oauth_client_id }}
286 relay_url: ${{ steps.public_config.outputs.relay_url }}
287 env:
288 CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
289 CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
290 RELAY_DOMAIN: ${{ vars.RELAY_DOMAIN }}
291 RELAY_API_ZONE_NAME: ${{ vars.RELAY_API_ZONE_NAME }}
292 CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
293 CLERK_JWT_TEMPLATE: ${{ vars.CLERK_JWT_TEMPLATE }}
294 CLERK_CLI_OAUTH_CLIENT_ID: ${{ vars.CLERK_CLI_OAUTH_CLIENT_ID }}
295 steps:
296 - name: Checkout
297 uses: actions/checkout@v6
298 with:
299 ref: ${{ needs.resolve_commit.outputs.ref }}
300 sparse-checkout: |
301 /*
302 !/.repos/
303 sparse-checkout-cone-mode: false
304
305 - name: Setup Vite+
306 uses: voidzero-dev/setup-vp@v1
307 with:
308 node-version-file: package.json
309 cache: true
310 run-install: |
311 args:
312 - --filter=t3code-relay...
313
314 # The deployed stack's outputs, read from Alchemy's state store without
315 # planning or applying. Select the backend explicitly to avoid loading
316 # the stack's unrelated provider credentials; suppress informational logs
317 # and strip the credential-refresh progress prefix before parsing JSON.
318 # Redacted values are persisted as
319 # {"__redacted__": "<value>"}; the token is masked before it is written.
320 - name: Read production relay tracing config
321 shell: bash
322 working-directory: infra/relay
323 run: |
324 set -euo pipefail
325 output="$(npx alchemy state read T3CodeRelay/prod/output --backend cloudflare --log-level error --no-input | sed -n '/^{/,$p')"
326 field() {
327 jq -er --arg key "$1" '.[$key] | if type == "object" then .__redacted__ else . end | select(. != null and . != "")' <<<"$output" \
328 || { echo "Relay stack output is missing $1" >&2; exit 1; }
329 }
330 url="$(field clientTracingUrl)"
331 dataset="$(field clientTracingDataset)"
332 token="$(field clientTracingToken)"
333 echo "::add-mask::$token"
334 {
335 echo "T3CODE_RELAY_CLIENT_OTLP_TRACES_URL=$url"
336 echo "T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET=$dataset"
337 echo "T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=$token"
338 } > "$RUNNER_TEMP/relay-client-tracing.env"
339
340 - name: Upload relay client tracing config
341 uses: actions/upload-artifact@v7
342 with:
343 name: relay-client-tracing-config
344 path: ${{ runner.temp }}/relay-client-tracing.env
345 if-no-files-found: error
346 retention-days: 1
347
348 - id: public_config
349 name: Resolve production relay public config
350 shell: bash
351 run: |
352 set -euo pipefail
353
354 relay_domain="${RELAY_DOMAIN:-}"
355 if [[ -z "$relay_domain" && -n "${RELAY_API_ZONE_NAME:-}" ]]; then
356 relay_domain="relay.$RELAY_API_ZONE_NAME"
357 fi
358 required=(
359 relay_domain
360 CLERK_PUBLISHABLE_KEY
361 CLERK_JWT_TEMPLATE
362 CLERK_CLI_OAUTH_CLIENT_ID
363 )
364 missing=()
365 for name in "${required[@]}"; do
366 if [[ -z "${!name:-}" ]]; then
367 missing+=("$name")
368 fi
369 done
370 if (( ${#missing[@]} > 0 )); then
371 printf 'Missing required relay deployment configuration: %s\n' "${missing[*]}" >&2
372 exit 1
373 fi
374
375 echo "clerk_publishable_key=$CLERK_PUBLISHABLE_KEY" >> "$GITHUB_OUTPUT"
376 echo "clerk_jwt_template=$CLERK_JWT_TEMPLATE" >> "$GITHUB_OUTPUT"
377 echo "clerk_cli_oauth_client_id=$CLERK_CLI_OAUTH_CLIENT_ID" >> "$GITHUB_OUTPUT"
378 echo "relay_url=https://$relay_domain" >> "$GITHUB_OUTPUT"
379
380 # The platform-independent JS (server bundle, web client, Electron main) is
381 # built exactly once here and handed to every platform job as `js-bundle`.
382 # The relay/Clerk values are baked into the bundle, so they belong to this
383 # job rather than to the packaging jobs.
384 build_bundle:
385 name: Build JS bundle
386 # Same gating as relay_public_config: only the release commit is needed, so
387 # this runs alongside preflight. See the condition comment there.
388 needs: [preflight, relay_public_config]
389 if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' }}
390 runs-on: blacksmith-32vcpu-ubuntu-2404
391 timeout-minutes: 30
392 env:
393 T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
394 T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
395 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
396 T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
397 steps:
398 - name: Checkout
399 uses: actions/checkout@v6
400 with:
401 ref: ${{ needs.preflight.outputs.ref }}
402 sparse-checkout: |
403 /*
404 !/.repos/
405 sparse-checkout-cone-mode: false
406
407 - name: Setup Vite+
408 uses: voidzero-dev/setup-vp@v1
409 with:
410 node-version-file: package.json
411 cache: true
412 run-install: false
413
414 # pnpm checks the lockfile and policy before reusing this result. A missing
415 # artifact leaves the cache empty, so installation runs the checks again.
416 - name: Download dependency verification
417 continue-on-error: true
418 uses: actions/download-artifact@v8
419 with:
420 name: release-dependency-verification
421 path: ${{ runner.temp }}/pnpm-metadata
422
423 - name: Install bundle dependencies
424 env:
425 pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
426 run: vp install --filter=t3... --filter=@t3tools/web... --filter=@t3tools/desktop... --filter=@t3tools/scripts...
427
428 - name: Download relay client tracing config
429 uses: actions/download-artifact@v8
430 with:
431 name: relay-client-tracing-config
432 path: ${{ runner.temp }}/relay-client-tracing
433
434 - name: Load relay client tracing config
435 shell: bash
436 run: |
437 config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
438 tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
439 echo "::add-mask::$tracing_token"
440 cat "$config_path" >> "$GITHUB_ENV"
441
442 - name: Align package versions to release version
443 run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
444
445 - uses: ./.github/actions/setup-apt-mirrors
446
447 # @t3tools/desktop#build compiles the Linux browser secret helper on a
448 # Linux host before packing, and that needs libsecret headers.
449 - name: Install browser secret helper build libraries
450 run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
451
452 # Runs t3#build (which depends on @t3tools/web#build) and
453 # @t3tools/desktop#build, so apps/server/dist holds the server bundle
454 # plus the web client and apps/desktop/dist-electron the Electron main.
455 - name: Build JS bundle
456 run: vp run build:desktop
457
458 # Two paths under apps/ so the artifact root is apps/; consumers download
459 # into `apps` to restore both at their original locations.
460 - name: Upload JS bundle
461 uses: actions/upload-artifact@v7
462 with:
463 name: js-bundle
464 path: |
465 apps/server/dist
466 apps/desktop/dist-electron
467 if-no-files-found: error
468 retention-days: 1
469
470 # One job per platform and architecture (see release-desktop.yml), each on
471 # hardware of its own architecture, and each gated only on what it consumes:
472 # every platform needs the JS bundle, and the Windows jobs also need the
473 # same-arch Linux job, whose CLI archive they embed as the WSL runtime. Every
474 # job builds the desktop app; all but macOS x64 also build the CLI archive
475 # for their platform, so a target either ships fully or not at all.
476 desktop_mac_arm64:
477 name: Desktop macOS arm64
478 needs: [preflight, relay_public_config, build_bundle]
479 if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }}
480 uses: ./.github/workflows/release-desktop.yml
481 secrets: inherit
482 with:
483 version: ${{ needs.preflight.outputs.version }}
484 ref: ${{ needs.preflight.outputs.ref }}
485 release_channel: ${{ needs.preflight.outputs.release_channel }}
486 clerk_publishable_key: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
487 clerk_jwt_template: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
488 clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
489 relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
490 label: macOS arm64
491 runner: blacksmith-12vcpu-macos-26
492 platform: mac
493 target: dmg
494 arch: arm64
495 rust_target: aarch64-apple-darwin
496 resource_key: darwin-arm64
497 cli_archive: true
498
499 desktop_mac_x64:
500 name: Desktop macOS x64
501 needs: [preflight, relay_public_config, build_bundle]
502 if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }}
503 uses: ./.github/workflows/release-desktop.yml
504 secrets: inherit
505 with:
506 version: ${{ needs.preflight.outputs.version }}
507 ref: ${{ needs.preflight.outputs.ref }}
508 release_channel: ${{ needs.preflight.outputs.release_channel }}
509 clerk_publishable_key: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
510 clerk_jwt_template: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
511 clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
512 relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
513 label: macOS x64
514 runner: blacksmith-12vcpu-macos-26
515 platform: mac
516 target: dmg
517 arch: x64
518 rust_target: x86_64-apple-darwin
519 resource_key: darwin-x64
520 # No CLI archive: Node single-executables are unsupported on x64 macOS
521 # (the SEA docs list macOS as arm64 only) and the built binary segfaults
522 # on start. The x64 desktop app is Electron and unaffected.
523 cli_archive: false
524
525 desktop_linux_x64:
526 name: Desktop Linux x64
527 needs: [preflight, relay_public_config, build_bundle]
528 if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }}
529 uses: ./.github/workflows/release-desktop.yml
530 secrets: inherit
531 with:
532 version: ${{ needs.preflight.outputs.version }}
533 ref: ${{ needs.preflight.outputs.ref }}
534 release_channel: ${{ needs.preflight.outputs.release_channel }}
535 clerk_publishable_key: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
536 clerk_jwt_template: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
537 clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
538 relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
539 label: Linux x64
540 runner: blacksmith-32vcpu-ubuntu-2404
541 platform: linux
542 target: AppImage
543 arch: x64
544 rust_target: x86_64-unknown-linux-gnu
545 resource_key: linux-x64
546 cli_archive: true
547
548 # node-pty has no Linux prebuild and compiles from source, so the arm64 app
549 # and archive are built on arm64 hardware rather than cross-built.
550 desktop_linux_arm64:
551 name: Desktop Linux arm64
552 needs: [preflight, relay_public_config, build_bundle]
553 if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }}
554 uses: ./.github/workflows/release-desktop.yml
555 secrets: inherit
556 with:
557 version: ${{ needs.preflight.outputs.version }}
558 ref: ${{ needs.preflight.outputs.ref }}
559 release_channel: ${{ needs.preflight.outputs.release_channel }}
560 clerk_publishable_key: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
561 clerk_jwt_template: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
562 clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
563 relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
564 label: Linux arm64
565 runner: ubuntu-24.04-arm
566 platform: linux
567 target: AppImage
568 arch: arm64
569 rust_target: aarch64-unknown-linux-gnu
570 resource_key: linux-arm64
571 cli_archive: true
572
573 # The Windows jobs embed the same-arch Linux CLI archive as the WSL runtime.
574 # `!cancelled()` (not `!failure()`) still lets them start when that Linux job
575 # failed; the download step inside then fails this single platform if the
576 # archive is missing.
577 desktop_win_x64:
578 name: Desktop Windows x64
579 needs: [preflight, relay_public_config, build_bundle, desktop_linux_x64]
580 if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }}
581 uses: ./.github/workflows/release-desktop.yml
582 secrets: inherit
583 with:
584 version: ${{ needs.preflight.outputs.version }}
585 ref: ${{ needs.preflight.outputs.ref }}
586 release_channel: ${{ needs.preflight.outputs.release_channel }}
587 clerk_publishable_key: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
588 clerk_jwt_template: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
589 clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
590 relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
591 label: Windows x64
592 runner: blacksmith-32vcpu-windows-2025
593 platform: win
594 target: nsis
595 arch: x64
596 rust_target: x86_64-pc-windows-msvc
597 resource_key: win32-x64
598 cli_archive: true
599
600 desktop_win_arm64:
601 name: Desktop Windows arm64
602 needs: [preflight, relay_public_config, build_bundle, desktop_linux_arm64]
603 if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build_bundle.result == 'success' }}
604 uses: ./.github/workflows/release-desktop.yml
605 secrets: inherit
606 with:
607 version: ${{ needs.preflight.outputs.version }}
608 ref: ${{ needs.preflight.outputs.ref }}
609 release_channel: ${{ needs.preflight.outputs.release_channel }}
610 clerk_publishable_key: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
611 clerk_jwt_template: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
612 clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
613 relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
614 label: Windows arm64
615 runner: windows-11-arm
616 platform: win
617 target: nsis
618 arch: arm64
619 rust_target: aarch64-pc-windows-msvc
620 resource_key: win32-arm64
621 cli_archive: true
622
623 # npm gets the same bytes as the GitHub Release: the launcher plus one
624 # package per CLI archive. Preview publishes too, under the `preview`
625 # dist-tag, which nothing resolves unless asked for by name.
626 publish_cli:
627 name: Publish CLI to npm
628 needs:
629 [
630 preflight,
631 relay_public_config,
632 quality,
633 desktop_mac_arm64,
634 desktop_linux_x64,
635 desktop_linux_arm64,
636 desktop_win_x64,
637 desktop_win_arm64,
638 ]
639 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' }}
640 runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
641 timeout-minutes: 15
642 permissions:
643 contents: read
644 id-token: write
645 steps:
646 - name: Checkout
647 uses: actions/checkout@v6
648 with:
649 ref: ${{ needs.preflight.outputs.ref }}
650 sparse-checkout: |
651 /*
652 !/.repos/
653 sparse-checkout-cone-mode: false
654
655 - name: Setup Vite+
656 uses: voidzero-dev/setup-vp@v1
657 with:
658 node-version-file: package.json
659 cache: true
660 run-install: |
661 args:
662 - --filter=t3...
663 - --filter=@t3tools/scripts...
664
665 - name: Download all CLI archives
666 uses: actions/download-artifact@v8
667 with:
668 pattern: cli-*
669 merge-multiple: true
670 path: release-cli
671
672 - name: Build npm packages from CLI archives
673 run: node scripts/build-npm-platform-packages.ts --archives-dir release-cli --version "${{ needs.preflight.outputs.version }}" --output-dir npm-packages
674
675 # A dry run of every package first: an auth or scope error here (the
676 # @t3code org missing, a package without a trusted publisher) fails
677 # before anything is live, instead of after some platforms already are.
678 - name: Check npm publish access (dry run)
679 run: |
680 if ! node apps/server/scripts/cli.ts publish --packages-dir npm-packages --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --provenance --dry-run --verbose; then
681 echo "::error::npm publish --dry-run failed. Make sure the @t3code npm org exists and that t3 and every @t3code/t3-<platform> package has a trusted publisher registered for .github/workflows/release.yml (see docs/operations/release.md)." >&2
682 exit 1
683 fi
684
685 - name: Publish CLI packages
686 run: node apps/server/scripts/cli.ts publish --packages-dir npm-packages --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --provenance --verbose
687
688 release:
689 name: Publish GitHub Release
690 needs:
691 [
692 preflight,
693 desktop_mac_arm64,
694 desktop_mac_x64,
695 desktop_linux_x64,
696 desktop_linux_arm64,
697 desktop_win_x64,
698 desktop_win_arm64,
699 publish_cli,
700 ]
701 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_mac_x64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' && needs.publish_cli.result == 'success' }}
702 runs-on: blacksmith-8vcpu-ubuntu-2404
703 timeout-minutes: 30
704 permissions:
705 contents: write
706 steps:
707 - name: Checkout
708 uses: actions/checkout@v6
709 with:
710 ref: ${{ needs.preflight.outputs.ref }}
711 sparse-checkout: |
712 /*
713 !/.repos/
714 sparse-checkout-cone-mode: false
715
716 - name: Setup Vite+
717 uses: voidzero-dev/setup-vp@v1
718 with:
719 node-version-file: package.json
720 cache: true
721 run-install: |
722 args:
723 - --filter=@t3tools/scripts...
724
725 - name: Download all desktop artifacts
726 uses: actions/download-artifact@v8
727 with:
728 pattern: desktop-*
729 merge-multiple: true
730 path: release-assets
731
732 - name: Download all CLI archives
733 uses: actions/download-artifact@v8
734 with:
735 pattern: cli-*
736 merge-multiple: true
737 path: release-assets
738
739 # Installers verify archives against this file, so it is written from the
740 # signed bytes that get uploaded, never from an earlier stage.
741 - name: Write CLI archive checksums
742 shell: bash
743 run: |
744 set -euo pipefail
745 cd release-assets
746 shopt -s nullglob
747 archives=(t3-*.tar.gz t3-*.zip)
748 if [[ ${#archives[@]} -eq 0 ]]; then
749 echo "No CLI archives were produced." >&2
750 exit 1
751 fi
752 sha256sum "${archives[@]}" > SHA256SUMS
753 cat SHA256SUMS
754
755 # The desktop build omits the publish config for preview versions, so
756 # electron-builder emits no updater manifests for them. Refuse to publish
757 # if one shows up anyway: a `latest*.yml` or `nightly*.yml` on a preview
758 # release is what would let a stable or nightly install update onto it.
759 - name: Refuse updater metadata on preview releases
760 if: needs.preflight.outputs.release_channel == 'preview'
761 shell: bash
762 run: |
763 set -euo pipefail
764 shopt -s nullglob extglob
765 # builder-debug.yml is electron-builder's config dump, not a feed.
766 updater_files=(release-assets/!(builder-debug).yml release-assets/*.blockmap)
767 if [[ ${#updater_files[@]} -ne 0 ]]; then
768 printf 'Preview releases must not carry updater metadata, found: %s\n' "${updater_files[*]}" >&2
769 exit 1
770 fi
771
772 # electron-updater reads one manifest per platform and channel and picks
773 # the file entry whose name carries the running arch, so the per-arch
774 # manifests the build jobs wrote are merged back into that one file.
775 - name: Merge macOS updater manifests
776 if: needs.preflight.outputs.release_channel != 'preview'
777 run: |
778 shopt -s nullglob
779 for x64_manifest in release-assets/*-mac-x64.yml; do
780 arm64_manifest="${x64_manifest%-x64.yml}.yml"
781 if [[ -f "$arm64_manifest" ]]; then
782 node scripts/merge-update-manifests.ts --platform mac "$arm64_manifest" "$x64_manifest"
783 rm -f "$x64_manifest"
784 fi
785 done
786
787 - name: Merge Windows updater manifests
788 if: needs.preflight.outputs.release_channel != 'preview'
789 run: |
790 shopt -s nullglob
791 for x64_manifest in release-assets/*-win-x64.yml; do
792 arm64_manifest="${x64_manifest%-x64.yml}-arm64.yml"
793 merged_manifest="${x64_manifest%-win-x64.yml}.yml"
794 if [[ -f "$arm64_manifest" ]]; then
795 node scripts/merge-update-manifests.ts --platform win "$x64_manifest" "$arm64_manifest" "$merged_manifest"
796 rm -f "$x64_manifest" "$arm64_manifest"
797 else
798 mv "$x64_manifest" "$merged_manifest"
799 fi
800 done
801
802 # Updater manifests and blockmaps are what electron-updater consumes.
803 # They are only listed for channels an updater is meant to follow.
804 - id: release_files
805 name: Resolve release asset list
806 shell: bash
807 run: |
808 {
809 echo 'files<<EOF'
810 echo 'release-assets/*.dmg'
811 echo 'release-assets/*.zip'
812 echo 'release-assets/*.AppImage'
813 echo 'release-assets/*.exe'
814 if [[ "${{ needs.preflight.outputs.release_channel }}" != "preview" ]]; then
815 echo 'release-assets/*.blockmap'
816 echo 'release-assets/*.yml'
817 fi
818 echo 'release-assets/*.tar.gz'
819 echo 'release-assets/SHA256SUMS'
820 echo 'EOF'
821 } >> "$GITHUB_OUTPUT"
822
823 # A preview release gets a warning instead of generated notes. Generated
824 # notes would list every commit since the previous preview, which is
825 # unmerged branch history no one should read as a changelog, and would
826 # make the release look like any other build to someone browsing the
827 # releases page.
828 - name: Write preview release notes
829 if: needs.preflight.outputs.release_channel == 'preview'
830 shell: bash
831 run: |
832 cat > release-notes.md <<'EOF'
833 > [!WARNING]
834 > **This is a preview build. Do not install it unless you know exactly why you are here.**
835 >
836 > Preview builds are cut by maintainers from unreleased branches to exercise the release pipeline. They can be broken, receive no fixes, are never offered as updates, and are not supported. If you want T3 Code, install the [latest release](https://github.com/pingdotgg/t3code/releases/latest) or a nightly instead.
837
838 Built from `${{ needs.preflight.outputs.ref }}`.
839 EOF
840
841 - name: Publish release
842 if: needs.preflight.outputs.previous_tag != ''
843 uses: softprops/action-gh-release@v3
844 with:
845 tag_name: ${{ needs.preflight.outputs.tag }}
846 target_commitish: ${{ needs.preflight.outputs.ref }}
847 name: ${{ needs.preflight.outputs.release_name }}
848 generate_release_notes: ${{ needs.preflight.outputs.release_channel != 'preview' }}
849 body_path: ${{ needs.preflight.outputs.release_channel == 'preview' && 'release-notes.md' || '' }}
850 previous_tag: ${{ needs.preflight.outputs.previous_tag }}
851 prerelease: ${{ needs.preflight.outputs.is_prerelease }}
852 make_latest: ${{ needs.preflight.outputs.make_latest }}
853 files: ${{ steps.release_files.outputs.files }}
854 fail_on_unmatched_files: true
855 token: ${{ github.token }}
856
857 - name: Publish first release
858 if: needs.preflight.outputs.previous_tag == ''
859 uses: softprops/action-gh-release@v3
860 with:
861 tag_name: ${{ needs.preflight.outputs.tag }}
862 target_commitish: ${{ needs.preflight.outputs.ref }}
863 name: ${{ needs.preflight.outputs.release_name }}
864 generate_release_notes: ${{ needs.preflight.outputs.release_channel != 'preview' }}
865 body_path: ${{ needs.preflight.outputs.release_channel == 'preview' && 'release-notes.md' || '' }}
866 prerelease: ${{ needs.preflight.outputs.is_prerelease }}
867 make_latest: ${{ needs.preflight.outputs.make_latest }}
868 files: ${{ steps.release_files.outputs.files }}
869 fail_on_unmatched_files: true
870 token: ${{ github.token }}
871
872 publish_aur:
873 name: Publish AUR package
874 needs: [preflight, release]
875 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel != 'preview' }}
876 uses: ./.github/workflows/publish-aur.yml
877 with:
878 release_tag: ${{ needs.preflight.outputs.tag }}
879 secrets:
880 AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
881
882 deploy_web:
883 name: Deploy hosted web app
884 needs: [preflight, relay_public_config, release]
885 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel != 'preview' }}
886 runs-on: blacksmith-8vcpu-ubuntu-2404
887 timeout-minutes: 10
888 env:
889 T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
890 T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
891 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
892 T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
893 VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
894 VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
895 VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
896 T3CODE_WEB_ROUTER_URL: ${{ vars.T3CODE_WEB_ROUTER_URL }}
897 T3CODE_WEB_LATEST_DOMAIN: ${{ vars.T3CODE_WEB_LATEST_DOMAIN }}
898 T3CODE_WEB_NIGHTLY_DOMAIN: ${{ vars.T3CODE_WEB_NIGHTLY_DOMAIN }}
899 VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }}
900 steps:
901 - name: Checkout
902 uses: actions/checkout@v6
903 with:
904 ref: ${{ needs.preflight.outputs.ref }}
905 sparse-checkout: |
906 /*
907 !/.repos/
908 sparse-checkout-cone-mode: false
909
910 - name: Setup Vite+
911 uses: voidzero-dev/setup-vp@v1
912 with:
913 node-version-file: package.json
914 cache: true
915 run-install: |
916 args:
917 - --filter=@t3tools/scripts...
918 - --filter=@t3tools/web...
919
920 - name: Download relay client tracing config
921 uses: actions/download-artifact@v8
922 with:
923 name: relay-client-tracing-config
924 path: ${{ runner.temp }}/relay-client-tracing
925
926 - name: Load relay client tracing config
927 shell: bash
928 run: |
929 config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
930 tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
931 echo "::add-mask::$tracing_token"
932 cat "$config_path" >> "$GITHUB_ENV"
933
934 - name: Align package versions to release version
935 run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
936
937 - name: Refresh release lockfile
938 run: vp install --lockfile-only --ignore-scripts
939
940 - name: Deploy and alias channel
941 shell: bash
942 run: |
943 set -euo pipefail
944
945 if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" || -z "${VERCEL_PROJECT_ID:-}" ]]; then
946 echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID." >&2
947 exit 1
948 fi
949
950 router_url="${T3CODE_WEB_ROUTER_URL:-https://app.t3.codes}"
951 latest_domain="${T3CODE_WEB_LATEST_DOMAIN:-latest.app.t3.codes}"
952 nightly_domain="${T3CODE_WEB_NIGHTLY_DOMAIN:-nightly.app.t3.codes}"
953 router_domain="${router_url#http://}"
954 router_domain="${router_domain#https://}"
955 router_domain="${router_domain%%/*}"
956
957 if [[ "${{ needs.preflight.outputs.release_channel }}" == "stable" ]]; then
958 channel_domain="$latest_domain"
959 channel_name="latest"
960 else
961 channel_domain="$nightly_domain"
962 channel_name="nightly"
963 fi
964
965 vercel_scope="${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
966 vercel_scope_args=(--scope "$vercel_scope")
967
968 echo "Deploying hosted web app for $channel_name channel."
969 deployment_url="$(
970 vp dlx vercel@53.1.1 deploy \
971 --archive=tgz \
972 --prod \
973 --skip-domain \
974 --yes \
975 --token "$VERCEL_TOKEN" \
976 "${vercel_scope_args[@]}" \
977 --build-env "APP_VERSION=${{ needs.preflight.outputs.version }}" \
978 --build-env "T3CODE_CLERK_PUBLISHABLE_KEY=${T3CODE_CLERK_PUBLISHABLE_KEY:-}" \
979 --build-env "T3CODE_CLERK_JWT_TEMPLATE=${T3CODE_CLERK_JWT_TEMPLATE:-}" \
980 --build-env "T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=${T3CODE_CLERK_CLI_OAUTH_CLIENT_ID:-}" \
981 --build-env "T3CODE_RELAY_URL=${T3CODE_RELAY_URL:-}" \
982 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_URL=${T3CODE_RELAY_CLIENT_OTLP_TRACES_URL:-}" \
983 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET=${T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET:-}" \
984 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=${T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN:-}" \
985 --build-env "VITE_HOSTED_APP_URL=$router_url" \
986 --build-env "VITE_HOSTED_APP_CHANNEL=$channel_name"
987 )"
988
989 echo "Aliasing $deployment_url to $channel_domain."
990 vp dlx vercel@53.1.1 alias set "$deployment_url" "$channel_domain" \
991 --token "$VERCEL_TOKEN" \
992 "${vercel_scope_args[@]}"
993
994 if [[ "$channel_name" == "latest" && -n "$router_domain" && "$router_domain" != "$channel_domain" ]]; then
995 echo "Aliasing $deployment_url to router domain $router_domain."
996 vp dlx vercel@53.1.1 alias set "$deployment_url" "$router_domain" \
997 --token "$VERCEL_TOKEN" \
998 "${vercel_scope_args[@]}"
999 fi
1000
1001 deploy_marketing:
1002 name: Deploy marketing site
1003 needs: [preflight, release]
1004 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'nightly' }}
1005 runs-on: blacksmith-8vcpu-ubuntu-2404
1006 timeout-minutes: 10
1007 env:
1008 VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
1009 VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
1010 VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }}
1011 steps:
1012 - name: Checkout
1013 uses: actions/checkout@v6
1014 with:
1015 ref: ${{ needs.preflight.outputs.ref }}
1016 sparse-checkout: |
1017 /*
1018 !/.repos/
1019 sparse-checkout-cone-mode: false
1020
1021 - name: Setup Vite+
1022 uses: voidzero-dev/setup-vp@v1
1023 with:
1024 node-version-file: package.json
1025 cache: true
1026 run-install: |
1027 args:
1028 - --filter=@t3tools/marketing...
1029
1030 - name: Deploy marketing site to Vercel
1031 shell: bash
1032 run: |
1033 set -euo pipefail
1034
1035 if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" ]]; then
1036 echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID." >&2
1037 exit 1
1038 fi
1039
1040 VERCEL_PROJECT_ID="$(
1041 curl --fail --silent --show-error \
1042 --header "Authorization: Bearer $VERCEL_TOKEN" \
1043 "https://api.vercel.com/v9/projects/t3code-marketing?teamId=$VERCEL_ORG_ID" \
1044 | jq --exit-status --raw-output '.id'
1045 )"
1046 export VERCEL_PROJECT_ID
1047
1048 vp dlx vercel@53.1.1 deploy \
1049 --archive=tgz \
1050 --prod \
1051 --yes \
1052 --token "$VERCEL_TOKEN" \
1053 --scope "${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
1054
1055 finalize:
1056 name: Finalize release
1057 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'stable' }}
1058 needs: [preflight, release]
1059 runs-on: blacksmith-8vcpu-ubuntu-2404
1060 timeout-minutes: 10
1061 steps:
1062 - id: app_token
1063 name: Mint release app token
1064 uses: actions/create-github-app-token@v2
1065 with:
1066 app-id: ${{ secrets.RELEASE_APP_ID }}
1067 private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
1068 owner: ${{ github.repository_owner }}
1069
1070 - name: Checkout
1071 uses: actions/checkout@v6
1072 with:
1073 ref: main
1074 fetch-depth: 0
1075 token: ${{ steps.app_token.outputs.token }}
1076 persist-credentials: true
1077 sparse-checkout: |
1078 /*
1079 !/.repos/
1080 sparse-checkout-cone-mode: false
1081
1082 - id: app_bot
1083 name: Resolve GitHub App bot identity
1084 env:
1085 GH_TOKEN: ${{ steps.app_token.outputs.token }}
1086 APP_SLUG: ${{ steps.app_token.outputs.app-slug }}
1087 run: |
1088 user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
1089 echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT"
1090 echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT"
1091
1092 - name: Setup Vite+
1093 uses: voidzero-dev/setup-vp@v1
1094 with:
1095 node-version-file: package.json
1096 cache: true
1097 run-install: |
1098 args:
1099 - --filter=@t3tools/scripts...
1100 - --filter=@t3tools/oxlint-plugin-t3code...
1101
1102 - id: update_versions
1103 name: Update version strings
1104 env:
1105 RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
1106 run: node scripts/update-release-package-versions.ts "$RELEASE_VERSION" --github-output
1107
1108 - name: Format package.json files
1109 if: steps.update_versions.outputs.changed == 'true'
1110 run: vp fmt apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json
1111
1112 - name: Refresh lockfile
1113 if: steps.update_versions.outputs.changed == 'true'
1114 run: vp install --lockfile-only --ignore-scripts
1115
1116 - name: Commit and push version bump
1117 if: steps.update_versions.outputs.changed == 'true'
1118 shell: bash
1119 env:
1120 RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
1121 run: |
1122 if git diff --quiet -- apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json pnpm-lock.yaml; then
1123 echo "No version changes to commit."
1124 exit 0
1125 fi
1126
1127 git config user.name "${{ steps.app_bot.outputs.name }}"
1128 git config user.email "${{ steps.app_bot.outputs.email }}"
1129
1130 git add apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json pnpm-lock.yaml
1131 git commit -m "chore(release): prepare $RELEASE_TAG"
1132 git push origin HEAD:main
1133
1134 announce_discord:
1135 name: Announce release on Discord
1136 if: |
1137 always() && !cancelled() &&
1138 needs.preflight.result == 'success' &&
1139 needs.preflight.outputs.release_channel != 'preview' &&
1140 needs.relay_public_config.result == 'success' &&
1141 needs.release.result == 'success' &&
1142 needs.deploy_web.result == 'success' &&
1143 (needs.finalize.result == 'success' || needs.finalize.result == 'skipped')
1144 needs: [preflight, relay_public_config, release, deploy_web, finalize]
1145 runs-on: blacksmith-8vcpu-ubuntu-2404
1146 timeout-minutes: 10
1147 steps:
1148 - name: Checkout
1149 uses: actions/checkout@v6
1150 with:
1151 ref: ${{ needs.preflight.outputs.ref }}
1152 sparse-checkout: |
1153 /*
1154 !/.repos/
1155 sparse-checkout-cone-mode: false
1156
1157 - name: Setup Vite+
1158 uses: voidzero-dev/setup-vp@v1
1159 with:
1160 node-version-file: package.json
1161 cache: true
1162 run-install: |
1163 args:
1164 - --filter=@t3tools/scripts...
1165
1166 - name: Announce prerelease on Discord
1167 if: needs.preflight.outputs.is_prerelease == 'true'
1168 continue-on-error: true
1169 env:
1170 DISCORD_MENTION_ROLE_ID: ${{ secrets.DISCORD_RELEASE_NIGHTLY_ROLE_ID }}
1171 DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
1172 run: |
1173 node scripts/notify-discord-release.ts prerelease \
1174 --role-id "$DISCORD_MENTION_ROLE_ID" \
1175 --release-name "${{ needs.preflight.outputs.release_name }}" \
1176 --release-version "${{ needs.preflight.outputs.version }}" \
1177 --tag "${{ needs.preflight.outputs.tag }}" \
1178 --release-url "https://github.com/${{ github.repository }}/releases/tag/${{ needs.preflight.outputs.tag }}"
1179
1180 - name: Announce latest release on Discord
1181 if: needs.preflight.outputs.make_latest == 'true'
1182 continue-on-error: true
1183 env:
1184 DISCORD_MENTION_ROLE_ID: ${{ secrets.DISCORD_RELEASE_LATEST_ROLE_ID }}
1185 DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
1186 run: |
1187 node scripts/notify-discord-release.ts latest \
1188 --role-id "$DISCORD_MENTION_ROLE_ID" \
1189 --release-name "${{ needs.preflight.outputs.release_name }}" \
1190 --release-version "${{ needs.preflight.outputs.version }}" \
1191 --tag "${{ needs.preflight.outputs.tag }}" \
1192 --release-url "https://github.com/${{ github.repository }}/releases/tag/${{ needs.preflight.outputs.tag }}"