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