fix(ci): recover corrupt SDK downloads
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user