[main] Add CI for building with previously source-built SDK (#15603)

Co-authored-by: Michael Simons <msimons@microsoft.com>
This commit is contained in:
Logan Bussell 2023-03-03 17:53:19 -08:00 committed by GitHub
parent 9fd347ecc6
commit 9cf0095d08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 87 additions and 32 deletions

View file

@ -9,10 +9,12 @@ usage() {
echo ""
echo " Prepares the environment to be built by downloading Private.SourceBuilt.Artifacts.*.tar.gz and"
echo " installing the version of dotnet referenced in global.json"
echo "options:"
echo " --no-bootstrap Don't replace portable packages in the download source-built artifacts"
echo ""
}
buildBootstrap=false
buildBootstrap=true
positional_args=()
while :; do
if [ $# -le 0 ]; then
@ -24,6 +26,9 @@ while :; do
usage
exit 0
;;
--no-bootstrap)
buildBootstrap=false
;;
*)
positional_args+=("$1")
;;
@ -69,15 +74,14 @@ function DownloadArchive {
baseFileName="$2"
isRequired="$3"
sourceBuiltArtifactsTarballUrl="https://dotnetcli.azureedge.net/source-built-artifacts/assets/"
packageVersionsPath="$SCRIPT_ROOT/eng/Versions.props"
notFoundMessage="No source-built $archiveType found to download..."
echo " Looking for source-built $archiveType to download..."
archiveVersionLine=`grep -m 1 "<PrivateSourceBuilt${archiveType}PackageVersion>" "$packageVersionsPath" || :`
versionPattern="<PrivateSourceBuilt${archiveType}PackageVersion>(.*)</PrivateSourceBuilt${archiveType}PackageVersion>"
archiveVersionLine=`grep -m 1 "<PrivateSourceBuilt${archiveType}Url>" "$packageVersionsPath" || :`
versionPattern="<PrivateSourceBuilt${archiveType}Url>(.*)</PrivateSourceBuilt${archiveType}Url>"
if [[ $archiveVersionLine =~ $versionPattern ]]; then
archiveUrl="${sourceBuiltArtifactsTarballUrl}${baseFileName}.${BASH_REMATCH[1]}.tar.gz"
archiveUrl="${BASH_REMATCH[1]}"
echo " Downloading source-built $archiveType from $archiveUrl..."
(cd $packagesArchiveDir && curl --retry 5 -O $archiveUrl)
elif [ "$isRequired" == "true" ]; then
@ -124,7 +128,9 @@ fi
# Read the eng/Versions.props to get the archives to download and download them
if [ "$downloadArtifacts" == "true" ]; then
DownloadArchive "Artifacts" $artifactsBaseFileName "true"
BootstrapArtifacts
if [ "$buildBootstrap" == "true" ]; then
BootstrapArtifacts
fi
fi
if [ "$downloadPrebuilts" == "true" ]; then