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