From 4494d847fd45d6f2d1fa1217d932ff4b773627ee Mon Sep 17 00:00:00 2001 From: Saurabh Gautam <106561208+SaurabhMSFT@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:34:13 +0100 Subject: [PATCH] Use nuget config file (#3083) --- build/template-install-dependencies.yaml | 5 +++++ build/template-pack-nuget.yaml | 2 ++ build/template-restore-build-MSIdentityWeb.yaml | 14 ++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/build/template-install-dependencies.yaml b/build/template-install-dependencies.yaml index 46be1c9d4..5f3927521 100644 --- a/build/template-install-dependencies.yaml +++ b/build/template-install-dependencies.yaml @@ -43,6 +43,11 @@ steps: azureSubscription: 'AuthSdkResourceManager' KeyVaultName: 'msidlabs' SecretsFilter: 'LabAuth' + +- task: NuGetAuthenticate@1 + displayName: NuGet Authenticate + inputs: + nuGetServiceConnections: 'IDDP Feed' - powershell: | $kvSecretBytes = [System.Convert]::FromBase64String('$(LabAuth)') diff --git a/build/template-pack-nuget.yaml b/build/template-pack-nuget.yaml index ae3881cf0..e5a09651a 100644 --- a/build/template-pack-nuget.yaml +++ b/build/template-pack-nuget.yaml @@ -16,6 +16,8 @@ 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 dbd0394fc..05dd3fa0f 100644 --- a/build/template-restore-build-MSIdentityWeb.yaml +++ b/build/template-restore-build-MSIdentityWeb.yaml @@ -11,12 +11,22 @@ 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' + - task: DotNetCoreCLI@2 displayName: 'Build solution Microsoft.Identity.Web.sln' inputs: 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. @@ -27,6 +37,8 @@ steps: inputs: command: custom custom: msbuild + feedsToUse: 'config' + nugetConfigPath: NuGet.config project: '$(IdWebSourceDir)Microsoft.Identity.Web.sln' arguments: '-p:configuration=${{ parameters.BuildConfiguration }} -p:RunCodeAnalysis=false -p:MicrosoftIdentityWebVersion=${{ parameters.MicrosoftIdentityWebVersion }} -p:SourceLinkCreate=true' @@ -37,6 +49,8 @@ steps: condition: and(succeeded(), eq(variables['PipelineType'], 'Legacy')) inputs: command: run + feedsToUse: 'config' + nugetConfigPath: NuGet.config projects: '$(IdWebSourceDir)tests\DevApps\daemon-app\Daemon-app\Daemon-app.csproj' arguments: '-f net7.0'