Open History to see the last commit
1name: Release desktop build
2
3# One desktop platform/arch build, called once per target from release.yml so
4# each target is its own job with its own `needs`. The JS bundle (server, web
5# client, Electron main) comes from the `js-bundle` artifact that build_bundle
6# produced; this job only packages it, builds the native helpers, and, where
7# `cli_archive` is set, the self-contained CLI archive for its platform.
8
9on:
10 workflow_call:
11 secrets:
12 CSC_LINK:
13 required: false
14 CSC_KEY_PASSWORD:
15 required: false
16 APPLE_API_KEY:
17 required: false
18 APPLE_API_KEY_ID:
19 required: false
20 APPLE_API_ISSUER:
21 required: false
22 MACOS_PROVISIONING_PROFILE:
23 required: false
24 AZURE_TENANT_ID:
25 required: false
26 AZURE_CLIENT_ID:
27 required: false
28 AZURE_CLIENT_SECRET:
29 required: false
30 AZURE_TRUSTED_SIGNING_ENDPOINT:
31 required: false
32 AZURE_TRUSTED_SIGNING_ACCOUNT_NAME:
33 required: false
34 AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME:
35 required: false
36 AZURE_TRUSTED_SIGNING_PUBLISHER_NAME:
37 required: false
38 inputs:
39 label:
40 required: true
41 type: string
42 runner:
43 required: true
44 type: string
45 platform:
46 required: true
47 type: string
48 target:
49 required: true
50 type: string
51 arch:
52 required: true
53 type: string
54 rust_target:
55 required: true
56 type: string
57 resource_key:
58 required: true
59 type: string
60 # Whether the job also builds the self-contained CLI archive for its own
61 # platform/arch, on this runner, and smoke-tests it here. Every archive
62 # is built on hardware of its own architecture.
63 cli_archive:
64 required: false
65 default: false
66 type: boolean
67 version:
68 required: true
69 type: string
70 ref:
71 required: true
72 type: string
73 release_channel:
74 required: true
75 type: string
76 # Whether a `relay-client-tracing-config` artifact from the production
77 # relay state is expected. PR previews carry no tracing config.
78 relay_client_tracing:
79 required: false
80 default: true
81 type: boolean
82 clerk_publishable_key:
83 required: true
84 type: string
85 clerk_jwt_template:
86 required: true
87 type: string
88 clerk_cli_oauth_client_id:
89 required: true
90 type: string
91 relay_url:
92 required: true
93 type: string
94
95permissions:
96 contents: read
97
98jobs:
99 build:
100 name: Build ${{ inputs.label }}
101 runs-on: ${{ inputs.runner }}
102 timeout-minutes: 30
103 env:
104 T3CODE_CLERK_PUBLISHABLE_KEY: ${{ inputs.clerk_publishable_key }}
105 T3CODE_CLERK_JWT_TEMPLATE: ${{ inputs.clerk_jwt_template }}
106 T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ inputs.clerk_cli_oauth_client_id }}
107 T3CODE_RELAY_URL: ${{ inputs.relay_url }}
108 steps:
109 # This repository is public, so Git needs no credentials. checkout's
110 # credential cleanup runs submodule foreach even with submodules disabled,
111 # which fails on the orphaned gitlinks in our vendored .repos tree.
112 - name: Checkout
113 shell: bash
114 env:
115 CHECKOUT_REF: ${{ inputs.ref }}
116 GIT_TERMINAL_PROMPT: "0"
117 run: |
118 set -euo pipefail
119 git init .
120 git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
121 git fetch --no-tags --depth=1 origin "$CHECKOUT_REF"
122 git sparse-checkout set --no-cone '/*' '!/.repos/'
123 git checkout --detach FETCH_HEAD
124
125 - name: Setup Vite+
126 uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
127 with:
128 node-version-file: package.json
129 cache: ${{ inputs.platform != 'win' }}
130 run-install: false
131
132 - name: Resolve Windows package cache path
133 if: inputs.platform == 'win'
134 id: package_cache_path
135 shell: pwsh
136 run: '"path=$(vp pm cache dir)" >> $env:GITHUB_OUTPUT'
137
138 - name: Cache Windows packages
139 if: inputs.platform == 'win'
140 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
141 with:
142 path: ${{ steps.package_cache_path.outputs.path }}
143 key: windows-release-packages-v1-${{ inputs.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
144
145 # pnpm checks the lockfile and policy before reusing this result. A missing
146 # artifact leaves the cache empty, so installation runs the checks again.
147 - name: Download dependency verification
148 continue-on-error: true
149 uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
150 with:
151 name: release-dependency-verification
152 path: ${{ runner.temp }}/pnpm-metadata
153
154 - name: Install desktop dependencies
155 env:
156 pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
157 run: vp install --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
158
159 - name: Cache resource monitor
160 id: resource_monitor_cache
161 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
162 with:
163 path: native/resource-monitor/target/${{ inputs.rust_target }}/release/t3-resource-monitor${{ inputs.platform == 'win' && '.exe' || '' }}
164 key: resource-monitor-${{ inputs.rust_target }}-${{ hashFiles('native/resource-monitor/Cargo.lock', 'native/resource-monitor/Cargo.toml', 'native/resource-monitor/src/**') }}
165
166 - name: Cache Linux capture helpers
167 if: inputs.platform == 'linux'
168 id: capture_helper_cache
169 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
170 with:
171 path: |
172 native/kde-snap-shot/target/${{ inputs.rust_target }}/release/t3-kde-snap-shot
173 native/hyprland-snap-shot/target/${{ inputs.rust_target }}/release/t3-hyprland-snap-shot
174 key: linux-capture-helpers-${{ inputs.rust_target }}-${{ hashFiles('native/kde-snap-shot/Cargo.lock', 'native/kde-snap-shot/Cargo.toml', 'native/kde-snap-shot/src/**', 'native/hyprland-snap-shot/Cargo.lock', 'native/hyprland-snap-shot/Cargo.toml', 'native/hyprland-snap-shot/src/**', 'native/hyprland-snap-shot/protocols/**') }}
175
176 - name: Setup Rust
177 if: steps.resource_monitor_cache.outputs.cache-hit != 'true' || (inputs.platform == 'linux' && steps.capture_helper_cache.outputs.cache-hit != 'true')
178 uses: dtolnay/rust-toolchain@6bed0761d98439e5a578e2877258200ad565ba87 # stable
179 with:
180 toolchain: stable
181 targets: ${{ inputs.rust_target }}
182
183 - name: Download relay client tracing config
184 if: inputs.relay_client_tracing
185 uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
186 with:
187 name: relay-client-tracing-config
188 path: ${{ runner.temp }}/relay-client-tracing
189
190 - name: Load relay client tracing config
191 if: inputs.relay_client_tracing
192 shell: bash
193 run: |
194 config_path="$RUNNER_TEMP/relay-client-tracing/relay-client-tracing.env"
195 tracing_token="$(sed -n 's/^T3CODE_RELAY_CLIENT_OTLP_TRACES_TOKEN=//p' "$config_path")"
196 echo "::add-mask::$tracing_token"
197 cat "$config_path" >> "$GITHUB_ENV"
198
199 - name: Align package versions to release version
200 run: node scripts/update-release-package-versions.ts "${{ inputs.version }}"
201
202 # The artifact root is `apps/` (upload-artifact keeps the least common
203 # ancestor of its paths), so extracting into `apps` restores
204 # apps/server/dist and apps/desktop/dist-electron at their build paths.
205 - name: Download JS bundle
206 uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
207 with:
208 name: js-bundle
209 path: apps
210
211 # The WSL backend runs the Linux CLI archive inside the distro, so the
212 # Windows desktop embeds the same-arch archive the release attaches.
213 - name: Download Linux CLI archive for WSL
214 if: inputs.platform == 'win'
215 uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
216 with:
217 name: cli-linux-${{ inputs.arch }}
218 path: wsl-runtime
219
220 - name: Install Spectre-mitigated MSVC libs
221 if: inputs.platform == 'win'
222 shell: pwsh
223 run: |
224 $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
225 $installPath = & $vswhere -products * -latest -property installationPath
226 $setupExe = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe"
227 $proc = Start-Process -FilePath $setupExe `
228 -ArgumentList "modify", "--installPath", "`"$installPath`"", "--add", `
229 "Microsoft.VisualStudio.Component.VC.Runtimes.${{ inputs.arch == 'arm64' && 'ARM64' || 'x86.x64' }}.Spectre", "--quiet", "--norestart" `
230 -Wait -PassThru -NoNewWindow
231 if ($null -eq $proc -or $proc.ExitCode -ne 0) {
232 $code = if ($null -ne $proc) { $proc.ExitCode } else { 1 }
233 Write-Error "Visual Studio Installer failed with exit code $code"
234 exit $code
235 }
236
237 - uses: ./.github/actions/setup-apt-mirrors
238 if: inputs.platform == 'linux'
239
240 - name: Install Linux desktop build libraries
241 if: inputs.platform == 'linux'
242 shell: bash
243 run: |
244 sudo apt-get update
245 sudo apt-get install -y libsecret-1-dev pkg-config
246 if ! command -v magick >/dev/null 2>&1 && ! command -v convert >/dev/null 2>&1; then
247 sudo apt-get install -y imagemagick
248 fi
249
250 if command -v magick >/dev/null 2>&1; then
251 magick -version
252 else
253 convert -version
254 fi
255
256 - name: Prepare Azure Trusted Signing
257 if: inputs.platform == 'win'
258 shell: pwsh
259 env:
260 AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
261 AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
262 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
263 AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
264 AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
265 AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
266 AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
267 run: |
268 $ErrorActionPreference = "Stop"
269
270 $requiredSecrets = @(
271 $env:AZURE_TENANT_ID,
272 $env:AZURE_CLIENT_ID,
273 $env:AZURE_CLIENT_SECRET,
274 $env:AZURE_TRUSTED_SIGNING_ENDPOINT,
275 $env:AZURE_TRUSTED_SIGNING_ACCOUNT_NAME,
276 $env:AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME,
277 $env:AZURE_TRUSTED_SIGNING_PUBLISHER_NAME
278 )
279 if ($requiredSecrets | Where-Object { [string]::IsNullOrWhiteSpace($_) }) {
280 Write-Host "Azure Trusted Signing disabled; skipping TrustedSigning module preparation."
281 exit 0
282 }
283
284 try {
285 Install-PackageProvider `
286 -Name NuGet `
287 -MinimumVersion 2.8.5.201 `
288 -Force `
289 -Scope CurrentUser `
290 -ErrorAction Stop
291 } catch {
292 Write-Warning "Could not bootstrap NuGet package provider. Continuing because the runner may already have a usable provider. $($_.Exception.Message)"
293 }
294
295 Install-Module `
296 -Name TrustedSigning `
297 -MinimumVersion 0.5.0 `
298 -Force `
299 -AllowClobber `
300 -Repository PSGallery `
301 -Scope CurrentUser `
302 -ErrorAction Stop
303
304 Import-Module TrustedSigning -MinimumVersion 0.5.0 -Force
305 Get-Command Invoke-TrustedSigning -ErrorAction Stop
306
307 $moduleRoots = @(
308 [System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "PowerShell", "Modules"),
309 [System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "WindowsPowerShell", "Modules"),
310 [System.IO.Path]::Combine($env:ProgramFiles, "PowerShell", "Modules"),
311 [System.IO.Path]::Combine($env:ProgramFiles, "WindowsPowerShell", "Modules")
312 )
313 $modulePathEntries = @($moduleRoots + ($env:PSModulePath -split ";")) |
314 Where-Object { $_ -and (Test-Path $_) } |
315 Select-Object -Unique
316 "PSModulePath=$($modulePathEntries -join ';')" >> $env:GITHUB_ENV
317
318 - name: Build desktop artifact
319 shell: bash
320 env:
321 pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
322 T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: ${{ steps.resource_monitor_cache.outputs.cache-hit == 'true' }}
323 T3CODE_DESKTOP_REUSE_LINUX_CAPTURE_HELPERS: ${{ steps.capture_helper_cache.outputs.cache-hit == 'true' }}
324 CSC_LINK: ${{ secrets.CSC_LINK }}
325 CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
326 APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
327 APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
328 APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
329 APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
330 MACOS_PROVISIONING_PROFILE: ${{ secrets.MACOS_PROVISIONING_PROFILE }}
331 T3CODE_CLERK_PASSKEY_RP_DOMAINS: ${{ vars.CLERK_PASSKEY_RP_DOMAINS }}
332 AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
333 AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
334 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
335 AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
336 AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
337 AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
338 AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
339 run: |
340 args=(
341 --platform "${{ inputs.platform }}"
342 --target "${{ inputs.target }}"
343 --arch "${{ inputs.arch }}"
344 --build-version "${{ inputs.version }}"
345 --skip-build
346 --verbose
347 )
348
349 has_all() {
350 for value in "$@"; do
351 if [[ -z "$value" ]]; then
352 return 1
353 fi
354 done
355 return 0
356 }
357
358 if [[ "${{ inputs.platform }}" == "mac" ]]; then
359 if has_all "$CSC_LINK" "$CSC_KEY_PASSWORD" "$APPLE_API_KEY" "$APPLE_API_KEY_ID" "$APPLE_API_ISSUER"; then
360 if ! has_all "$APPLE_TEAM_ID" "$MACOS_PROVISIONING_PROFILE"; then
361 echo "macOS signing is configured, but APPLE_TEAM_ID or MACOS_PROVISIONING_PROFILE is missing." >&2
362 exit 1
363 fi
364
365 key_path="$RUNNER_TEMP/AuthKey_${APPLE_API_KEY_ID}.p8"
366 printf '%s' "$APPLE_API_KEY" > "$key_path"
367 export APPLE_API_KEY="$key_path"
368
369 profile_path="$RUNNER_TEMP/t3code.provisionprofile"
370 printf '%s' "$MACOS_PROVISIONING_PROFILE" | base64 -D > "$profile_path"
371 security cms -D -i "$profile_path" >/dev/null
372 export T3CODE_APPLE_TEAM_ID="$APPLE_TEAM_ID"
373 export T3CODE_MACOS_PROVISIONING_PROFILE="$profile_path"
374
375 echo "macOS signing enabled."
376 args+=(--signed)
377 else
378 echo "macOS signing disabled (missing one or more Apple signing secrets)."
379 fi
380 elif [[ "${{ inputs.platform }}" == "win" ]]; then
381 # Embed the Linux CLI archive built by the same-arch Linux job as
382 # the WSL runtime. Required for a working WSL backend on Windows.
383 args+=(--wsl-runtime "$GITHUB_WORKSPACE"/wsl-runtime/t3-*-linux-${{ inputs.arch }}.tar.gz)
384 if has_all \
385 "$AZURE_TENANT_ID" \
386 "$AZURE_CLIENT_ID" \
387 "$AZURE_CLIENT_SECRET" \
388 "$AZURE_TRUSTED_SIGNING_ENDPOINT" \
389 "$AZURE_TRUSTED_SIGNING_ACCOUNT_NAME" \
390 "$AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME" \
391 "$AZURE_TRUSTED_SIGNING_PUBLISHER_NAME"; then
392 echo "Windows signing enabled (Azure Trusted Signing)."
393 args+=(--signed)
394 else
395 echo "Windows signing disabled (missing one or more Azure Trusted Signing secrets)."
396 fi
397 else
398 echo "Signing disabled for ${{ inputs.platform }}."
399 fi
400
401 vp run dist:desktop:artifact "${args[@]}"
402
403 # The single-executable is built with a Node that supports --build-sea
404 # (25.7+); the repo itself stays on the engines.node version. It always
405 # injects into the runner's own Node: tsdown's cross-target download path
406 # runs `tar` on a drive-letter path on Windows, which GNU tar reads as a
407 # remote host, and a cross-built macOS binary cannot be smoke-tested.
408 - name: Build CLI single-executable
409 if: inputs.cli_archive
410 shell: bash
411 env:
412 # The exact version, not a major: vp downloads it from nodejs.org/dist on
413 # the runner, and only exact versions have a dist directory. Keep in
414 # step with SEA_NODE_VERSION in apps/server/vite.config.ts.
415 VP_NODE_VERSION: "26.8.2"
416 run: node apps/server/scripts/cli.ts build-exe --verbose
417
418 - name: Import macOS signing certificate for the CLI archive
419 if: inputs.cli_archive && inputs.platform == 'mac'
420 shell: bash
421 env:
422 CSC_LINK: ${{ secrets.CSC_LINK }}
423 CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
424 run: |
425 set -euo pipefail
426 if [[ -z "$CSC_LINK" || -z "$CSC_KEY_PASSWORD" ]]; then
427 echo "macOS CLI signing disabled (missing CSC_LINK); the archive is signed ad hoc."
428 exit 0
429 fi
430 keychain="$RUNNER_TEMP/t3-cli-signing.keychain-db"
431 keychain_password="$(openssl rand -hex 16)"
432 cert_path="$RUNNER_TEMP/t3-cli-signing.p12"
433 printf '%s' "$CSC_LINK" | base64 --decode > "$cert_path"
434 security create-keychain -p "$keychain_password" "$keychain"
435 security set-keychain-settings -lut 21600 "$keychain"
436 security unlock-keychain -p "$keychain_password" "$keychain"
437 security import "$cert_path" -k "$keychain" -P "$CSC_KEY_PASSWORD" -T /usr/bin/codesign
438 security set-key-partition-list -S apple-tool:,apple: -s -k "$keychain_password" "$keychain" >/dev/null
439 security list-keychains -d user -s "$keychain" $(security list-keychains -d user | tr -d '"')
440 identity="$(security find-identity -v -p codesigning "$keychain" | sed -n 's/.*"\(Developer ID Application: [^"]*\)".*/\1/p' | head -n 1)"
441 if [[ -z "$identity" ]]; then
442 echo "No Developer ID Application identity found in CSC_LINK." >&2
443 exit 1
444 fi
445 echo "::add-mask::$keychain_password"
446 echo "T3CODE_CLI_MAC_SIGN_IDENTITY=$identity" >> "$GITHUB_ENV"
447 echo "macOS CLI signing enabled."
448
449 - name: Stage resource monitor for the CLI archive
450 if: inputs.cli_archive
451 shell: bash
452 run: |
453 set -euo pipefail
454 binary_name="t3-resource-monitor"
455 if [[ "${{ inputs.platform }}" == "win" ]]; then
456 binary_name="${binary_name}.exe"
457 fi
458 target_dir="$RUNNER_TEMP/cli-resource-monitor/${{ inputs.resource_key }}"
459 mkdir -p "$target_dir"
460 cp "native/resource-monitor/target/${{ inputs.rust_target }}/release/${binary_name}" "$target_dir/$binary_name"
461
462 - name: Build CLI archive
463 if: inputs.cli_archive
464 shell: bash
465 env:
466 APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
467 APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
468 APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
469 AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
470 AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
471 AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
472 AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
473 AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
474 AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
475 run: |
476 set -euo pipefail
477 if [[ "${{ inputs.platform }}" == "mac" && -n "${APPLE_API_KEY:-}" ]]; then
478 key_path="$RUNNER_TEMP/AuthKey_cli_${APPLE_API_KEY_ID}.p8"
479 printf '%s' "$APPLE_API_KEY" > "$key_path"
480 export APPLE_API_KEY="$key_path"
481 fi
482 node scripts/build-cli-archive.ts \
483 --platform "${{ inputs.platform }}" \
484 --arch "${{ inputs.arch }}" \
485 --version "${{ inputs.version }}" \
486 --resource-monitor-dir "$RUNNER_TEMP/cli-resource-monitor" \
487 --output-dir release-cli
488
489 - name: Smoke-test CLI archive
490 if: inputs.cli_archive
491 shell: bash
492 run: node scripts/smoke-cli-archive.ts --archive release-cli/* --expect-version "${{ inputs.version }}"
493
494 - name: Upload CLI archive
495 if: inputs.cli_archive
496 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
497 with:
498 name: cli-${{ inputs.platform }}-${{ inputs.arch }}
499 path: release-cli/*
500 if-no-files-found: error
501
502 - name: Collect release assets
503 shell: bash
504 run: |
505 set -euo pipefail
506 mkdir -p release-publish
507
508 shopt -s nullglob
509 patterns=(
510 "release/*.dmg"
511 "release/*.zip"
512 "release/*.AppImage"
513 "release/*.exe"
514 )
515 # Preview builds have no publish config, so electron-builder writes
516 # no feed manifest for them, but it still emits blockmaps beside the
517 # installers. Neither belongs on a release no updater may follow.
518 if [[ "${{ inputs.release_channel }}" != "preview" ]]; then
519 patterns+=("release/*.blockmap" "release/*.yml")
520 fi
521 for pattern in "${patterns[@]}"; do
522 for file in $pattern; do
523 cp "$file" release-publish/
524 done
525 done
526
527 if [[ "${{ inputs.platform }}" == "mac" && "${{ inputs.arch }}" != "arm64" ]]; then
528 shopt -s nullglob
529 for manifest in release-publish/*-mac.yml; do
530 mv "$manifest" "${manifest%.yml}-${{ inputs.arch }}.yml"
531 done
532 fi
533
534 # Windows updater metadata is channel-specific (for example
535 # "latest.yml" or "nightly.yml") and carries no arch, so the x64 and
536 # arm64 jobs would upload the same name. Suffix each per-arch copy;
537 # the release job merges them back into one manifest per channel.
538 # builder-debug.yml is electron-builder's config dump, not a feed.
539 if [[ "${{ inputs.platform }}" == "win" ]]; then
540 for manifest in release-publish/*.yml; do
541 [[ "$manifest" == */builder-debug.yml ]] && continue
542 mv "$manifest" "${manifest%.yml}-win-${{ inputs.arch }}.yml"
543 done
544 fi
545
546 - name: Collect resource monitor
547 shell: bash
548 run: |
549 set -euo pipefail
550 binary_name="t3-resource-monitor"
551 if [[ "${{ inputs.platform }}" == "win" ]]; then
552 binary_name="${binary_name}.exe"
553 fi
554 source_path="native/resource-monitor/target/${{ inputs.rust_target }}/release/${binary_name}"
555 target_dir="resource-monitor-publish/${{ inputs.resource_key }}"
556 mkdir -p "$target_dir"
557 cp "$source_path" "$target_dir/$binary_name"
558
559 - name: Upload build artifacts
560 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
561 with:
562 name: desktop-${{ inputs.platform }}-${{ inputs.arch }}
563 path: release-publish/*
564 if-no-files-found: error
565
566 - name: Upload resource monitor
567 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
568 with:
569 name: resource-monitor-${{ inputs.resource_key }}
570 path: resource-monitor-publish/${{ inputs.resource_key }}/*
571 if-no-files-found: error