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