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
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/*.exe" \
656 "release/*.blockmap" \
657 "release/*.yml"; do
658 for file in $pattern; do
659 cp "$file" release-publish/
660 done
661 done
662
663 if [[ "${{ matrix.platform }}" == "mac" && "${{ matrix.arch }}" != "arm64" ]]; then
664 shopt -s nullglob
665 for manifest in release-publish/*-mac.yml; do
666 mv "$manifest" "${manifest%.yml}-${{ matrix.arch }}.yml"
667 done
668 fi
669
670 # Enable if Windows arm64 builds are enabled.
671 # Windows updater metadata is channel-specific (for example
672 # "latest.yml" or "nightly.yml"). Suffix each per-arch copy so the
673 # release job can merge matching arm64/x64 manifests back into one
674 # canonical manifest per channel.
675 # if [[ "${{ matrix.platform }}" == "win" ]]; then
676 # shopt -s nullglob
677 # for manifest in release-publish/*.yml; do
678 # mv "$manifest" "${manifest%.yml}-win-${{ matrix.arch }}.yml"
679 # done
680 # fi
681
682 - name: Collect resource monitor
683 shell: bash
684 run: |
685 set -euo pipefail
686 binary_name="t3-resource-monitor"
687 if [[ "${{ matrix.platform }}" == "win" ]]; then
688 binary_name="${binary_name}.exe"
689 fi
690 source_path="native/resource-monitor/target/${{ matrix.rust_target }}/release/${binary_name}"
691 target_dir="resource-monitor-publish/${{ matrix.resource_key }}"
692 mkdir -p "$target_dir"
693 cp "$source_path" "$target_dir/$binary_name"
694
695 - name: Upload build artifacts
696 uses: actions/upload-artifact@v7
697 with:
698 name: desktop-${{ matrix.platform }}-${{ matrix.arch }}
699 path: release-publish/*
700 if-no-files-found: error
701
702 - name: Upload resource monitor
703 uses: actions/upload-artifact@v7
704 with:
705 name: resource-monitor-${{ matrix.resource_key }}
706 path: resource-monitor-publish/${{ matrix.resource_key }}/*
707 if-no-files-found: error
708
709 publish_cli:
710 name: Publish CLI to npm
711 needs: [preflight, relay_public_config, quality, build]
712 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.build.result == 'success' }}
713 runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
714 timeout-minutes: 10
715 permissions:
716 contents: read
717 id-token: write
718 env:
719 T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
720 T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
721 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
722 T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
723 steps:
724 - name: Checkout
725 uses: actions/checkout@v6
726 with:
727 ref: ${{ needs.preflight.outputs.ref }}
728 sparse-checkout: |
729 /*
730 !/.repos/
731 sparse-checkout-cone-mode: false
732
733 - name: Setup Vite+
734 uses: voidzero-dev/setup-vp@v1
735 with:
736 node-version-file: package.json
737 cache: true
738 run-install: |
739 args:
740 - --filter=t3...
741 - --filter=@t3tools/web...
742 - --filter=@t3tools/scripts...
743
744 - name: Download relay client tracing config
745 uses: actions/download-artifact@v8
746 with:
747 name: relay-client-tracing-config
748 path: ${{ runner.temp }}/relay-client-tracing
749
750 - name: Load relay client tracing config
751 shell: bash
752 run: |
753 config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
754 tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
755 echo "::add-mask::$tracing_token"
756 cat "$config_path" >> "$GITHUB_ENV"
757
758 - name: Align package versions to release version
759 run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
760
761 - name: Build web package
762 run: vp run --filter @t3tools/web build
763
764 - name: Build CLI package
765 run: vp run --filter t3 build
766
767 - name: Download resource monitors
768 uses: actions/download-artifact@v8
769 with:
770 pattern: resource-monitor-*
771 path: ${{ runner.temp }}/resource-monitors
772
773 - name: Bundle resource monitors into CLI package
774 shell: bash
775 run: |
776 set -euo pipefail
777 for artifact_dir in "$RUNNER_TEMP"/resource-monitors/resource-monitor-*; do
778 resource_key="${artifact_dir##*/resource-monitor-}"
779 target_dir="apps/server/dist/resource-monitor/${resource_key}"
780 mkdir -p "$target_dir"
781 cp "$artifact_dir"/t3-resource-monitor* "$target_dir/"
782 chmod +x "$target_dir"/t3-resource-monitor 2>/dev/null || true
783 done
784
785 - name: Publish CLI package
786 run: node apps/server/scripts/cli.ts publish --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --app-version "${{ needs.preflight.outputs.version }}" --verbose
787
788 release:
789 name: Publish GitHub Release
790 needs: [preflight, build, publish_cli]
791 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build.result == 'success' && needs.publish_cli.result == 'success' }}
792 runs-on: blacksmith-8vcpu-ubuntu-2404
793 timeout-minutes: 30
794 permissions:
795 contents: write
796 steps:
797 - name: Checkout
798 uses: actions/checkout@v6
799 with:
800 ref: ${{ needs.preflight.outputs.ref }}
801 sparse-checkout: |
802 /*
803 !/.repos/
804 sparse-checkout-cone-mode: false
805
806 - name: Setup Vite+
807 uses: voidzero-dev/setup-vp@v1
808 with:
809 node-version-file: package.json
810 cache: true
811 run-install: |
812 args:
813 - --filter=@t3tools/scripts...
814
815 - name: Download all desktop artifacts
816 uses: actions/download-artifact@v8
817 with:
818 pattern: desktop-*
819 merge-multiple: true
820 path: release-assets
821
822 - name: Merge macOS updater manifests
823 run: |
824 shopt -s nullglob
825 for x64_manifest in release-assets/*-mac-x64.yml; do
826 arm64_manifest="${x64_manifest%-x64.yml}.yml"
827 if [[ -f "$arm64_manifest" ]]; then
828 node scripts/merge-update-manifests.ts --platform mac "$arm64_manifest" "$x64_manifest"
829 rm -f "$x64_manifest"
830 fi
831 done
832
833 # - name: Merge Windows updater manifests
834 # run: |
835 # shopt -s nullglob
836 # found_windows_manifest=false
837 # for x64_manifest in release-assets/*-win-x64.yml; do
838 # if [[ "$(basename "$x64_manifest")" == builder-debug-* ]]; then
839 # continue
840 # fi
841
842 # arm64_manifest="${x64_manifest/-x64.yml/-arm64.yml}"
843 # output_manifest="${x64_manifest/-win-x64.yml/.yml}"
844 # if [[ ! -f "$arm64_manifest" ]]; then
845 # echo "Missing matching arm64 Windows manifest for $x64_manifest" >&2
846 # exit 1
847 # fi
848
849 # found_windows_manifest=true
850 # node scripts/merge-update-manifests.ts --platform win \
851 # "$arm64_manifest" \
852 # "$x64_manifest" \
853 # "$output_manifest"
854 # rm -f "$arm64_manifest" "$x64_manifest"
855 # done
856
857 # if [[ "$found_windows_manifest" != true ]]; then
858 # echo "No Windows updater manifests found to merge." >&2
859 # exit 1
860 # fi
861
862 - name: Publish release
863 if: needs.preflight.outputs.previous_tag != ''
864 uses: softprops/action-gh-release@v3
865 with:
866 tag_name: ${{ needs.preflight.outputs.tag }}
867 target_commitish: ${{ needs.preflight.outputs.ref }}
868 name: ${{ needs.preflight.outputs.release_name }}
869 generate_release_notes: true
870 previous_tag: ${{ needs.preflight.outputs.previous_tag }}
871 prerelease: ${{ needs.preflight.outputs.is_prerelease }}
872 make_latest: ${{ needs.preflight.outputs.make_latest }}
873 files: |
874 release-assets/*.dmg
875 release-assets/*.zip
876 release-assets/*.AppImage
877 release-assets/*.exe
878 release-assets/*.blockmap
879 release-assets/*.yml
880 fail_on_unmatched_files: true
881 token: ${{ github.token }}
882
883 - name: Publish first release
884 if: needs.preflight.outputs.previous_tag == ''
885 uses: softprops/action-gh-release@v3
886 with:
887 tag_name: ${{ needs.preflight.outputs.tag }}
888 target_commitish: ${{ needs.preflight.outputs.ref }}
889 name: ${{ needs.preflight.outputs.release_name }}
890 generate_release_notes: true
891 prerelease: ${{ needs.preflight.outputs.is_prerelease }}
892 make_latest: ${{ needs.preflight.outputs.make_latest }}
893 files: |
894 release-assets/*.dmg
895 release-assets/*.zip
896 release-assets/*.AppImage
897 release-assets/*.exe
898 release-assets/*.blockmap
899 release-assets/*.yml
900 fail_on_unmatched_files: true
901 token: ${{ github.token }}
902
903 publish_aur:
904 name: Publish AUR package
905 needs: [preflight, release]
906 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
907 uses: ./.github/workflows/publish-aur.yml
908 with:
909 release_tag: ${{ needs.preflight.outputs.tag }}
910 secrets:
911 AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
912
913 deploy_web:
914 name: Deploy hosted web app
915 needs: [preflight, relay_public_config, release]
916 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.release.result == 'success' }}
917 runs-on: blacksmith-8vcpu-ubuntu-2404
918 timeout-minutes: 10
919 env:
920 T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
921 T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
922 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
923 T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
924 VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
925 VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
926 VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
927 T3CODE_WEB_ROUTER_URL: ${{ vars.T3CODE_WEB_ROUTER_URL }}
928 T3CODE_WEB_LATEST_DOMAIN: ${{ vars.T3CODE_WEB_LATEST_DOMAIN }}
929 T3CODE_WEB_NIGHTLY_DOMAIN: ${{ vars.T3CODE_WEB_NIGHTLY_DOMAIN }}
930 VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }}
931 steps:
932 - name: Checkout
933 uses: actions/checkout@v6
934 with:
935 ref: ${{ needs.preflight.outputs.ref }}
936 sparse-checkout: |
937 /*
938 !/.repos/
939 sparse-checkout-cone-mode: false
940
941 - name: Setup Vite+
942 uses: voidzero-dev/setup-vp@v1
943 with:
944 node-version-file: package.json
945 cache: true
946 run-install: |
947 args:
948 - --filter=@t3tools/scripts...
949 - --filter=@t3tools/web...
950
951 - name: Download relay client tracing config
952 uses: actions/download-artifact@v8
953 with:
954 name: relay-client-tracing-config
955 path: ${{ runner.temp }}/relay-client-tracing
956
957 - name: Load relay client tracing config
958 shell: bash
959 run: |
960 config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
961 tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
962 echo "::add-mask::$tracing_token"
963 cat "$config_path" >> "$GITHUB_ENV"
964
965 - name: Align package versions to release version
966 run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
967
968 - name: Refresh release lockfile
969 run: vp install --lockfile-only --ignore-scripts
970
971 - name: Deploy and alias channel
972 shell: bash
973 run: |
974 set -euo pipefail
975
976 if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" || -z "${VERCEL_PROJECT_ID:-}" ]]; then
977 echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID." >&2
978 exit 1
979 fi
980
981 router_url="${T3CODE_WEB_ROUTER_URL:-https://app.t3.codes}"
982 latest_domain="${T3CODE_WEB_LATEST_DOMAIN:-latest.app.t3.codes}"
983 nightly_domain="${T3CODE_WEB_NIGHTLY_DOMAIN:-nightly.app.t3.codes}"
984 router_domain="${router_url#http://}"
985 router_domain="${router_domain#https://}"
986 router_domain="${router_domain%%/*}"
987
988 if [[ "${{ needs.preflight.outputs.release_channel }}" == "stable" ]]; then
989 channel_domain="$latest_domain"
990 channel_name="latest"
991 else
992 channel_domain="$nightly_domain"
993 channel_name="nightly"
994 fi
995
996 vercel_scope="${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
997 vercel_scope_args=(--scope "$vercel_scope")
998
999 echo "Deploying hosted web app for $channel_name channel."
1000 deployment_url="$(
1001 vp dlx vercel@53.1.1 deploy \
1002 --archive=tgz \
1003 --prod \
1004 --skip-domain \
1005 --yes \
1006 --token "$VERCEL_TOKEN" \
1007 "${vercel_scope_args[@]}" \
1008 --build-env "APP_VERSION=${{ needs.preflight.outputs.version }}" \
1009 --build-env "T3CODE_CLERK_PUBLISHABLE_KEY=${T3CODE_CLERK_PUBLISHABLE_KEY:-}" \
1010 --build-env "T3CODE_CLERK_JWT_TEMPLATE=${T3CODE_CLERK_JWT_TEMPLATE:-}" \
1011 --build-env "T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=${T3CODE_CLERK_CLI_OAUTH_CLIENT_ID:-}" \
1012 --build-env "T3CODE_RELAY_URL=${T3CODE_RELAY_URL:-}" \
1013 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_URL=${T3CODE_RELAY_CLIENT_OTLP_TRACES_URL:-}" \
1014 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET=${T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET:-}" \
1015 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=${T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN:-}" \
1016 --build-env "VITE_HOSTED_APP_URL=$router_url" \
1017 --build-env "VITE_HOSTED_APP_CHANNEL=$channel_name"
1018 )"
1019
1020 echo "Aliasing $deployment_url to $channel_domain."
1021 vp dlx vercel@53.1.1 alias set "$deployment_url" "$channel_domain" \
1022 --token "$VERCEL_TOKEN" \
1023 "${vercel_scope_args[@]}"
1024
1025 if [[ "$channel_name" == "latest" && -n "$router_domain" && "$router_domain" != "$channel_domain" ]]; then
1026 echo "Aliasing $deployment_url to router domain $router_domain."
1027 vp dlx vercel@53.1.1 alias set "$deployment_url" "$router_domain" \
1028 --token "$VERCEL_TOKEN" \
1029 "${vercel_scope_args[@]}"
1030 fi
1031
1032 finalize:
1033 name: Finalize release
1034 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'stable' }}
1035 needs: [preflight, release]
1036 runs-on: blacksmith-8vcpu-ubuntu-2404
1037 timeout-minutes: 10
1038 steps:
1039 - id: app_token
1040 name: Mint release app token
1041 uses: actions/create-github-app-token@v2
1042 with:
1043 app-id: ${{ secrets.RELEASE_APP_ID }}
1044 private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
1045 owner: ${{ github.repository_owner }}
1046
1047 - name: Checkout
1048 uses: actions/checkout@v6
1049 with:
1050 ref: main
1051 fetch-depth: 0
1052 token: ${{ steps.app_token.outputs.token }}
1053 persist-credentials: true
1054 sparse-checkout: |
1055 /*
1056 !/.repos/
1057 sparse-checkout-cone-mode: false
1058
1059 - id: app_bot
1060 name: Resolve GitHub App bot identity
1061 env:
1062 GH_TOKEN: ${{ steps.app_token.outputs.token }}
1063 APP_SLUG: ${{ steps.app_token.outputs.app-slug }}
1064 run: |
1065 user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
1066 echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT"
1067 echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT"
1068
1069 - name: Setup Vite+
1070 uses: voidzero-dev/setup-vp@v1
1071 with:
1072 node-version-file: package.json
1073 cache: true
1074 run-install: |
1075 args:
1076 - --filter=@t3tools/scripts...
1077 - --filter=@t3tools/oxlint-plugin-t3code...
1078
1079 - id: update_versions
1080 name: Update version strings
1081 env:
1082 RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
1083 run: node scripts/update-release-package-versions.ts "$RELEASE_VERSION" --github-output
1084
1085 - name: Format package.json files
1086 if: steps.update_versions.outputs.changed == 'true'
1087 run: vp fmt apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json
1088
1089 - name: Refresh lockfile
1090 if: steps.update_versions.outputs.changed == 'true'
1091 run: vp install --lockfile-only --ignore-scripts
1092
1093 - name: Commit and push version bump
1094 if: steps.update_versions.outputs.changed == 'true'
1095 shell: bash
1096 env:
1097 RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
1098 run: |
1099 if git diff --quiet -- apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json pnpm-lock.yaml; then
1100 echo "No version changes to commit."
1101 exit 0
1102 fi
1103
1104 git config user.name "${{ steps.app_bot.outputs.name }}"
1105 git config user.email "${{ steps.app_bot.outputs.email }}"
1106
1107 git add apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json pnpm-lock.yaml
1108 git commit -m "chore(release): prepare $RELEASE_TAG"
1109 git push origin HEAD:main
1110
1111 announce_discord:
1112 name: Announce release on Discord
1113 if: |
1114 always() && !cancelled() &&
1115 needs.preflight.result == 'success' &&
1116 needs.relay_public_config.result == 'success' &&
1117 needs.release.result == 'success' &&
1118 needs.deploy_web.result == 'success' &&
1119 (needs.finalize.result == 'success' || needs.finalize.result == 'skipped')
1120 needs: [preflight, relay_public_config, release, deploy_web, finalize]
1121 runs-on: blacksmith-8vcpu-ubuntu-2404
1122 timeout-minutes: 10
1123 steps:
1124 - name: Checkout
1125 uses: actions/checkout@v6
1126 with:
1127 ref: ${{ needs.preflight.outputs.ref }}
1128 sparse-checkout: |
1129 /*
1130 !/.repos/
1131 sparse-checkout-cone-mode: false
1132
1133 - name: Setup Vite+
1134 uses: voidzero-dev/setup-vp@v1
1135 with:
1136 node-version-file: package.json
1137 cache: true
1138 run-install: |
1139 args:
1140 - --filter=@t3tools/scripts...
1141
1142 - name: Announce prerelease on Discord
1143 if: needs.preflight.outputs.is_prerelease == 'true'
1144 continue-on-error: true
1145 env:
1146 DISCORD_MENTION_ROLE_ID: ${{ secrets.DISCORD_RELEASE_NIGHTLY_ROLE_ID }}
1147 DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
1148 run: |
1149 node scripts/notify-discord-release.ts prerelease \
1150 --role-id "$DISCORD_MENTION_ROLE_ID" \
1151 --release-name "${{ needs.preflight.outputs.release_name }}" \
1152 --release-version "${{ needs.preflight.outputs.version }}" \
1153 --tag "${{ needs.preflight.outputs.tag }}" \
1154 --release-url "https://github.com/${{ github.repository }}/releases/tag/${{ needs.preflight.outputs.tag }}"
1155
1156 - name: Announce latest release on Discord
1157 if: needs.preflight.outputs.make_latest == 'true'
1158 continue-on-error: true
1159 env:
1160 DISCORD_MENTION_ROLE_ID: ${{ secrets.DISCORD_RELEASE_LATEST_ROLE_ID }}
1161 DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
1162 run: |
1163 node scripts/notify-discord-release.ts latest \
1164 --role-id "$DISCORD_MENTION_ROLE_ID" \
1165 --release-name "${{ needs.preflight.outputs.release_name }}" \
1166 --release-version "${{ needs.preflight.outputs.version }}" \
1167 --tag "${{ needs.preflight.outputs.tag }}" \
1168 --release-url "https://github.com/${{ github.repository }}/releases/tag/${{ needs.preflight.outputs.tag }}"