The best way to control Claude Code, Codex and more from any computer or phone
ci(release): desktop builds stop hitting the npm registry for staged installs (#26458)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 28, 2026 at 05:41 UTC
6bc87b94e15cf93c5448cc8f1dc52e7cd2271b82
1 file changed
+47
-1
.github/workflows/release-desktop.yml
+47
-1
@@ -163,6 +163,29 @@ jobs:
163
env:
164
pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
165
166
+ # The CLI archive and the staged app install without a lockfile, so they
167
+ # ask the registry about every package and fetch platform packages the
168
+ # workspace store lacks. They share this registry metadata and store. A
169
+ # new week starts cold, which bounds how stale cached ranges can get.
170
+ - name: Resolve staged install cache
171
+ id: stage_pnpm
172
+ shell: bash
173
+ run: |
174
+ echo "dir=$RUNNER_TEMP/desktop-stage-pnpm" >> "$GITHUB_OUTPUT"
175
+ echo "prefix=desktop-stage-pnpm-v2-${{ inputs.platform }}-${{ inputs.arch }}-$(date -u +%G-%V)-" >> "$GITHUB_OUTPUT"
176
+
177
+ - name: Restore staged install cache
178
+ id: stage_pnpm_cache
179
+ uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
180
+ with:
181
+ path: ${{ steps.stage_pnpm.outputs.dir }}
182
+ key: ${{ steps.stage_pnpm.outputs.prefix }}${{ github.run_id }}-${{ github.run_attempt }}
183
+ restore-keys: ${{ steps.stage_pnpm.outputs.prefix }}
184
+
185
+ - name: Mark staged install cache
186
+ shell: bash
187
+ run: mkdir -p "${{ steps.stage_pnpm.outputs.dir }}" && touch "$RUNNER_TEMP/desktop-stage-pnpm.marker"
188
+
189
- name: Cache resource monitor
190
id: resource_monitor_cache
191
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
@@ -371,6 +394,9 @@ jobs:
394
if: inputs.cli_archive
395
shell: bash
396
env:
397
+ pnpm_config_cache_dir: ${{ steps.stage_pnpm.outputs.dir }}/cache
398
+ pnpm_config_store_dir: ${{ steps.stage_pnpm.outputs.dir }}/store
399
+ pnpm_config_prefer_offline: "true"
400
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
401
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
402
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
@@ -490,7 +516,10 @@ jobs:
516
- name: Build desktop artifact
517
shell: bash
518
env:
493
- pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
519
+ # pnpm only goes to the registry for packages or versions the cache lacks.
520
+ pnpm_config_cache_dir: ${{ steps.stage_pnpm.outputs.dir }}/cache
521
+ pnpm_config_store_dir: ${{ steps.stage_pnpm.outputs.dir }}/store
522
+ pnpm_config_prefer_offline: "true"
523
T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: true
524
T3CODE_DESKTOP_REUSE_LINUX_CAPTURE_HELPERS: ${{ steps.capture_helper_cache.outputs.cache-hit == 'true' }}
525
CSC_LINK: ${{ secrets.CSC_LINK }}
@@ -575,6 +604,23 @@ jobs:
604
605
vp run dist:desktop:artifact "${args[@]}"
606
607
+ # Warm installs only touch the store index, so new content means a fetch.
608
+ - name: Check staged install cache for new content
609
+ id: stage_pnpm_changed
610
+ shell: bash
611
+ run: |
612
+ dir="${{ steps.stage_pnpm.outputs.dir }}"
613
+ new=$(find "$dir/cache/v12" "$dir/store/v11/files" -type f -newer "$RUNNER_TEMP/desktop-stage-pnpm.marker" 2>/dev/null | wc -l | tr -d ' ')
614
+ echo "Staged installs added $new cached files."
615
+ echo "changed=$([[ "$new" -gt 0 ]] && echo true || echo false)" >> "$GITHUB_OUTPUT"
616
+
617
+ - name: Save staged install cache
618
+ if: steps.stage_pnpm_changed.outputs.changed == 'true'
619
+ uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
620
+ with:
621
+ path: ${{ steps.stage_pnpm.outputs.dir }}
622
+ key: ${{ steps.stage_pnpm_cache.outputs.cache-primary-key }}
623
+
624
# A build can package fine and still not open (a missing module in the
625
# backend or the bundle). This launches the app from the shipped
626
# AppImage or DMG.