From d803d1bd46906e09f5652f85d05cbf6db22e75af Mon Sep 17 00:00:00 2001 From: Jean-Marc Prieur Date: Fri, 18 Oct 2024 19:50:59 -0700 Subject: [PATCH] Fix DevEx and IDDP builds (#3093) * Fix build * Nuget authenticate without source * resilience to jobs * Cleaner way to remove the external feed and add the internal one * Adding a display --- build/template-install-dependencies.yaml | 5 ----- build/template-onebranch-release-build.yaml | 2 -- build/template-pack-nuget.yaml | 2 -- build/template-restore-build-MSIdentityWeb.yaml | 17 ++++++++--------- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/build/template-install-dependencies.yaml b/build/template-install-dependencies.yaml index 415217436..e9897c267 100644 --- a/build/template-install-dependencies.yaml +++ b/build/template-install-dependencies.yaml @@ -1,6 +1,4 @@ #template-install-dependencies.yaml -parameters: - authenticateForFeed: 'true' #install dotnet core @@ -48,9 +46,6 @@ steps: - task: NuGetAuthenticate@1 displayName: NuGet Authenticate - condition: eq('${{ parameters.authenticateForFeed }}', 'true') - inputs: - nuGetServiceConnections: 'IDDP Feed' - powershell: | $kvSecretBytes = [System.Convert]::FromBase64String('$(LabAuth)') diff --git a/build/template-onebranch-release-build.yaml b/build/template-onebranch-release-build.yaml index 76bc2301a..302a76ad2 100644 --- a/build/template-onebranch-release-build.yaml +++ b/build/template-onebranch-release-build.yaml @@ -9,8 +9,6 @@ steps: # Bootstrap the build - template: template-install-dependencies.yaml - parameters: - authenticateForFeed: 'false' # Nuget Restore and Build Microsoft.Identity.Web.sln - template: template-restore-build-MSIdentityWeb.yaml diff --git a/build/template-pack-nuget.yaml b/build/template-pack-nuget.yaml index e5a09651a..ae3881cf0 100644 --- a/build/template-pack-nuget.yaml +++ b/build/template-pack-nuget.yaml @@ -16,8 +16,6 @@ steps: nobuild: '${{parameters.NoBuild}}' packagesToPack: '${{ parameters.ProjectRootPath }}\${{ parameters.AssemblyName }}.csproj' IncludeSymbols: true - feedsToUse: 'config' - nugetConfigPath: NuGet.config verbosityPack: normal packDirectory: arguments: '--configuration ${{ parameters.BuildConfiguration }}' diff --git a/build/template-restore-build-MSIdentityWeb.yaml b/build/template-restore-build-MSIdentityWeb.yaml index 05dd3fa0f..d4bfd7814 100644 --- a/build/template-restore-build-MSIdentityWeb.yaml +++ b/build/template-restore-build-MSIdentityWeb.yaml @@ -11,13 +11,14 @@ steps: dotnet workload restore $(IdWebSourceDir)tests\DevApps\blazorwasm-b2c\blazorwasm2-b2c.csproj displayName: 'Install wasm-tools' -- task: NuGetAuthenticate@1 - displayName: NuGet Authenticate - inputs: - nuGetServiceConnections: 'IDDP Feed' - -- script: dotnet nuget update source NuGet --source https://identitydivision.pkgs.visualstudio.com/_packaging/IDDP/nuget/v3/index.json --configfile "$(Build.SourcesDirectory)\Nuget.config" - displayName: 'Add NuGet Source for MISE' +- powershell: | + $nugetSourceIsExternal = (dotnet nuget list source --format Short).Contains("https://api.nuget.org/v3/index.json") + if ($nugetSourceIsExternal) { + dotnet nuget remove source NuGet + dotnet nuget add source https://identitydivision.pkgs.visualstudio.com/_packaging/IDDP/nuget/v3/index.json -n IDDP + dotnet nuget list source + } + displayName: 'Remove external "NuGet" Source and add "IDDP artifacts" as a NuGet Source, if needed.' - task: DotNetCoreCLI@2 displayName: 'Build solution Microsoft.Identity.Web.sln' @@ -25,8 +26,6 @@ steps: command: 'custom' custom: 'build' projects: '$(IdWebSourceDir)Microsoft.Identity.Web.sln' - feedsToUse: 'config' - nugetConfigPath: NuGet.config arguments: '-p:configuration=${{ parameters.BuildConfiguration }} -p:RunCodeAnalysis=true -p:MicrosoftIdentityWebVersion=${{ parameters.MicrosoftIdentityWebVersion }} -p:SourceLinkCreate=true' # This task is needed so that the 1CS Rolsyn analyzers task works.