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

release.yml

1,191 lines46.6 KB

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