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