Open History to see the last commit
1name: Release
2
3on:
4 push:
5 tags:
6 - "v*.*.*"
7 - "!v*-nightly.*"
8 schedule:
9 - cron: "0 */3 * * *"
10 workflow_dispatch:
11 inputs:
12 channel:
13 description: "Release channel"
14 required: false
15 default: stable
16 type: choice
17 options:
18 - stable
19 - nightly
20 version:
21 description: "Release version (for example 1.2.3 or v1.2.3)"
22 required: false
23 type: string
24
25permissions:
26 contents: read
27 id-token: none
28
29jobs:
30 check_changes:
31 name: Check for changes since last nightly
32 if: github.event_name == 'schedule'
33 runs-on: blacksmith-8vcpu-ubuntu-2404
34 outputs:
35 has_changes: ${{ steps.check.outputs.has_changes }}
36 steps:
37 - name: Checkout
38 uses: actions/checkout@v6
39 with:
40 fetch-depth: 0
41 sparse-checkout: |
42 /*
43 !/.repos/
44 sparse-checkout-cone-mode: false
45
46 - id: check
47 name: Compare HEAD to last nightly tag
48 run: |
49 last_nightly_tag=$(git tag --list 'v*-nightly.*' 'nightly-v*' --sort=-creatordate | head -n 1)
50 if [[ -z "$last_nightly_tag" ]]; then
51 echo "No previous nightly tag found. Proceeding with release."
52 echo "has_changes=true" >> "$GITHUB_OUTPUT"
53 exit 0
54 fi
55
56 last_nightly_sha=$(git rev-parse "$last_nightly_tag^{commit}")
57 head_sha=$(git rev-parse HEAD)
58
59 if [[ "$last_nightly_sha" == "$head_sha" ]]; then
60 echo "No changes on main since last nightly release ($last_nightly_tag). Skipping."
61 echo "has_changes=false" >> "$GITHUB_OUTPUT"
62 else
63 echo "Changes detected on main since $last_nightly_tag ($last_nightly_sha → $head_sha). Proceeding."
64 echo "has_changes=true" >> "$GITHUB_OUTPUT"
65 fi
66
67 preflight:
68 name: Preflight
69 needs: [check_changes]
70 if: |
71 !failure() && !cancelled() &&
72 (github.event_name != 'schedule' || needs.check_changes.outputs.has_changes == 'true')
73 runs-on: blacksmith-8vcpu-ubuntu-2404
74 timeout-minutes: 10
75 outputs:
76 release_channel: ${{ steps.release_meta.outputs.release_channel }}
77 version: ${{ steps.release_meta.outputs.version }}
78 tag: ${{ steps.release_meta.outputs.tag }}
79 release_name: ${{ steps.release_meta.outputs.name }}
80 short_sha: ${{ steps.release_meta.outputs.short_sha }}
81 previous_tag: ${{ steps.previous_tag.outputs.previous_tag }}
82 cli_dist_tag: ${{ steps.release_meta.outputs.cli_dist_tag }}
83 is_prerelease: ${{ steps.release_meta.outputs.is_prerelease }}
84 make_latest: ${{ steps.release_meta.outputs.make_latest }}
85 ref: ${{ github.sha }}
86 steps:
87 - name: Checkout
88 uses: actions/checkout@v6
89 with:
90 fetch-depth: 0
91 sparse-checkout: |
92 /*
93 !/.repos/
94 sparse-checkout-cone-mode: false
95
96 - name: Setup Vite+
97 uses: voidzero-dev/setup-vp@v1
98 with:
99 node-version-file: package.json
100 cache: true
101 run-install: true
102
103 - name: Ensure Electron runtime is installed
104 run: vp run --filter @t3tools/desktop ensure:electron
105
106 - id: release_meta
107 name: Resolve release version
108 shell: bash
109 env:
110 DISPATCH_CHANNEL: ${{ github.event.inputs.channel }}
111 DISPATCH_VERSION: ${{ github.event.inputs.version }}
112 NIGHTLY_DATE: ${{ github.run_started_at }}
113 NIGHTLY_SHA: ${{ github.sha }}
114 NIGHTLY_RUN_NUMBER: ${{ github.run_number }}
115 run: |
116 if [[ "${GITHUB_EVENT_NAME}" == "schedule" || ( "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${DISPATCH_CHANNEL:-stable}" == "nightly" ) ]]; then
117 nightly_date="$(date -u -d "$NIGHTLY_DATE" +%Y%m%d)"
118
119 node scripts/resolve-nightly-release.ts \
120 --date "$nightly_date" \
121 --run-number "$NIGHTLY_RUN_NUMBER" \
122 --sha "$NIGHTLY_SHA" \
123 --github-output
124
125 echo "release_channel=nightly" >> "$GITHUB_OUTPUT"
126 echo "cli_dist_tag=nightly" >> "$GITHUB_OUTPUT"
127 echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
128 echo "make_latest=false" >> "$GITHUB_OUTPUT"
129 else
130 if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
131 raw="${DISPATCH_VERSION}"
132 if [[ -z "$raw" ]]; then
133 echo "workflow_dispatch stable releases require the version input." >&2
134 exit 1
135 fi
136 else
137 raw="${GITHUB_REF_NAME}"
138 fi
139
140 version="${raw#v}"
141 if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
142 echo "Invalid release version: $raw" >&2
143 exit 1
144 fi
145
146 echo "release_channel=stable" >> "$GITHUB_OUTPUT"
147 echo "version=$version" >> "$GITHUB_OUTPUT"
148 echo "tag=v$version" >> "$GITHUB_OUTPUT"
149 echo "name=T3 Code v$version" >> "$GITHUB_OUTPUT"
150 echo "cli_dist_tag=latest" >> "$GITHUB_OUTPUT"
151 if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
152 echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
153 echo "make_latest=true" >> "$GITHUB_OUTPUT"
154 else
155 echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
156 echo "make_latest=false" >> "$GITHUB_OUTPUT"
157 fi
158 fi
159
160 - name: Check
161 run: vp check
162
163 - name: Typecheck
164 run: vp run typecheck
165
166 - name: Test
167 run: vp run test
168
169 - id: previous_tag
170 name: Resolve previous release tag
171 run: |
172 node scripts/resolve-previous-release-tag.ts \
173 --channel "${{ steps.release_meta.outputs.release_channel }}" \
174 --current-tag "${{ steps.release_meta.outputs.tag }}" \
175 --github-output
176
177 relay_public_config:
178 name: Resolve T3 Connect public config
179 needs: preflight
180 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' }}
181 runs-on: blacksmith-8vcpu-ubuntu-2404
182 timeout-minutes: 5
183 environment:
184 name: production
185 outputs:
186 clerk_publishable_key: ${{ steps.public_config.outputs.clerk_publishable_key }}
187 clerk_jwt_template: ${{ steps.public_config.outputs.clerk_jwt_template }}
188 clerk_cli_oauth_client_id: ${{ steps.public_config.outputs.clerk_cli_oauth_client_id }}
189 relay_url: ${{ steps.public_config.outputs.relay_url }}
190 env:
191 CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
192 CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
193 RELAY_DOMAIN: ${{ vars.RELAY_DOMAIN }}
194 RELAY_API_ZONE_NAME: ${{ vars.RELAY_API_ZONE_NAME }}
195 CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
196 CLERK_JWT_TEMPLATE: ${{ vars.CLERK_JWT_TEMPLATE }}
197 CLERK_CLI_OAUTH_CLIENT_ID: ${{ vars.CLERK_CLI_OAUTH_CLIENT_ID }}
198 steps:
199 - name: Checkout
200 uses: actions/checkout@v6
201 with:
202 ref: ${{ needs.preflight.outputs.ref }}
203 sparse-checkout: |
204 /*
205 !/.repos/
206 sparse-checkout-cone-mode: false
207
208 - name: Setup Vite+
209 uses: voidzero-dev/setup-vp@v1
210 with:
211 node-version-file: package.json
212 cache: true
213 run-install: |
214 args:
215 - --filter=t3code-relay...
216
217 - id: relay_state
218 name: Read production relay tracing config
219 shell: bash
220 run: |
221 vp run --filter t3code-relay deploy \
222 --stage prod \
223 --read-state \
224 --github-output \
225 --github-env-file "$RUNNER_TEMP/relay-client-tracing.env"
226
227 - name: Upload relay client tracing config
228 uses: actions/upload-artifact@v7
229 with:
230 name: relay-client-tracing-config
231 path: ${{ runner.temp }}/relay-client-tracing.env
232 if-no-files-found: error
233 retention-days: 1
234
235 - id: public_config
236 name: Resolve production relay public config
237 shell: bash
238 run: |
239 set -euo pipefail
240
241 relay_domain="${RELAY_DOMAIN:-}"
242 if [[ -z "$relay_domain" && -n "${RELAY_API_ZONE_NAME:-}" ]]; then
243 relay_domain="relay.$RELAY_API_ZONE_NAME"
244 fi
245 required=(
246 relay_domain
247 CLERK_PUBLISHABLE_KEY
248 CLERK_JWT_TEMPLATE
249 CLERK_CLI_OAUTH_CLIENT_ID
250 )
251 missing=()
252 for name in "${required[@]}"; do
253 if [[ -z "${!name:-}" ]]; then
254 missing+=("$name")
255 fi
256 done
257 if (( ${#missing[@]} > 0 )); then
258 printf 'Missing required relay deployment configuration: %s\n' "${missing[*]}" >&2
259 exit 1
260 fi
261
262 echo "clerk_publishable_key=$CLERK_PUBLISHABLE_KEY" >> "$GITHUB_OUTPUT"
263 echo "clerk_jwt_template=$CLERK_JWT_TEMPLATE" >> "$GITHUB_OUTPUT"
264 echo "clerk_cli_oauth_client_id=$CLERK_CLI_OAUTH_CLIENT_ID" >> "$GITHUB_OUTPUT"
265 echo "relay_url=https://$relay_domain" >> "$GITHUB_OUTPUT"
266
267 # node-pty publishes no Linux prebuilt. Build its native binary on the declared
268 # WSL compatibility floor (Ubuntu 22.04 / glibc 2.35) and capture the exact
269 # Linux Node runtime used for the build. The Windows artifact ships that Node
270 # binary too, so packaged WSL startup never depends on a distro-installed Node.
271 # Audit every Linux executable/native dependency that Windows will hand to WSL.
272 build_wsl_node_pty:
273 name: Build + audit WSL native runtime (Ubuntu 22.04 ABI container)
274 needs: [preflight]
275 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' }}
276 # Keep the ABI floor on Jammy/glibc 2.35 without depending on GitHub's
277 # ubuntu-22.04 runner label, which is entering deprecation. The host can
278 # advance independently while every compiler/auditor command runs in the
279 # Ubuntu 22.04 container.
280 runs-on: ubuntu-24.04
281 container:
282 image: ubuntu:22.04
283 timeout-minutes: 20
284 steps:
285 - name: Bootstrap Ubuntu 22.04 ABI container
286 shell: bash
287 run: |
288 set -euo pipefail
289 apt-get update
290 DEBIAN_FRONTEND=noninteractive apt-get install -y \
291 build-essential \
292 ca-certificates \
293 curl \
294 git \
295 file \
296 python3 \
297 binutils
298 test "$(getconf GNU_LIBC_VERSION)" = "glibc 2.35"
299
300 - name: Checkout
301 uses: actions/checkout@v6
302 with:
303 ref: ${{ needs.preflight.outputs.ref }}
304 sparse-checkout: |
305 /*
306 !/.repos/
307 sparse-checkout-cone-mode: false
308
309 - name: Report WSL ABI build tooling
310 shell: bash
311 run: |
312 set -euo pipefail
313 getconf GNU_LIBC_VERSION
314 g++ --version
315 readelf --version | head -n 1
316
317 - name: Setup Vite+
318 uses: voidzero-dev/setup-vp@v1
319 with:
320 node-version-file: package.json
321 cache: true
322 run-install: |
323 args:
324 - --filter=t3...
325
326 - name: Test WSL ABI auditor
327 run: node --test scripts/audit-wsl-native-abi.test.mjs
328
329 - name: Build node-pty + capture bundled Linux Node runtime
330 shell: bash
331 run: |
332 set -euo pipefail
333 pty_pkg="$(node -e "console.log(require.resolve('node-pty/package.json', { paths: ['$GITHUB_WORKSPACE/apps/server'] }))")"
334 pty_dir="$(dirname "$pty_pkg")"
335 ( cd "$pty_dir" && npx --yes node-gyp@12.3.0 rebuild )
336 mkdir -p wsl-prebuild
337 cp "$pty_dir/build/Release/pty.node" wsl-prebuild/pty.node
338 cp -L "$(command -v node)" wsl-prebuild/node
339 chmod 0755 wsl-prebuild/node
340 file wsl-prebuild/pty.node wsl-prebuild/node
341 echo "Bundled WSL Node: $(wsl-prebuild/node --version)"
342
343 - name: Audit WSL native ABI floor
344 shell: bash
345 run: |
346 set -euo pipefail
347 libstdcxx="$(g++ -print-file-name=libstdc++.so.6)"
348 node scripts/audit-wsl-native-abi.mjs \
349 --baseline ubuntu-22.04 \
350 --arch x64 \
351 --max-glibc 2.35 \
352 --libstdcxx "$libstdcxx" \
353 --server-root apps/server \
354 --node-pty wsl-prebuild/pty.node \
355 --node-runtime wsl-prebuild/node \
356 --output wsl-prebuild/wsl-native-abi.json
357 cat wsl-prebuild/wsl-native-abi.json
358
359 - name: Smoke WSL native runtime on compatibility floor
360 shell: bash
361 run: |
362 set -euo pipefail
363 wsl-prebuild/node scripts/smoke-wsl-native-runtime.mjs \
364 --server-root apps/server \
365 --arch x64 \
366 --node-pty wsl-prebuild/pty.node \
367 --node-runtime wsl-prebuild/node \
368 --manifest wsl-prebuild/wsl-native-abi.json
369
370 - name: Upload ABI-audited WSL runtime receipt
371 uses: actions/upload-artifact@v7
372 with:
373 name: wsl-node-pty-x64
374 path: wsl-prebuild/
375 if-no-files-found: error
376
377 validate_wsl_native_runtime:
378 name: Validate WSL native runtime (Ubuntu 24.04)
379 needs: [preflight, build_wsl_node_pty]
380 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build_wsl_node_pty.result == 'success' }}
381 runs-on: ubuntu-24.04
382 timeout-minutes: 10
383 steps:
384 - name: Checkout
385 uses: actions/checkout@v6
386 with:
387 ref: ${{ needs.preflight.outputs.ref }}
388 sparse-checkout: |
389 /*
390 !/.repos/
391 sparse-checkout-cone-mode: false
392
393 - name: Setup Vite+
394 uses: voidzero-dev/setup-vp@v1
395 with:
396 node-version-file: package.json
397 cache: true
398 run-install: |
399 args:
400 - --filter=t3...
401
402 - name: Download ABI-audited WSL runtime
403 uses: actions/download-artifact@v8
404 with:
405 name: wsl-node-pty-x64
406 path: wsl-prebuild
407
408 - name: Smoke identical native bytes on Ubuntu 24.04
409 shell: bash
410 run: |
411 set -euo pipefail
412 getconf GNU_LIBC_VERSION
413 # Artifact upload/download does not preserve POSIX executable mode.
414 # Runtime hashing is content-only, so restore execute permission before
415 # exercising the exact audited Node bytes.
416 chmod 0755 wsl-prebuild/node
417 wsl-prebuild/node scripts/smoke-wsl-native-runtime.mjs \
418 --server-root apps/server \
419 --arch x64 \
420 --node-pty wsl-prebuild/pty.node \
421 --node-runtime wsl-prebuild/node \
422 --manifest wsl-prebuild/wsl-native-abi.json
423
424 build:
425 name: Build ${{ matrix.label }}
426 # WSL native build/validation jobs stay in `needs` so their audited artifact
427 # is available to Windows. macOS/Linux builds remain independent: if either
428 # WSL job fails, the matrix still runs and the Windows-only gate below fails
429 # that platform instead of suppressing unrelated artifacts.
430 needs: [preflight, relay_public_config, build_wsl_node_pty, validate_wsl_native_runtime]
431 if: ${{ !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' }}
432 runs-on: ${{ matrix.runner }}
433 timeout-minutes: 30
434 env:
435 T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
436 T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
437 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
438 T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
439 strategy:
440 fail-fast: false
441 matrix:
442 include:
443 - label: macOS arm64
444 runner: blacksmith-12vcpu-macos-26
445 platform: mac
446 target: dmg
447 arch: arm64
448 rust_target: aarch64-apple-darwin
449 resource_key: darwin-arm64
450 - label: macOS x64
451 runner: blacksmith-12vcpu-macos-26
452 platform: mac
453 target: dmg
454 arch: x64
455 rust_target: x86_64-apple-darwin
456 resource_key: darwin-x64
457 - label: Linux x64
458 runner: blacksmith-32vcpu-ubuntu-2404
459 platform: linux
460 target: AppImage
461 arch: x64
462 rust_target: x86_64-unknown-linux-gnu
463 resource_key: linux-x64
464 - label: Windows x64
465 runner: blacksmith-32vcpu-windows-2025
466 platform: win
467 target: nsis
468 arch: x64
469 rust_target: x86_64-pc-windows-msvc
470 resource_key: win32-x64
471 # - label: Windows arm64
472 # runner: windows-11-arm
473 # platform: win
474 # target: nsis
475 # arch: arm64
476 steps:
477 - name: Checkout
478 uses: actions/checkout@v6
479 with:
480 ref: ${{ needs.preflight.outputs.ref }}
481 sparse-checkout: |
482 /*
483 !/.repos/
484 sparse-checkout-cone-mode: false
485
486 - name: Setup Vite+
487 uses: voidzero-dev/setup-vp@v1
488 with:
489 node-version-file: package.json
490 cache: true
491 run-install: |
492 args:
493 - --filter=@t3tools/desktop...
494 - --filter=t3...
495 - --filter=@t3tools/scripts...
496
497 - name: Setup Rust
498 uses: dtolnay/rust-toolchain@stable
499 with:
500 targets: ${{ matrix.rust_target }}
501
502 - name: Download relay client tracing config
503 uses: actions/download-artifact@v8
504 with:
505 name: relay-client-tracing-config
506 path: ${{ runner.temp }}/relay-client-tracing
507
508 - name: Load relay client tracing config
509 shell: bash
510 run: |
511 config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
512 tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
513 echo "::add-mask::$tracing_token"
514 cat "$config_path" >> "$GITHUB_ENV"
515
516 - name: Align package versions to release version
517 run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
518
519 - name: Require WSL native compatibility validation
520 if: matrix.platform == 'win'
521 shell: bash
522 run: |
523 if [[ "${{ needs.build_wsl_node_pty.result }}" != "success" || "${{ needs.validate_wsl_native_runtime.result }}" != "success" ]]; then
524 echo "Windows packaging requires successful Ubuntu 22.04 ABI audit and Ubuntu 24.04 native-runtime smoke validation." >&2
525 exit 1
526 fi
527
528 - name: Download WSL runtime + ABI receipt
529 if: matrix.platform == 'win'
530 uses: actions/download-artifact@v8
531 with:
532 name: wsl-node-pty-x64
533 path: wsl-prebuild
534
535 - name: Install Spectre-mitigated MSVC libs
536 if: matrix.platform == 'win'
537 shell: pwsh
538 run: |
539 $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
540 $installPath = & $vswhere -products * -latest -property installationPath
541 $setupExe = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe"
542 $proc = Start-Process -FilePath $setupExe `
543 -ArgumentList "modify", "--installPath", "`"$installPath`"", "--add", `
544 "Microsoft.VisualStudio.Component.VC.Tools.x86.x64.Spectre", "--quiet", "--norestart" `
545 -Wait -PassThru -NoNewWindow
546 if ($null -eq $proc -or $proc.ExitCode -ne 0) {
547 $code = if ($null -ne $proc) { $proc.ExitCode } else { 1 }
548 Write-Error "Visual Studio Installer failed with exit code $code"
549 exit $code
550 }
551
552 - name: Install ImageMagick
553 if: matrix.platform == 'linux'
554 shell: bash
555 run: |
556 if ! command -v magick >/dev/null 2>&1 && ! command -v convert >/dev/null 2>&1; then
557 sudo apt-get update
558 sudo apt-get install -y imagemagick
559 fi
560
561 if command -v magick >/dev/null 2>&1; then
562 magick -version
563 else
564 convert -version
565 fi
566
567 - name: Prepare Azure Trusted Signing
568 if: matrix.platform == 'win'
569 shell: pwsh
570 env:
571 AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
572 AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
573 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
574 AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
575 AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
576 AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
577 AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
578 run: |
579 $ErrorActionPreference = "Stop"
580
581 $requiredSecrets = @(
582 $env:AZURE_TENANT_ID,
583 $env:AZURE_CLIENT_ID,
584 $env:AZURE_CLIENT_SECRET,
585 $env:AZURE_TRUSTED_SIGNING_ENDPOINT,
586 $env:AZURE_TRUSTED_SIGNING_ACCOUNT_NAME,
587 $env:AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME,
588 $env:AZURE_TRUSTED_SIGNING_PUBLISHER_NAME
589 )
590 if ($requiredSecrets | Where-Object { [string]::IsNullOrWhiteSpace($_) }) {
591 Write-Host "Azure Trusted Signing disabled; skipping TrustedSigning module preparation."
592 exit 0
593 }
594
595 try {
596 Install-PackageProvider `
597 -Name NuGet `
598 -MinimumVersion 2.8.5.201 `
599 -Force `
600 -Scope CurrentUser `
601 -ErrorAction Stop
602 } catch {
603 Write-Warning "Could not bootstrap NuGet package provider. Continuing because the runner may already have a usable provider. $($_.Exception.Message)"
604 }
605
606 Install-Module `
607 -Name TrustedSigning `
608 -MinimumVersion 0.5.0 `
609 -Force `
610 -AllowClobber `
611 -Repository PSGallery `
612 -Scope CurrentUser `
613 -ErrorAction Stop
614
615 Import-Module TrustedSigning -MinimumVersion 0.5.0 -Force
616 Get-Command Invoke-TrustedSigning -ErrorAction Stop
617
618 $moduleRoots = @(
619 [System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "PowerShell", "Modules"),
620 [System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "WindowsPowerShell", "Modules"),
621 [System.IO.Path]::Combine($env:ProgramFiles, "PowerShell", "Modules"),
622 [System.IO.Path]::Combine($env:ProgramFiles, "WindowsPowerShell", "Modules")
623 )
624 $modulePathEntries = @($moduleRoots + ($env:PSModulePath -split ";")) |
625 Where-Object { $_ -and (Test-Path $_) } |
626 Select-Object -Unique
627 "PSModulePath=$($modulePathEntries -join ';')" >> $env:GITHUB_ENV
628
629 - name: Build desktop artifact
630 shell: bash
631 env:
632 CSC_LINK: ${{ secrets.CSC_LINK }}
633 CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
634 APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
635 APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
636 APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
637 APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
638 MACOS_PROVISIONING_PROFILE: ${{ secrets.MACOS_PROVISIONING_PROFILE }}
639 T3CODE_CLERK_PASSKEY_RP_DOMAINS: ${{ vars.CLERK_PASSKEY_RP_DOMAINS }}
640 AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
641 AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
642 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
643 AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
644 AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
645 AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
646 AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
647 run: |
648 args=(
649 --platform "${{ matrix.platform }}"
650 --target "${{ matrix.target }}"
651 --arch "${{ matrix.arch }}"
652 --build-version "${{ needs.preflight.outputs.version }}"
653 --verbose
654 )
655
656 has_all() {
657 for value in "$@"; do
658 if [[ -z "$value" ]]; then
659 return 1
660 fi
661 done
662 return 0
663 }
664
665 if [[ "${{ matrix.platform }}" == "mac" ]]; then
666 if has_all "$CSC_LINK" "$CSC_KEY_PASSWORD" "$APPLE_API_KEY" "$APPLE_API_KEY_ID" "$APPLE_API_ISSUER"; then
667 if ! has_all "$APPLE_TEAM_ID" "$MACOS_PROVISIONING_PROFILE"; then
668 echo "macOS signing is configured, but APPLE_TEAM_ID or MACOS_PROVISIONING_PROFILE is missing." >&2
669 exit 1
670 fi
671
672 key_path="$RUNNER_TEMP/AuthKey_${APPLE_API_KEY_ID}.p8"
673 printf '%s' "$APPLE_API_KEY" > "$key_path"
674 export APPLE_API_KEY="$key_path"
675
676 profile_path="$RUNNER_TEMP/t3code.provisionprofile"
677 printf '%s' "$MACOS_PROVISIONING_PROFILE" | base64 -D > "$profile_path"
678 security cms -D -i "$profile_path" >/dev/null
679 export T3CODE_APPLE_TEAM_ID="$APPLE_TEAM_ID"
680 export T3CODE_MACOS_PROVISIONING_PROFILE="$profile_path"
681
682 echo "macOS signing enabled."
683 args+=(--signed)
684 else
685 echo "macOS signing disabled (missing one or more Apple signing secrets)."
686 fi
687 elif [[ "${{ matrix.platform }}" == "win" ]]; then
688 # Bundle the ABI-audited Linux Node runtime and node-pty binary built
689 # by the compatibility-floor job. WSL startup must not depend on a
690 # user-installed Node.js or first-launch native compilation.
691 args+=(--wsl-prebuild "$GITHUB_WORKSPACE/wsl-prebuild/pty.node")
692 if has_all \
693 "$AZURE_TENANT_ID" \
694 "$AZURE_CLIENT_ID" \
695 "$AZURE_CLIENT_SECRET" \
696 "$AZURE_TRUSTED_SIGNING_ENDPOINT" \
697 "$AZURE_TRUSTED_SIGNING_ACCOUNT_NAME" \
698 "$AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME" \
699 "$AZURE_TRUSTED_SIGNING_PUBLISHER_NAME"; then
700 echo "Windows signing enabled (Azure Trusted Signing)."
701 args+=(--signed)
702 else
703 echo "Windows signing disabled (missing one or more Azure Trusted Signing secrets)."
704 fi
705 else
706 echo "Signing disabled for ${{ matrix.platform }}."
707 fi
708
709 vp run dist:desktop:artifact "${args[@]}"
710
711 - name: Collect release assets
712 shell: bash
713 run: |
714 set -euo pipefail
715 mkdir -p release-publish
716
717 shopt -s nullglob
718 for pattern in \
719 "release/*.dmg" \
720 "release/*.zip" \
721 "release/*.AppImage" \
722 "release/*.exe" \
723 "release/*.blockmap" \
724 "release/*.yml"; do
725 for file in $pattern; do
726 cp "$file" release-publish/
727 done
728 done
729
730 if [[ "${{ matrix.platform }}" == "mac" && "${{ matrix.arch }}" != "arm64" ]]; then
731 shopt -s nullglob
732 for manifest in release-publish/*-mac.yml; do
733 mv "$manifest" "${manifest%.yml}-${{ matrix.arch }}.yml"
734 done
735 fi
736
737 # Enable if Windows arm64 builds are enabled.
738 # Windows updater metadata is channel-specific (for example
739 # "latest.yml" or "nightly.yml"). Suffix each per-arch copy so the
740 # release job can merge matching arm64/x64 manifests back into one
741 # canonical manifest per channel.
742 # if [[ "${{ matrix.platform }}" == "win" ]]; then
743 # shopt -s nullglob
744 # for manifest in release-publish/*.yml; do
745 # mv "$manifest" "${manifest%.yml}-win-${{ matrix.arch }}.yml"
746 # done
747 # fi
748
749 - name: Collect resource monitor
750 shell: bash
751 run: |
752 set -euo pipefail
753 binary_name="t3-resource-monitor"
754 if [[ "${{ matrix.platform }}" == "win" ]]; then
755 binary_name="${binary_name}.exe"
756 fi
757 source_path="native/resource-monitor/target/${{ matrix.rust_target }}/release/${binary_name}"
758 target_dir="resource-monitor-publish/${{ matrix.resource_key }}"
759 mkdir -p "$target_dir"
760 cp "$source_path" "$target_dir/$binary_name"
761
762 - name: Upload build artifacts
763 uses: actions/upload-artifact@v7
764 with:
765 name: desktop-${{ matrix.platform }}-${{ matrix.arch }}
766 path: release-publish/*
767 if-no-files-found: error
768
769 - name: Upload resource monitor
770 uses: actions/upload-artifact@v7
771 with:
772 name: resource-monitor-${{ matrix.resource_key }}
773 path: resource-monitor-publish/${{ matrix.resource_key }}/*
774 if-no-files-found: error
775
776 publish_cli:
777 name: Publish CLI to npm
778 needs: [preflight, relay_public_config, build]
779 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build.result == 'success' }}
780 runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
781 timeout-minutes: 10
782 permissions:
783 contents: read
784 id-token: write
785 env:
786 T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
787 T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
788 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
789 T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
790 steps:
791 - name: Checkout
792 uses: actions/checkout@v6
793 with:
794 ref: ${{ needs.preflight.outputs.ref }}
795 sparse-checkout: |
796 /*
797 !/.repos/
798 sparse-checkout-cone-mode: false
799
800 - name: Setup Vite+
801 uses: voidzero-dev/setup-vp@v1
802 with:
803 node-version-file: package.json
804 cache: true
805 run-install: |
806 args:
807 - --filter=t3...
808 - --filter=@t3tools/web...
809 - --filter=@t3tools/scripts...
810
811 - name: Download relay client tracing config
812 uses: actions/download-artifact@v8
813 with:
814 name: relay-client-tracing-config
815 path: ${{ runner.temp }}/relay-client-tracing
816
817 - name: Load relay client tracing config
818 shell: bash
819 run: |
820 config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
821 tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
822 echo "::add-mask::$tracing_token"
823 cat "$config_path" >> "$GITHUB_ENV"
824
825 - name: Align package versions to release version
826 run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
827
828 - name: Build web package
829 run: vp run --filter @t3tools/web build
830
831 - name: Build CLI package
832 run: vp run --filter t3 build
833
834 - name: Download resource monitors
835 uses: actions/download-artifact@v8
836 with:
837 pattern: resource-monitor-*
838 path: ${{ runner.temp }}/resource-monitors
839
840 - name: Bundle resource monitors into CLI package
841 shell: bash
842 run: |
843 set -euo pipefail
844 for artifact_dir in "$RUNNER_TEMP"/resource-monitors/resource-monitor-*; do
845 resource_key="${artifact_dir##*/resource-monitor-}"
846 target_dir="apps/server/dist/resource-monitor/${resource_key}"
847 mkdir -p "$target_dir"
848 cp "$artifact_dir"/t3-resource-monitor* "$target_dir/"
849 chmod +x "$target_dir"/t3-resource-monitor 2>/dev/null || true
850 done
851
852 - name: Publish CLI package
853 run: node apps/server/scripts/cli.ts publish --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --app-version "${{ needs.preflight.outputs.version }}" --verbose
854
855 release:
856 name: Publish GitHub Release
857 needs: [preflight, build, publish_cli]
858 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build.result == 'success' && needs.publish_cli.result == 'success' }}
859 runs-on: blacksmith-8vcpu-ubuntu-2404
860 timeout-minutes: 30
861 permissions:
862 contents: write
863 steps:
864 - name: Checkout
865 uses: actions/checkout@v6
866 with:
867 ref: ${{ needs.preflight.outputs.ref }}
868 sparse-checkout: |
869 /*
870 !/.repos/
871 sparse-checkout-cone-mode: false
872
873 - name: Setup Vite+
874 uses: voidzero-dev/setup-vp@v1
875 with:
876 node-version-file: package.json
877 cache: true
878 run-install: |
879 args:
880 - --filter=@t3tools/scripts...
881
882 - name: Download all desktop artifacts
883 uses: actions/download-artifact@v8
884 with:
885 pattern: desktop-*
886 merge-multiple: true
887 path: release-assets
888
889 - name: Merge macOS updater manifests
890 run: |
891 shopt -s nullglob
892 for x64_manifest in release-assets/*-mac-x64.yml; do
893 arm64_manifest="${x64_manifest%-x64.yml}.yml"
894 if [[ -f "$arm64_manifest" ]]; then
895 node scripts/merge-update-manifests.ts --platform mac "$arm64_manifest" "$x64_manifest"
896 rm -f "$x64_manifest"
897 fi
898 done
899
900 # - name: Merge Windows updater manifests
901 # run: |
902 # shopt -s nullglob
903 # found_windows_manifest=false
904 # for x64_manifest in release-assets/*-win-x64.yml; do
905 # if [[ "$(basename "$x64_manifest")" == builder-debug-* ]]; then
906 # continue
907 # fi
908
909 # arm64_manifest="${x64_manifest/-x64.yml/-arm64.yml}"
910 # output_manifest="${x64_manifest/-win-x64.yml/.yml}"
911 # if [[ ! -f "$arm64_manifest" ]]; then
912 # echo "Missing matching arm64 Windows manifest for $x64_manifest" >&2
913 # exit 1
914 # fi
915
916 # found_windows_manifest=true
917 # node scripts/merge-update-manifests.ts --platform win \
918 # "$arm64_manifest" \
919 # "$x64_manifest" \
920 # "$output_manifest"
921 # rm -f "$arm64_manifest" "$x64_manifest"
922 # done
923
924 # if [[ "$found_windows_manifest" != true ]]; then
925 # echo "No Windows updater manifests found to merge." >&2
926 # exit 1
927 # fi
928
929 - name: Publish release
930 if: needs.preflight.outputs.previous_tag != ''
931 uses: softprops/action-gh-release@v3
932 with:
933 tag_name: ${{ needs.preflight.outputs.tag }}
934 target_commitish: ${{ needs.preflight.outputs.ref }}
935 name: ${{ needs.preflight.outputs.release_name }}
936 generate_release_notes: true
937 previous_tag: ${{ needs.preflight.outputs.previous_tag }}
938 prerelease: ${{ needs.preflight.outputs.is_prerelease }}
939 make_latest: ${{ needs.preflight.outputs.make_latest }}
940 files: |
941 release-assets/*.dmg
942 release-assets/*.zip
943 release-assets/*.AppImage
944 release-assets/*.exe
945 release-assets/*.blockmap
946 release-assets/*.yml
947 fail_on_unmatched_files: true
948 token: ${{ github.token }}
949
950 - name: Publish first release
951 if: needs.preflight.outputs.previous_tag == ''
952 uses: softprops/action-gh-release@v3
953 with:
954 tag_name: ${{ needs.preflight.outputs.tag }}
955 target_commitish: ${{ needs.preflight.outputs.ref }}
956 name: ${{ needs.preflight.outputs.release_name }}
957 generate_release_notes: true
958 prerelease: ${{ needs.preflight.outputs.is_prerelease }}
959 make_latest: ${{ needs.preflight.outputs.make_latest }}
960 files: |
961 release-assets/*.dmg
962 release-assets/*.zip
963 release-assets/*.AppImage
964 release-assets/*.exe
965 release-assets/*.blockmap
966 release-assets/*.yml
967 fail_on_unmatched_files: true
968 token: ${{ github.token }}
969
970 deploy_web:
971 name: Deploy hosted web app
972 needs: [preflight, relay_public_config, release]
973 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.release.result == 'success' }}
974 runs-on: blacksmith-8vcpu-ubuntu-2404
975 timeout-minutes: 10
976 env:
977 T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
978 T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
979 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
980 T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
981 VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
982 VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
983 VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
984 T3CODE_WEB_ROUTER_URL: ${{ vars.T3CODE_WEB_ROUTER_URL }}
985 T3CODE_WEB_LATEST_DOMAIN: ${{ vars.T3CODE_WEB_LATEST_DOMAIN }}
986 T3CODE_WEB_NIGHTLY_DOMAIN: ${{ vars.T3CODE_WEB_NIGHTLY_DOMAIN }}
987 VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }}
988 steps:
989 - name: Checkout
990 uses: actions/checkout@v6
991 with:
992 ref: ${{ needs.preflight.outputs.ref }}
993 sparse-checkout: |
994 /*
995 !/.repos/
996 sparse-checkout-cone-mode: false
997
998 - name: Setup Vite+
999 uses: voidzero-dev/setup-vp@v1
1000 with:
1001 node-version-file: package.json
1002 cache: true
1003 run-install: |
1004 args:
1005 - --filter=@t3tools/scripts...
1006 - --filter=@t3tools/web...
1007
1008 - name: Download relay client tracing config
1009 uses: actions/download-artifact@v8
1010 with:
1011 name: relay-client-tracing-config
1012 path: ${{ runner.temp }}/relay-client-tracing
1013
1014 - name: Load relay client tracing config
1015 shell: bash
1016 run: |
1017 config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
1018 tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
1019 echo "::add-mask::$tracing_token"
1020 cat "$config_path" >> "$GITHUB_ENV"
1021
1022 - name: Align package versions to release version
1023 run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
1024
1025 - name: Refresh release lockfile
1026 run: vp install --lockfile-only --ignore-scripts
1027
1028 - name: Deploy and alias channel
1029 shell: bash
1030 run: |
1031 set -euo pipefail
1032
1033 if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" || -z "${VERCEL_PROJECT_ID:-}" ]]; then
1034 echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID." >&2
1035 exit 1
1036 fi
1037
1038 router_url="${T3CODE_WEB_ROUTER_URL:-https://app.t3.codes}"
1039 latest_domain="${T3CODE_WEB_LATEST_DOMAIN:-latest.app.t3.codes}"
1040 nightly_domain="${T3CODE_WEB_NIGHTLY_DOMAIN:-nightly.app.t3.codes}"
1041 router_domain="${router_url#http://}"
1042 router_domain="${router_domain#https://}"
1043 router_domain="${router_domain%%/*}"
1044
1045 if [[ "${{ needs.preflight.outputs.release_channel }}" == "stable" ]]; then
1046 channel_domain="$latest_domain"
1047 channel_name="latest"
1048 else
1049 channel_domain="$nightly_domain"
1050 channel_name="nightly"
1051 fi
1052
1053 vercel_scope="${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
1054 vercel_scope_args=(--scope "$vercel_scope")
1055
1056 echo "Deploying hosted web app for $channel_name channel."
1057 deployment_url="$(
1058 vp dlx vercel@53.1.1 deploy \
1059 --archive=tgz \
1060 --prod \
1061 --skip-domain \
1062 --yes \
1063 --token "$VERCEL_TOKEN" \
1064 "${vercel_scope_args[@]}" \
1065 --build-env "APP_VERSION=${{ needs.preflight.outputs.version }}" \
1066 --build-env "T3CODE_CLERK_PUBLISHABLE_KEY=${T3CODE_CLERK_PUBLISHABLE_KEY:-}" \
1067 --build-env "T3CODE_CLERK_JWT_TEMPLATE=${T3CODE_CLERK_JWT_TEMPLATE:-}" \
1068 --build-env "T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=${T3CODE_CLERK_CLI_OAUTH_CLIENT_ID:-}" \
1069 --build-env "T3CODE_RELAY_URL=${T3CODE_RELAY_URL:-}" \
1070 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_URL=${T3CODE_RELAY_CLIENT_OTLP_TRACES_URL:-}" \
1071 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET=${T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET:-}" \
1072 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=${T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN:-}" \
1073 --build-env "VITE_HOSTED_APP_URL=$router_url" \
1074 --build-env "VITE_HOSTED_APP_CHANNEL=$channel_name"
1075 )"
1076
1077 echo "Aliasing $deployment_url to $channel_domain."
1078 vp dlx vercel@53.1.1 alias set "$deployment_url" "$channel_domain" \
1079 --token "$VERCEL_TOKEN" \
1080 "${vercel_scope_args[@]}"
1081
1082 if [[ "$channel_name" == "latest" && -n "$router_domain" && "$router_domain" != "$channel_domain" ]]; then
1083 echo "Aliasing $deployment_url to router domain $router_domain."
1084 vp dlx vercel@53.1.1 alias set "$deployment_url" "$router_domain" \
1085 --token "$VERCEL_TOKEN" \
1086 "${vercel_scope_args[@]}"
1087 fi
1088
1089 finalize:
1090 name: Finalize release
1091 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'stable' }}
1092 needs: [preflight, release]
1093 runs-on: blacksmith-8vcpu-ubuntu-2404
1094 timeout-minutes: 10
1095 steps:
1096 - id: app_token
1097 name: Mint release app token
1098 uses: actions/create-github-app-token@v2
1099 with:
1100 app-id: ${{ secrets.RELEASE_APP_ID }}
1101 private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
1102 owner: ${{ github.repository_owner }}
1103
1104 - name: Checkout
1105 uses: actions/checkout@v6
1106 with:
1107 ref: main
1108 fetch-depth: 0
1109 token: ${{ steps.app_token.outputs.token }}
1110 persist-credentials: true
1111 sparse-checkout: |
1112 /*
1113 !/.repos/
1114 sparse-checkout-cone-mode: false
1115
1116 - id: app_bot
1117 name: Resolve GitHub App bot identity
1118 env:
1119 GH_TOKEN: ${{ steps.app_token.outputs.token }}
1120 APP_SLUG: ${{ steps.app_token.outputs.app-slug }}
1121 run: |
1122 user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
1123 echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT"
1124 echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT"
1125
1126 - name: Setup Vite+
1127 uses: voidzero-dev/setup-vp@v1
1128 with:
1129 node-version-file: package.json
1130 cache: true
1131 run-install: |
1132 args:
1133 - --filter=@t3tools/scripts...
1134 - --filter=@t3tools/oxlint-plugin-t3code...
1135
1136 - id: update_versions
1137 name: Update version strings
1138 env:
1139 RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
1140 run: node scripts/update-release-package-versions.ts "$RELEASE_VERSION" --github-output
1141
1142 - name: Format package.json files
1143 if: steps.update_versions.outputs.changed == 'true'
1144 run: vp fmt apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json
1145
1146 - name: Refresh lockfile
1147 if: steps.update_versions.outputs.changed == 'true'
1148 run: vp install --lockfile-only --ignore-scripts
1149
1150 - name: Commit and push version bump
1151 if: steps.update_versions.outputs.changed == 'true'
1152 shell: bash
1153 env:
1154 RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
1155 run: |
1156 if git diff --quiet -- apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json pnpm-lock.yaml; then
1157 echo "No version changes to commit."
1158 exit 0
1159 fi
1160
1161 git config user.name "${{ steps.app_bot.outputs.name }}"
1162 git config user.email "${{ steps.app_bot.outputs.email }}"
1163
1164 git add apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json pnpm-lock.yaml
1165 git commit -m "chore(release): prepare $RELEASE_TAG"
1166 git push origin HEAD:main
1167
1168 announce_discord:
1169 name: Announce release on Discord
1170 if: |
1171 always() && !cancelled() &&
1172 needs.preflight.result == 'success' &&
1173 needs.relay_public_config.result == 'success' &&
1174 needs.release.result == 'success' &&
1175 needs.deploy_web.result == 'success' &&
1176 (needs.finalize.result == 'success' || needs.finalize.result == 'skipped')
1177 needs: [preflight, relay_public_config, release, deploy_web, finalize]
1178 runs-on: blacksmith-8vcpu-ubuntu-2404
1179 timeout-minutes: 10
1180 steps:
1181 - name: Checkout
1182 uses: actions/checkout@v6
1183 with:
1184 ref: ${{ needs.preflight.outputs.ref }}
1185 sparse-checkout: |
1186 /*
1187 !/.repos/
1188 sparse-checkout-cone-mode: false
1189
1190 - name: Setup Vite+
1191 uses: voidzero-dev/setup-vp@v1
1192 with:
1193 node-version-file: package.json
1194 cache: true
1195 run-install: |
1196 args:
1197 - --filter=@t3tools/scripts...
1198
1199 - name: Announce prerelease on Discord
1200 if: needs.preflight.outputs.is_prerelease == 'true'
1201 continue-on-error: true
1202 env:
1203 DISCORD_MENTION_ROLE_ID: ${{ secrets.DISCORD_RELEASE_NIGHTLY_ROLE_ID }}
1204 DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
1205 run: |
1206 node scripts/notify-discord-release.ts prerelease \
1207 --role-id "$DISCORD_MENTION_ROLE_ID" \
1208 --release-name "${{ needs.preflight.outputs.release_name }}" \
1209 --release-version "${{ needs.preflight.outputs.version }}" \
1210 --tag "${{ needs.preflight.outputs.tag }}" \
1211 --release-url "https://github.com/${{ github.repository }}/releases/tag/${{ needs.preflight.outputs.tag }}"
1212
1213 - name: Announce latest release on Discord
1214 if: needs.preflight.outputs.make_latest == 'true'
1215 continue-on-error: true
1216 env:
1217 DISCORD_MENTION_ROLE_ID: ${{ secrets.DISCORD_RELEASE_LATEST_ROLE_ID }}
1218 DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
1219 run: |
1220 node scripts/notify-discord-release.ts latest \
1221 --role-id "$DISCORD_MENTION_ROLE_ID" \
1222 --release-name "${{ needs.preflight.outputs.release_name }}" \
1223 --release-version "${{ needs.preflight.outputs.version }}" \
1224 --tag "${{ needs.preflight.outputs.tag }}" \
1225 --release-url "https://github.com/${{ github.repository }}/releases/tag/${{ needs.preflight.outputs.tag }}"