From 4b66a8aa8381411159788d1989f522cd5cfa490b Mon Sep 17 00:00:00 2001 From: nikolai-frolov Date: Fri, 28 Jan 2022 13:55:11 +0300 Subject: [PATCH 1/2] [Ubuntu] Add .NET SDK 6.0 --- images/linux/scripts/installers/dotnetcore-sdk.sh | 8 ++++++-- images/linux/toolsets/toolset-1804.json | 6 ++++-- images/linux/toolsets/toolset-2004.json | 6 ++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/images/linux/scripts/installers/dotnetcore-sdk.sh b/images/linux/scripts/installers/dotnetcore-sdk.sh index 69af71797782..50e7e40f2114 100644 --- a/images/linux/scripts/installers/dotnetcore-sdk.sh +++ b/images/linux/scripts/installers/dotnetcore-sdk.sh @@ -32,8 +32,12 @@ for version in ${DOTNET_VERSIONS[@]}; do release_url="https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/${version}/releases.json" download_with_retries "${release_url}" "." "${version}.json" releases=$(cat "./${version}.json") - sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdk.version')) - sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdks[]?' | jq '.version')) + if [[ $version == "6.0" ]]; then + sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdks[]?' | jq '.version' | grep -v preview | grep -v rc | grep -v display -m 1)) + else + sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdk.version')) + sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdks[]?' | jq '.version')) + fi rm ./${version}.json done diff --git a/images/linux/toolsets/toolset-1804.json b/images/linux/toolsets/toolset-1804.json index 8f7185b466e9..7110cd3b8372 100644 --- a/images/linux/toolsets/toolset-1804.json +++ b/images/linux/toolsets/toolset-1804.json @@ -247,12 +247,14 @@ "dotnet": { "aptPackages": [ "dotnet-sdk-3.1", - "dotnet-sdk-5.0" + "dotnet-sdk-5.0", + "dotnet-sdk-6.0" ], "versions": [ "2.1", "3.1", - "5.0" + "5.0", + "6.0" ], "tools": [ { "name": "nbgv", "test": "nbgv --version", "getversion" : "nbgv --version" } diff --git a/images/linux/toolsets/toolset-2004.json b/images/linux/toolsets/toolset-2004.json index 2f0cd4a1e4f7..5a4d140cd8cf 100644 --- a/images/linux/toolsets/toolset-2004.json +++ b/images/linux/toolsets/toolset-2004.json @@ -247,12 +247,14 @@ "dotnet": { "aptPackages": [ "dotnet-sdk-3.1", - "dotnet-sdk-5.0" + "dotnet-sdk-5.0", + "dotnet-sdk-6.0" ], "versions": [ "2.1", "3.1", - "5.0" + "5.0", + "6.0" ], "tools": [ { "name": "nbgv", "test": "nbgv --version", "getversion" : "nbgv --version" } From 8d504f58b873dc5568711c223007c8a411f87847 Mon Sep 17 00:00:00 2001 From: nikolai-frolov Date: Fri, 28 Jan 2022 19:23:51 +0300 Subject: [PATCH 2/2] Correction according to comments --- images/linux/scripts/installers/dotnetcore-sdk.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/images/linux/scripts/installers/dotnetcore-sdk.sh b/images/linux/scripts/installers/dotnetcore-sdk.sh index 50e7e40f2114..36c50d4a8bfb 100644 --- a/images/linux/scripts/installers/dotnetcore-sdk.sh +++ b/images/linux/scripts/installers/dotnetcore-sdk.sh @@ -33,15 +33,15 @@ for version in ${DOTNET_VERSIONS[@]}; do download_with_retries "${release_url}" "." "${version}.json" releases=$(cat "./${version}.json") if [[ $version == "6.0" ]]; then - sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdks[]?' | jq '.version' | grep -v preview | grep -v rc | grep -v display -m 1)) + sdks=("${sdks[@]}" $(echo "${releases}" | jq -r 'first(.releases[].sdks[]?.version | select(contains("preview") or contains("rc") | not))')) else - sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdk.version')) - sdks=("${sdks[@]}" $(echo "${releases}" | jq '.releases[]' | jq '.sdks[]?' | jq '.version')) + sdks=("${sdks[@]}" $(echo "${releases}" | jq -r '.releases[].sdk.version | select(contains("preview") or contains("rc") | not)')) + sdks=("${sdks[@]}" $(echo "${releases}" | jq -r '.releases[].sdks[]?.version | select(contains("preview") or contains("rc") | not)')) fi rm ./${version}.json done -sortedSdks=$(echo ${sdks[@]} | tr ' ' '\n' | grep -v preview | grep -v rc | grep -v display | cut -d\" -f2 | sort -r | uniq -w 5) +sortedSdks=$(echo ${sdks[@]} | tr ' ' '\n' | sort -r | uniq -w 5) extract_dotnet_sdk() { local ARCHIVE_NAME="$1"