From e36f7f3feaa561782a66165b8db55f4c0bbdf963 Mon Sep 17 00:00:00 2001 From: Logan Bussell Date: Mon, 23 Jan 2023 18:26:27 -0800 Subject: [PATCH] [release/7.0.1xx] Add CI for building with N-1 source-built SDK (#15164) --- eng/Versions.props | 1 + .../job/source-build-build-tarball.yml | 29 +++++++++++++++++++ .../job/source-build-run-tarball-build.yml | 14 +++++++++ .../pipelines/security-partners-dotnet.yml | 1 + 4 files changed, 45 insertions(+) diff --git a/eng/Versions.props b/eng/Versions.props index c5ab2374a..6014b3ff2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -193,6 +193,7 @@ or minor release, prebuilts may be needed. When the release is mature, prebuilts are not necessary, and this property is removed from the file. --> + 7.0.102 7.0.102-4 diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml index 9ae170d1c..9e67adb4d 100644 --- a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml @@ -101,6 +101,35 @@ jobs: Contents: '*.tar.gz' TargetFolder: $(tarballDir)/packages/archive/ + - script: | + set -euo pipefail + + sourceBuiltSDKUrl="https://dotnetcli.azureedge.net/source-built-artifacts/sdks/" + packageVersionsPath="$(Build.SourcesDirectory)/eng/Versions.props" + notFoundMessage="No source-built SDK found to download..." + + echo "Looking for source-built SDK to download..." + archiveVersionLine=`grep -m 1 "" "$packageVersionsPath" || :` + versionPattern="(.*)" + + if [[ $archiveVersionLine =~ $versionPattern ]]; then + filename="dotnet-sdk-${BASH_REMATCH[1]}-centos.8-x64.tar.gz" + archiveUrl="${sourceBuiltSDKUrl}${filename}" + downloadDir=$(mktemp -d) + (cd $downloadDir && curl --retry 5 -O $archiveUrl) + + mkdir $(tarballDir)/.dotnet + tar -xzf $downloadDir/$filename -C $(tarballDir)/.dotnet + rm -rf $downloadDir + else + echo "$notFoundMessage" + exit 1 + fi + + echo "##vso[task.setvariable variable=additionalBuildArgs]--with-sdk /tarball/.dotnet" + displayName: Setup Previously Source-Built SDK + condition: eq(variables._WithPreviousSDK, 'true') + - script: | set -x diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml index 5459e8415..efa1ff1af 100644 --- a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml @@ -41,31 +41,43 @@ jobs: _EnablePoison: false _ExcludeOmniSharpTests: true _RunOnline: true + _WithPreviousSDK: false CentOSStream8-Offline: _BootstrapPrep: true _Container: ${{ parameters.centOSStream8Container }} _EnablePoison: false _ExcludeOmniSharpTests: true _RunOnline: false + _WithPreviousSDK: false ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + CentOSStream8-WithPreviousSDK: + _BootstrapPrep: false + _Container: ${{ parameters.centOSStream8Container }} + _EnablePoison: false + _ExcludeOmniSharpTests: true + _RunOnline: false + _WithPreviousSDK: true CentOSStream9-Offline: _BootstrapPrep: true _Container: ${{ parameters.centOSStream9Container }} _EnablePoison: false _ExcludeOmniSharpTests: false _RunOnline: false + _WithPreviousSDK: false Fedora36-Offline: _BootstrapPrep: true _Container: ${{ parameters.fedora36Container }} _EnablePoison: true _ExcludeOmniSharpTests: false _RunOnline: false + _WithPreviousSDK: false Ubuntu2004-Offline: _BootstrapPrep: true _Container: ${{ parameters.ubuntu2004Container }} _EnablePoison: false _ExcludeOmniSharpTests: false _RunOnline: false + _WithPreviousSDK: false name: Build_Tarball_x64 pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: @@ -89,6 +101,7 @@ jobs: _EnablePoison: false _ExcludeOmniSharpTests: false _RunOnline: false + _WithPreviousSDK: false name: Build_Tarball_arm64 pool: ${{ parameters.poolInternalArm64 }} @@ -109,6 +122,7 @@ jobs: _EnablePoison: false _ExcludeOmniSharpTests: false _RunOnline: false + _WithPreviousSDK: false name: Build_Tarball_x64_Using_Previous pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: diff --git a/src/SourceBuild/tarball/content/eng/pipelines/security-partners-dotnet.yml b/src/SourceBuild/tarball/content/eng/pipelines/security-partners-dotnet.yml index 69bef21e9..6200e7fc0 100644 --- a/src/SourceBuild/tarball/content/eng/pipelines/security-partners-dotnet.yml +++ b/src/SourceBuild/tarball/content/eng/pipelines/security-partners-dotnet.yml @@ -12,6 +12,7 @@ jobs: _EnablePoison: false _ExcludeOmniSharpTests: false _RunOnline: false + _WithPreviousSDK: false name: Build_Tarball_x64 pool: name: NetCore1ESPool-Svc-Internal