fix(ci): recover corrupt SDK downloads
CI and Deploy / test (push) Successful in 5m18s
CI and Deploy / deploy (push) Successful in 4m10s

This commit is contained in:
cesnimda
2026-08-24 21:30:25 +02:00
parent ec72f3ee1f
commit cc76f86482
+16 -6
View File
@@ -21,12 +21,22 @@ jobs:
# dir via dotnet-install.sh and retry once on failure, mirroring the # dir via dotnet-install.sh and retry once on failure, mirroring the
# npm ci / NuGet retries elsewhere in this workflow. # npm ci / NuGet retries elsewhere in this workflow.
run: | run: |
install() { if [ -x "$HOME/.dotnet/dotnet" ] && "$HOME/.dotnet/dotnet" --list-sdks | grep -q '^9\.'; then
curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh echo "Reusing valid runner-local .NET 9 SDK."
rm -rf "$HOME/.dotnet" else
bash /tmp/dotnet-install.sh --channel 9.0 --install-dir "$HOME/.dotnet" install() {
} local feed="${1:-}"
install || ( echo "dotnet install failed ($?) — retrying once..." && install ) local -a feed_args=()
if [ -n "$feed" ]; then
feed_args=(--azure-feed "$feed")
fi
curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh
rm -rf "$HOME/.dotnet"
bash /tmp/dotnet-install.sh --channel 9.0 --install-dir "$HOME/.dotnet" "${feed_args[@]}"
}
install || ( echo "dotnet install failed ($?) — retrying from alternate Microsoft CDN..." \
&& install https://dotnetcli.azureedge.net/dotnet )
fi
echo "$HOME/.dotnet" >> "$GITHUB_PATH" echo "$HOME/.dotnet" >> "$GITHUB_PATH"
"$HOME/.dotnet/dotnet" --info "$HOME/.dotnet/dotnet" --info