Skip to content

Commit ce66aab

Browse files
t3dotggclaude
andauthored
ci(release): Windows CLI builds retry the Node.js download (#26345)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2349c81 commit ce66aab

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎.github/workflows/release-desktop.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,24 @@ jobs:
254254
if [[ "${{ inputs.version }}" =~ -nightly\.[0-9]{8}\.[0-9]+$ ]]; then brand=nightly; fi
255255
node scripts/apply-web-brand-assets.ts "$brand" apps/server/dist/client
256256
257+
# tsdown downloads the target Node with one fetch and no retry, and
258+
# nodejs.org drops that download often enough to fail releases. Seed
259+
# tsdown's cache with a retried, checksum-verified copy instead.
260+
- name: Download target Node.js for the CLI executable
261+
if: inputs.cli_archive && inputs.platform == 'win'
262+
shell: bash
263+
run: |
264+
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 }}"
268+
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"
272+
(cd "$dir" && grep " $name.zip\$" SHASUMS256.txt | sha256sum -c -)
273+
unzip -p "$dir/$name.zip" "$name/node.exe" > "$dest/node.exe"
274+
257275
# Setup Vite+ selects the exact engines.node version from package.json.
258276
# Native builds embed that executable; cross-target builds download the
259277
# same version for their target.

0 commit comments

Comments
 (0)