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

release.yml

1,182 lines46.3 KB

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