From caf3ec803e4ac5f1361fbcb1592b592258c26a85 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Wed, 28 Feb 2024 22:29:26 -0800 Subject: [PATCH] Remove release feed download of aspire bits from build --- build.cmd | 3 -- build.sh | 3 -- build/installLatestFromReleaseBranch.ps1 | 39 ------------------ build/installLatestFromReleaseBranch.sh | 51 ------------------------ 4 files changed, 96 deletions(-) delete mode 100644 build/installLatestFromReleaseBranch.ps1 delete mode 100755 build/installLatestFromReleaseBranch.sh diff --git a/build.cmd b/build.cmd index cc08553..c841ca8 100644 --- a/build.cmd +++ b/build.cmd @@ -1,6 +1,3 @@ @ECHO OFF -:: Install the latest version of the Aspire workload from the release branches -powershell -ExecutionPolicy Bypass -NoProfile -Command "& '.\build\installLatestFromReleaseBranch.ps1'" - dotnet build .\build\Build.proj \ No newline at end of file diff --git a/build.sh b/build.sh index 371ba16..4cea617 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,3 @@ #!/usr/bin/env bash -# Install the latest version of the Aspire workload from the release branches -./build/installLatestFromReleaseBranch.sh - dotnet build ./build/Build.proj \ No newline at end of file diff --git a/build/installLatestFromReleaseBranch.ps1 b/build/installLatestFromReleaseBranch.ps1 deleted file mode 100644 index d1bc60c..0000000 --- a/build/installLatestFromReleaseBranch.ps1 +++ /dev/null @@ -1,39 +0,0 @@ -# NuGet Feed URL -$nugetUrl = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" - -# Package name to search for -$packageName = "Microsoft.NET.Sdk.Aspire.Manifest-8.0.100" - -# Fetch the feed data -$feedData = Invoke-RestMethod -Uri $nugetUrl - -# Extract resources and find the first package's metadata URL using substring comparison -$metadataUrl = $feedData.resources | Where-Object { $_.'@type' -like '*RegistrationsBaseUrl*' } | Select-Object -First 1 -ExpandProperty '@id' - -# Fetch the package data -$packageData = Invoke-RestMethod -Uri "$metadataUrl$packageName/index.json" - -# Get the latest version -$latestVersion = $packageData.items[-1].upper - -# Create the content for the rollback file -$fileContent = @" -{ - `"microsoft.net.sdk.aspire`": `"$latestVersion/8.0.100`" -} -"@ - -# Write to file -$fileContent | Out-File -FilePath "aspire-rollback.txt" - -# Run dotnet workload update command -dotnet workload update --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" --skip-sign-check --from-rollback-file .\aspire-rollback.txt - -# Run dotnet workload install command -dotnet workload install aspire --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" --skip-sign-check --from-rollback-file .\aspire-rollback.txt - -# Delete the rollback file as it is no longer needed. -Remove-Item "aspire-rollback.txt" -Force - -# Output the latest version -Write-Output "Installed Latest version of aspire produced from the release branch. Version installed was $latestVersion." diff --git a/build/installLatestFromReleaseBranch.sh b/build/installLatestFromReleaseBranch.sh deleted file mode 100755 index b660fff..0000000 --- a/build/installLatestFromReleaseBranch.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -# Check if jq is installed -if ! command -v jq &> /dev/null -then - echo "Error: jq is not installed. Please install jq to run this script." - echo "On Ubuntu/Debian: sudo apt-get install jq" - echo "On macOS: brew install jq" - exit 1 -fi - -# NuGet Feed URL -nugetUrl="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" - -# Package name to search for -packageName="Microsoft.NET.Sdk.Aspire.Manifest-8.0.100" - -# Fetch the feed data -feedData=$(curl -s $nugetUrl) - -# Extract resources and find the first package's metadata URL using jq -metadataUrl=$(echo $feedData | jq -r '.resources[] | select(."@type" | contains("RegistrationsBaseUrl")) | ."@id"' | head -1) - -# Fetch the package data -packageData=$(curl -s "${metadataUrl}${packageName}/index.json") - -# Get the latest version -latestVersion=$(echo $packageData | jq -r '.items[-1].upper') - -# Create the content for the rollback file -fileContent=$(cat <<-END -{ - "microsoft.net.sdk.aspire": "$latestVersion/8.0.100" -} -END -) - -# Write to file -echo "$fileContent" > aspire-rollback.txt - -# Run dotnet workload update command -dotnet workload update --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" --skip-sign-check --from-rollback-file ./aspire-rollback.txt - -# Run dotnet workload install command -dotnet workload install aspire --source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" --skip-sign-check --from-rollback-file ./aspire-rollback.txt - -# Delete the rollback file as it is no longer needed. -rm -f ./aspire-rollback.txt - -# Output the latest version -echo "Installed Latest version of aspire produced from the release branch. Version installed was $latestVersion."