diff --git a/images/macos/provision/core/dotnet.sh b/images/macos/provision/core/dotnet.sh index c00a34607dfb..1bd612e9b9e7 100755 --- a/images/macos/provision/core/dotnet.sh +++ b/images/macos/provision/core/dotnet.sh @@ -22,11 +22,18 @@ DOTNET_VERSIONS=($(get_toolset_value '.dotnet.versions | .[]')) for DOTNET_VERSION in "${DOTNET_VERSIONS[@]}"; do RELEASE_URL="https://raw.githubusercontent.com/dotnet/core/master/release-notes/${DOTNET_VERSION}/releases.json" - ARGS_LIST+=( - $(curl -s "$RELEASE_URL" | \ - jq -r '.releases[].sdk."version"' | grep -v -E '\-(preview|rc)\d*' | \ - sort -r | rev | uniq -s 2 | rev) - ) + + if [[ $DOTNET_VERSION == "6.0" ]]; then + ARGS_LIST+=( + $(curl -s "$RELEASE_URL" | jq -r 'first(.releases[].sdks[]?.version | select(contains("preview") or contains("rc") | not))') + ) + else + ARGS_LIST+=( + $(curl -s "$RELEASE_URL" | \ + jq -r '.releases[].sdk."version"' | grep -v -E '\-(preview|rc)\d*' | \ + sort -r | rev | uniq -s 2 | rev) + ) + fi done for ARGS in "${ARGS_LIST[@]}"; do diff --git a/images/macos/toolsets/toolset-11.json b/images/macos/toolsets/toolset-11.json index c314ffc8edae..1306b902b5c5 100644 --- a/images/macos/toolsets/toolset-11.json +++ b/images/macos/toolsets/toolset-11.json @@ -306,7 +306,8 @@ "dotnet": { "versions": [ "3.1", - "5.0" + "5.0", + "6.0" ] }, "ruby": { diff --git a/images/macos/toolsets/toolset-12.json b/images/macos/toolsets/toolset-12.json index c4eae4295941..f8357ce22267 100644 --- a/images/macos/toolsets/toolset-12.json +++ b/images/macos/toolsets/toolset-12.json @@ -236,7 +236,8 @@ "dotnet": { "versions": [ "3.1", - "5.0" + "5.0", + "6.0" ] }, "ruby": {