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