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

release.yml

1,175 lines46.0 KB

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