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

release.yml

1,134 lines43.8 KB

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's rpm target shells out to rpmbuild. The Ubuntu image
519 # ships it via the `rpm` package, but installing it here keeps the target
520 # working if the runner image ever drops it, and costs nothing when the
521 # binary is already present.
522 - name: Ensure rpmbuild is available
523 if: matrix.platform == 'linux' && contains(matrix.target, 'rpm')
524 shell: bash
525 run: |
526 if ! command -v rpmbuild >/dev/null 2>&1; then
527 sudo apt-get update
528 sudo apt-get install -y rpm
529 fi
530 rpmbuild --version
531​
532 - name: Build desktop artifact
533 shell: bash
534 env:
535 CSC_LINK: ${{ secrets.CSC_LINK }}
536 CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
537 APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
538 APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
539 APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
540 APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
541 MACOS_PROVISIONING_PROFILE: ${{ secrets.MACOS_PROVISIONING_PROFILE }}
542 T3CODE_CLERK_PASSKEY_RP_DOMAINS: ${{ vars.CLERK_PASSKEY_RP_DOMAINS }}
543 AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
544 AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
545 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
546 AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
547 AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
548 AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
549 AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
550 run: |
551 args=(
552 --platform "${{ matrix.platform }}"
553 --target "${{ matrix.target }}"
554 --arch "${{ matrix.arch }}"
555 --build-version "${{ needs.preflight.outputs.version }}"
556 --verbose
557 )
558​
559 has_all() {
560 for value in "$@"; do
561 if [[ -z "$value" ]]; then
562 return 1
563 fi
564 done
565 return 0
566 }
567​
568 if [[ "${{ matrix.platform }}" == "mac" ]]; then
569 if has_all "$CSC_LINK" "$CSC_KEY_PASSWORD" "$APPLE_API_KEY" "$APPLE_API_KEY_ID" "$APPLE_API_ISSUER"; then
570 if ! has_all "$APPLE_TEAM_ID" "$MACOS_PROVISIONING_PROFILE"; then
571 echo "macOS signing is configured, but APPLE_TEAM_ID or MACOS_PROVISIONING_PROFILE is missing." >&2
572 exit 1
573 fi
574​
575 key_path="$RUNNER_TEMP/AuthKey_${APPLE_API_KEY_ID}.p8"
576 printf '%s' "$APPLE_API_KEY" > "$key_path"
577 export APPLE_API_KEY="$key_path"
578​
579 profile_path="$RUNNER_TEMP/t3code.provisionprofile"
580 printf '%s' "$MACOS_PROVISIONING_PROFILE" | base64 -D > "$profile_path"
581 security cms -D -i "$profile_path" >/dev/null
582 export T3CODE_APPLE_TEAM_ID="$APPLE_TEAM_ID"
583 export T3CODE_MACOS_PROVISIONING_PROFILE="$profile_path"
584​
585 echo "macOS signing enabled."
586 args+=(--signed)
587 else
588 echo "macOS signing disabled (missing one or more Apple signing secrets)."
589 fi
590 elif [[ "${{ matrix.platform }}" == "win" ]]; then
591 # Bundle the Linux node-pty binary built by the build_wsl_node_pty job
592 # so the packaged WSL backend ships a ready binary (no first-launch
593 # compile). Required for a working WSL backend on Windows.
594 args+=(--wsl-prebuild "$GITHUB_WORKSPACE/wsl-prebuild/pty.node")
595 if has_all \
596 "$AZURE_TENANT_ID" \
597 "$AZURE_CLIENT_ID" \
598 "$AZURE_CLIENT_SECRET" \
599 "$AZURE_TRUSTED_SIGNING_ENDPOINT" \
600 "$AZURE_TRUSTED_SIGNING_ACCOUNT_NAME" \
601 "$AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME" \
602 "$AZURE_TRUSTED_SIGNING_PUBLISHER_NAME"; then
603 echo "Windows signing enabled (Azure Trusted Signing)."
604 args+=(--signed)
605 else
606 echo "Windows signing disabled (missing one or more Azure Trusted Signing secrets)."
607 fi
608 else
609 echo "Signing disabled for ${{ matrix.platform }}."
610 fi
611​
612 vp run dist:desktop:artifact "${args[@]}"
613​
614 - name: Collect release assets
615 shell: bash
616 run: |
617 set -euo pipefail
618 mkdir -p release-publish
619​
620 shopt -s nullglob
621 for pattern in \
622 "release/*.dmg" \
623 "release/*.zip" \
624 "release/*.AppImage" \
625 "release/*.deb" \
626 "release/*.rpm" \
627 "release/*.exe" \
628 "release/*.blockmap" \
629 "release/*.yml"; do
630 for file in $pattern; do
631 cp "$file" release-publish/
632 done
633 done
634​
635 if [[ "${{ matrix.platform }}" == "mac" && "${{ matrix.arch }}" != "arm64" ]]; then
636 shopt -s nullglob
637 for manifest in release-publish/*-mac.yml; do
638 mv "$manifest" "${manifest%.yml}-${{ matrix.arch }}.yml"
639 done
640 fi
641​
642 # Enable if Windows arm64 builds are enabled.
643 # Windows updater metadata is channel-specific (for example
644 # "latest.yml" or "nightly.yml"). Suffix each per-arch copy so the
645 # release job can merge matching arm64/x64 manifests back into one
646 # canonical manifest per channel.
647 # if [[ "${{ matrix.platform }}" == "win" ]]; then
648 # shopt -s nullglob
649 # for manifest in release-publish/*.yml; do
650 # mv "$manifest" "${manifest%.yml}-win-${{ matrix.arch }}.yml"
651 # done
652 # fi
653​
654 - name: Collect resource monitor
655 shell: bash
656 run: |
657 set -euo pipefail
658 binary_name="t3-resource-monitor"
659 if [[ "${{ matrix.platform }}" == "win" ]]; then
660 binary_name="${binary_name}.exe"
661 fi
662 source_path="native/resource-monitor/target/${{ matrix.rust_target }}/release/${binary_name}"
663 target_dir="resource-monitor-publish/${{ matrix.resource_key }}"
664 mkdir -p "$target_dir"
665 cp "$source_path" "$target_dir/$binary_name"
666​
667 - name: Upload build artifacts
668 uses: actions/upload-artifact@v7
669 with:
670 name: desktop-${{ matrix.platform }}-${{ matrix.arch }}
671 path: release-publish/*
672 if-no-files-found: error
673​
674 - name: Upload resource monitor
675 uses: actions/upload-artifact@v7
676 with:
677 name: resource-monitor-${{ matrix.resource_key }}
678 path: resource-monitor-publish/${{ matrix.resource_key }}/*
679 if-no-files-found: error
680​
681 publish_cli:
682 name: Publish CLI to npm
683 needs: [preflight, relay_public_config, build]
684 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build.result == 'success' }}
685 runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
686 timeout-minutes: 10
687 permissions:
688 contents: read
689 id-token: write
690 env:
691 T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
692 T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
693 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
694 T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
695 steps:
696 - name: Checkout
697 uses: actions/checkout@v6
698 with:
699 ref: ${{ needs.preflight.outputs.ref }}
700 sparse-checkout: |
701 /*
702 !/.repos/
703 sparse-checkout-cone-mode: false
704​
705 - name: Setup Vite+
706 uses: voidzero-dev/setup-vp@v1
707 with:
708 node-version-file: package.json
709 cache: true
710 run-install: |
711 args:
712 - --filter=t3...
713 - --filter=@t3tools/web...
714 - --filter=@t3tools/scripts...
715​
716 - name: Download relay client tracing config
717 uses: actions/download-artifact@v8
718 with:
719 name: relay-client-tracing-config
720 path: ${{ runner.temp }}/relay-client-tracing
721​
722 - name: Load relay client tracing config
723 shell: bash
724 run: |
725 config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
726 tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
727 echo "::add-mask::$tracing_token"
728 cat "$config_path" >> "$GITHUB_ENV"
729​
730 - name: Align package versions to release version
731 run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
732​
733 - name: Build web package
734 run: vp run --filter @t3tools/web build
735​
736 - name: Build CLI package
737 run: vp run --filter t3 build
738​
739 - name: Download resource monitors
740 uses: actions/download-artifact@v8
741 with:
742 pattern: resource-monitor-*
743 path: ${{ runner.temp }}/resource-monitors
744​
745 - name: Bundle resource monitors into CLI package
746 shell: bash
747 run: |
748 set -euo pipefail
749 for artifact_dir in "$RUNNER_TEMP"/resource-monitors/resource-monitor-*; do
750 resource_key="${artifact_dir##*/resource-monitor-}"
751 target_dir="apps/server/dist/resource-monitor/${resource_key}"
752 mkdir -p "$target_dir"
753 cp "$artifact_dir"/t3-resource-monitor* "$target_dir/"
754 chmod +x "$target_dir"/t3-resource-monitor 2>/dev/null || true
755 done
756​
757 - name: Publish CLI package
758 run: node apps/server/scripts/cli.ts publish --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --app-version "${{ needs.preflight.outputs.version }}" --verbose
759​
760 release:
761 name: Publish GitHub Release
762 needs: [preflight, build, publish_cli]
763 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build.result == 'success' && needs.publish_cli.result == 'success' }}
764 runs-on: blacksmith-8vcpu-ubuntu-2404
765 timeout-minutes: 10
766 permissions:
767 contents: write
768 steps:
769 - name: Checkout
770 uses: actions/checkout@v6
771 with:
772 ref: ${{ needs.preflight.outputs.ref }}
773 sparse-checkout: |
774 /*
775 !/.repos/
776 sparse-checkout-cone-mode: false
777​
778 - name: Setup Vite+
779 uses: voidzero-dev/setup-vp@v1
780 with:
781 node-version-file: package.json
782 cache: true
783 run-install: |
784 args:
785 - --filter=@t3tools/scripts...
786​
787 - name: Download all desktop artifacts
788 uses: actions/download-artifact@v8
789 with:
790 pattern: desktop-*
791 merge-multiple: true
792 path: release-assets
793​
794 - name: Merge macOS updater manifests
795 run: |
796 shopt -s nullglob
797 for x64_manifest in release-assets/*-mac-x64.yml; do
798 arm64_manifest="${x64_manifest%-x64.yml}.yml"
799 if [[ -f "$arm64_manifest" ]]; then
800 node scripts/merge-update-manifests.ts --platform mac "$arm64_manifest" "$x64_manifest"
801 rm -f "$x64_manifest"
802 fi
803 done
804​
805 # - name: Merge Windows updater manifests
806 # run: |
807 # shopt -s nullglob
808 # found_windows_manifest=false
809 # for x64_manifest in release-assets/*-win-x64.yml; do
810 # if [[ "$(basename "$x64_manifest")" == builder-debug-* ]]; then
811 # continue
812 # fi
813​
814 # arm64_manifest="${x64_manifest/-x64.yml/-arm64.yml}"
815 # output_manifest="${x64_manifest/-win-x64.yml/.yml}"
816 # if [[ ! -f "$arm64_manifest" ]]; then
817 # echo "Missing matching arm64 Windows manifest for $x64_manifest" >&2
818 # exit 1
819 # fi
820​
821 # found_windows_manifest=true
822 # node scripts/merge-update-manifests.ts --platform win \
823 # "$arm64_manifest" \
824 # "$x64_manifest" \
825 # "$output_manifest"
826 # rm -f "$arm64_manifest" "$x64_manifest"
827 # done
828​
829 # if [[ "$found_windows_manifest" != true ]]; then
830 # echo "No Windows updater manifests found to merge." >&2
831 # exit 1
832 # fi
833​
834 - name: Publish release
835 if: needs.preflight.outputs.previous_tag != ''
836 uses: softprops/action-gh-release@v3
837 with:
838 tag_name: ${{ needs.preflight.outputs.tag }}
839 target_commitish: ${{ needs.preflight.outputs.ref }}
840 name: ${{ needs.preflight.outputs.release_name }}
841 generate_release_notes: true
842 previous_tag: ${{ needs.preflight.outputs.previous_tag }}
843 prerelease: ${{ needs.preflight.outputs.is_prerelease }}
844 make_latest: ${{ needs.preflight.outputs.make_latest }}
845 files: |
846 release-assets/*.dmg
847 release-assets/*.zip
848 release-assets/*.AppImage
849 release-assets/*.deb
850 release-assets/*.rpm
851 release-assets/*.exe
852 release-assets/*.blockmap
853 release-assets/*.yml
854 fail_on_unmatched_files: true
855 token: ${{ github.token }}
856​
857 - name: Publish first release
858 if: needs.preflight.outputs.previous_tag == ''
859 uses: softprops/action-gh-release@v3
860 with:
861 tag_name: ${{ needs.preflight.outputs.tag }}
862 target_commitish: ${{ needs.preflight.outputs.ref }}
863 name: ${{ needs.preflight.outputs.release_name }}
864 generate_release_notes: true
865 prerelease: ${{ needs.preflight.outputs.is_prerelease }}
866 make_latest: ${{ needs.preflight.outputs.make_latest }}
867 files: |
868 release-assets/*.dmg
869 release-assets/*.zip
870 release-assets/*.AppImage
871 release-assets/*.deb
872 release-assets/*.rpm
873 release-assets/*.exe
874 release-assets/*.blockmap
875 release-assets/*.yml
876 fail_on_unmatched_files: true
877 token: ${{ github.token }}
878​
879 deploy_web:
880 name: Deploy hosted web app
881 needs: [preflight, relay_public_config, release]
882 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.release.result == 'success' }}
883 runs-on: blacksmith-8vcpu-ubuntu-2404
884 timeout-minutes: 10
885 env:
886 T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}
887 T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}
888 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
889 T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}
890 VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
891 VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
892 VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
893 T3CODE_WEB_ROUTER_URL: ${{ vars.T3CODE_WEB_ROUTER_URL }}
894 T3CODE_WEB_LATEST_DOMAIN: ${{ vars.T3CODE_WEB_LATEST_DOMAIN }}
895 T3CODE_WEB_NIGHTLY_DOMAIN: ${{ vars.T3CODE_WEB_NIGHTLY_DOMAIN }}
896 VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }}
897 steps:
898 - name: Checkout
899 uses: actions/checkout@v6
900 with:
901 ref: ${{ needs.preflight.outputs.ref }}
902 sparse-checkout: |
903 /*
904 !/.repos/
905 sparse-checkout-cone-mode: false
906​
907 - name: Setup Vite+
908 uses: voidzero-dev/setup-vp@v1
909 with:
910 node-version-file: package.json
911 cache: true
912 run-install: |
913 args:
914 - --filter=@t3tools/scripts...
915 - --filter=@t3tools/web...
916​
917 - name: Download relay client tracing config
918 uses: actions/download-artifact@v8
919 with:
920 name: relay-client-tracing-config
921 path: ${{ runner.temp }}/relay-client-tracing
922​
923 - name: Load relay client tracing config
924 shell: bash
925 run: |
926 config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
927 tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
928 echo "::add-mask::$tracing_token"
929 cat "$config_path" >> "$GITHUB_ENV"
930​
931 - name: Align package versions to release version
932 run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
933​
934 - name: Refresh release lockfile
935 run: vp install --lockfile-only --ignore-scripts
936​
937 - name: Deploy and alias channel
938 shell: bash
939 run: |
940 set -euo pipefail
941​
942 if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" || -z "${VERCEL_PROJECT_ID:-}" ]]; then
943 echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID." >&2
944 exit 1
945 fi
946​
947 router_url="${T3CODE_WEB_ROUTER_URL:-https://app.t3.codes}"
948 latest_domain="${T3CODE_WEB_LATEST_DOMAIN:-latest.app.t3.codes}"
949 nightly_domain="${T3CODE_WEB_NIGHTLY_DOMAIN:-nightly.app.t3.codes}"
950 router_domain="${router_url#http://}"
951 router_domain="${router_domain#https://}"
952 router_domain="${router_domain%%/*}"
953​
954 if [[ "${{ needs.preflight.outputs.release_channel }}" == "stable" ]]; then
955 channel_domain="$latest_domain"
956 channel_name="latest"
957 else
958 channel_domain="$nightly_domain"
959 channel_name="nightly"
960 fi
961​
962 vercel_scope="${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
963 vercel_scope_args=(--scope "$vercel_scope")
964​
965 echo "Deploying hosted web app for $channel_name channel."
966 deployment_url="$(
967 vp dlx vercel@53.1.1 deploy \
968 --archive=tgz \
969 --prod \
970 --skip-domain \
971 --yes \
972 --token "$VERCEL_TOKEN" \
973 "${vercel_scope_args[@]}" \
974 --build-env "APP_VERSION=${{ needs.preflight.outputs.version }}" \
975 --build-env "T3CODE_CLERK_PUBLISHABLE_KEY=${T3CODE_CLERK_PUBLISHABLE_KEY:-}" \
976 --build-env "T3CODE_CLERK_JWT_TEMPLATE=${T3CODE_CLERK_JWT_TEMPLATE:-}" \
977 --build-env "T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=${T3CODE_CLERK_CLI_OAUTH_CLIENT_ID:-}" \
978 --build-env "T3CODE_RELAY_URL=${T3CODE_RELAY_URL:-}" \
979 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_URL=${T3CODE_RELAY_CLIENT_OTLP_TRACES_URL:-}" \
980 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET=${T3CODE_RELAY_CLIENT_OTLP_TRACES_DATASET:-}" \
981 --build-env "T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=${T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN:-}" \
982 --build-env "VITE_HOSTED_APP_URL=$router_url" \
983 --build-env "VITE_HOSTED_APP_CHANNEL=$channel_name"
984 )"
985​
986 echo "Aliasing $deployment_url to $channel_domain."
987 vp dlx vercel@53.1.1 alias set "$deployment_url" "$channel_domain" \
988 --token "$VERCEL_TOKEN" \
989 "${vercel_scope_args[@]}"
990​
991 if [[ "$channel_name" == "latest" && -n "$router_domain" && "$router_domain" != "$channel_domain" ]]; then
992 echo "Aliasing $deployment_url to router domain $router_domain."
993 vp dlx vercel@53.1.1 alias set "$deployment_url" "$router_domain" \
994 --token "$VERCEL_TOKEN" \
995 "${vercel_scope_args[@]}"
996 fi
997​
998 finalize:
999 name: Finalize release
1000 if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'stable' }}
1001 needs: [preflight, release]
1002 runs-on: blacksmith-8vcpu-ubuntu-2404
1003 timeout-minutes: 10
1004 steps:
1005 - id: app_token
1006 name: Mint release app token
1007 uses: actions/create-github-app-token@v2
1008 with:
1009 app-id: ${{ secrets.RELEASE_APP_ID }}
1010 private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
1011 owner: ${{ github.repository_owner }}
1012​
1013 - name: Checkout
1014 uses: actions/checkout@v6
1015 with:
1016 ref: main
1017 fetch-depth: 0
1018 token: ${{ steps.app_token.outputs.token }}
1019 persist-credentials: true
1020 sparse-checkout: |
1021 /*
1022 !/.repos/
1023 sparse-checkout-cone-mode: false
1024​
1025 - id: app_bot
1026 name: Resolve GitHub App bot identity
1027 env:
1028 GH_TOKEN: ${{ steps.app_token.outputs.token }}
1029 APP_SLUG: ${{ steps.app_token.outputs.app-slug }}
1030 run: |
1031 user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
1032 echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT"
1033 echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT"
1034​
1035 - name: Setup Vite+
1036 uses: voidzero-dev/setup-vp@v1
1037 with:
1038 node-version-file: package.json
1039 cache: true
1040 run-install: |
1041 args:
1042 - --filter=@t3tools/scripts...
1043 - --filter=@t3tools/oxlint-plugin-t3code...
1044​
1045 - id: update_versions
1046 name: Update version strings
1047 env:
1048 RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
1049 run: node scripts/update-release-package-versions.ts "$RELEASE_VERSION" --github-output
1050​
1051 - name: Format package.json files
1052 if: steps.update_versions.outputs.changed == 'true'
1053 run: vp fmt apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json
1054​
1055 - name: Refresh lockfile
1056 if: steps.update_versions.outputs.changed == 'true'
1057 run: vp install --lockfile-only --ignore-scripts
1058​
1059 - name: Commit and push version bump
1060 if: steps.update_versions.outputs.changed == 'true'
1061 shell: bash
1062 env:
1063 RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
1064 run: |
1065 if git diff --quiet -- apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json pnpm-lock.yaml; then
1066 echo "No version changes to commit."
1067 exit 0
1068 fi
1069​
1070 git config user.name "${{ steps.app_bot.outputs.name }}"
1071 git config user.email "${{ steps.app_bot.outputs.email }}"
1072​
1073 git add apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json pnpm-lock.yaml
1074 git commit -m "chore(release): prepare $RELEASE_TAG"
1075 git push origin HEAD:main
1076​
1077 announce_discord:
1078 name: Announce release on Discord
1079 if: |
1080 always() && !cancelled() &&
1081 needs.preflight.result == 'success' &&
1082 needs.relay_public_config.result == 'success' &&
1083 needs.release.result == 'success' &&
1084 needs.deploy_web.result == 'success' &&
1085 (needs.finalize.result == 'success' || needs.finalize.result == 'skipped')
1086 needs: [preflight, relay_public_config, release, deploy_web, finalize]
1087 runs-on: blacksmith-8vcpu-ubuntu-2404
1088 timeout-minutes: 10
1089 steps:
1090 - name: Checkout
1091 uses: actions/checkout@v6
1092 with:
1093 ref: ${{ needs.preflight.outputs.ref }}
1094 sparse-checkout: |
1095 /*
1096 !/.repos/
1097 sparse-checkout-cone-mode: false
1098​
1099 - name: Setup Vite+
1100 uses: voidzero-dev/setup-vp@v1
1101 with:
1102 node-version-file: package.json
1103 cache: true
1104 run-install: |
1105 args:
1106 - --filter=@t3tools/scripts...
1107​
1108 - name: Announce prerelease on Discord
1109 if: needs.preflight.outputs.is_prerelease == 'true'
1110 continue-on-error: true
1111 env:
1112 DISCORD_MENTION_ROLE_ID: ${{ secrets.DISCORD_RELEASE_NIGHTLY_ROLE_ID }}
1113 DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
1114 run: |
1115 node scripts/notify-discord-release.ts prerelease \
1116 --role-id "$DISCORD_MENTION_ROLE_ID" \
1117 --release-name "${{ needs.preflight.outputs.release_name }}" \
1118 --release-version "${{ needs.preflight.outputs.version }}" \
1119 --tag "${{ needs.preflight.outputs.tag }}" \
1120 --release-url "https://github.com/${{ github.repository }}/releases/tag/${{ needs.preflight.outputs.tag }}"
1121​
1122 - name: Announce latest release on Discord
1123 if: needs.preflight.outputs.make_latest == 'true'
1124 continue-on-error: true
1125 env:
1126 DISCORD_MENTION_ROLE_ID: ${{ secrets.DISCORD_RELEASE_LATEST_ROLE_ID }}
1127 DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
1128 run: |
1129 node scripts/notify-discord-release.ts latest \
1130 --role-id "$DISCORD_MENTION_ROLE_ID" \
1131 --release-name "${{ needs.preflight.outputs.release_name }}" \
1132 --release-version "${{ needs.preflight.outputs.version }}" \
1133 --tag "${{ needs.preflight.outputs.tag }}" \
1134 --release-url "https://github.com/${{ github.repository }}/releases/tag/${{ needs.preflight.outputs.tag }}"