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

release.yml

1,167 lines48.3 KB

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