The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 13:15 UTC
ci(release): releases stop depending on npm and nodejs.org when nothing changed (#26362)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 28, 2026 at 02:45 UTC
07f7f976097b56450364fe136aac9253f4f7d8e1
2 files changed
+66
-7
.github/actions/setup-ci-deps/action.yml
+20
@@ -70,6 +70,9 @@ runs:
70
INSTALL_ARGS: ${{ inputs.install-args }}
71
run: |
72
echo "path=$(vp pm cache dir)" >> "$GITHUB_OUTPUT"
73
+ metadata_dir="${pnpm_config_cache_dir:-$RUNNER_TEMP/pnpm-metadata}"
74
+ echo "pnpm_config_cache_dir=$metadata_dir" >> "$GITHUB_ENV"
75
+ echo "verified=$metadata_dir/lockfile-verified.jsonl" >> "$GITHUB_OUTPUT"
76
if [[ -z "$INSTALL_ARGS" ]]; then
77
echo "namespace=full" >> "$GITHUB_OUTPUT"
78
else
@@ -94,6 +97,16 @@ runs:
97
pnpm-${{ steps.pnpm_store.outputs.namespace }}-v1-${{ runner.os }}-${{ runner.arch }}-
98
pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-
99
100
+ # pnpm accepts an earlier pass for the same lockfile and policy at any age, so
101
+ # a cached record skips fetching registry metadata for every package.
102
+ - name: Restore lockfile verification
103
+ id: pnpm_verified
104
+ if: inputs.install == 'true'
105
+ uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
106
+ with:
107
+ path: ${{ steps.pnpm_store.outputs.verified }}
108
+ key: pnpm-verified-v1-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
109
+
110
- name: Install dependencies
111
if: inputs.install == 'true'
112
shell: bash
@@ -102,6 +115,13 @@ runs:
115
# Unquoted so each filter is its own argument.
116
run: vp install $INSTALL_ARGS
117
118
+ - name: Save lockfile verification
119
+ if: inputs.install == 'true' && steps.pnpm_verified.outputs.cache-hit != 'true'
120
+ uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
121
+ with:
122
+ path: ${{ steps.pnpm_store.outputs.verified }}
123
+ key: ${{ steps.pnpm_verified.outputs.cache-primary-key }}
124
+
125
# A filtered install that started from the current full store adds nothing
126
# worth a second copy of it.
127
- name: Save pnpm store
.github/workflows/release-desktop.yml
+46
-7
@@ -254,21 +254,60 @@ jobs:
254
if [[ "${{ inputs.version }}" =~ -nightly\.[0-9]{8}\.[0-9]+$ ]]; then brand=nightly; fi
255
node scripts/apply-web-brand-assets.ts "$brand" apps/server/dist/client
256
257
+ - name: Resolve target Node.js for the CLI executable
258
+ id: target_node
259
+ if: inputs.cli_archive && inputs.platform == 'win'
260
+ shell: bash
261
+ run: echo "version=$(node -p 'require("./package.json").engines.node')" >> "$GITHUB_OUTPUT"
262
+
263
+ # The download only changes with engines.node, so a cached copy keeps
264
+ # releases off nodejs.org, which stalls on the runners some days.
265
+ - name: Restore target Node.js for the CLI executable
266
+ id: target_node_cache
267
+ if: inputs.cli_archive && inputs.platform == 'win'
268
+ uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
269
+ with:
270
+ path: ${{ runner.temp }}/node-download
271
+ key: node-download-v${{ steps.target_node.outputs.version }}-win-${{ inputs.arch }}
272
+
273
# tsdown downloads the target Node with one fetch and no retry, and
274
# nodejs.org drops that download often enough to fail releases. Seed
259
- # tsdown's cache with a retried, checksum-verified copy instead.
275
+ # tsdown's cache with a retried, checksum-verified copy instead. A transfer
276
+ # under 100 KB/s for 30s counts as failed, so a stall retries.
277
- name: Download target Node.js for the CLI executable
278
+ if: inputs.cli_archive && inputs.platform == 'win' && steps.target_node_cache.outputs.cache-hit != 'true'
279
+ shell: bash
280
+ env:
281
+ VERSION: ${{ steps.target_node.outputs.version }}
282
+ run: |
283
+ set -euo pipefail
284
+ name="node-v$VERSION-win-${{ inputs.arch }}"
285
+ dir="$RUNNER_TEMP/node-download"
286
+ mkdir -p "$dir"
287
+ fetch=(curl -fsSL --retry 5 --retry-all-errors --connect-timeout 10 --speed-limit 102400 --speed-time 30)
288
+ "${fetch[@]}" -o "$dir/$name.zip" "https://nodejs.org/dist/v$VERSION/$name.zip"
289
+ "${fetch[@]}" -o "$dir/SHASUMS256.txt" "https://nodejs.org/dist/v$VERSION/SHASUMS256.txt"
290
+ (cd "$dir" && grep " $name.zip\$" SHASUMS256.txt | sha256sum -c -)
291
+
292
+ # Saved right away so a later failure in this job still keeps the download.
293
+ - name: Save target Node.js for the CLI executable
294
+ if: inputs.cli_archive && inputs.platform == 'win' && steps.target_node_cache.outputs.cache-hit != 'true'
295
+ uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
296
+ with:
297
+ path: ${{ runner.temp }}/node-download
298
+ key: ${{ steps.target_node_cache.outputs.cache-primary-key }}
299
+
300
+ - name: Install target Node.js for the CLI executable
301
if: inputs.cli_archive && inputs.platform == 'win'
302
shell: bash
303
+ env:
304
+ VERSION: ${{ steps.target_node.outputs.version }}
305
run: |
306
set -euo pipefail
265
- version="$(node -p 'require("./package.json").engines.node')"
266
- name="node-v$version-win-${{ inputs.arch }}"
267
- dest="${XDG_CACHE_HOME:-$HOME/.cache}/tsdown/node/v$version/win-${{ inputs.arch }}"
307
+ name="node-v$VERSION-win-${{ inputs.arch }}"
308
dir="$RUNNER_TEMP/node-download"
269
- mkdir -p "$dir" "$dest"
270
- curl -fsSL --retry 5 --retry-all-errors -o "$dir/$name.zip" "https://nodejs.org/dist/v$version/$name.zip"
271
- curl -fsSL --retry 5 --retry-all-errors -o "$dir/SHASUMS256.txt" "https://nodejs.org/dist/v$version/SHASUMS256.txt"
309
+ dest="${XDG_CACHE_HOME:-$HOME/.cache}/tsdown/node/v$VERSION/win-${{ inputs.arch }}"
310
+ mkdir -p "$dest"
311
(cd "$dir" && grep " $name.zip\$" SHASUMS256.txt | sha256sum -c -)
312
unzip -p "$dir/$name.zip" "$name/node.exe" > "$dest/node.exe"
313