File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments