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