Skip to content

Commit

Permalink
Update NuGet to point to Azure Artifacts. (#658) (#683)
Browse files Browse the repository at this point in the history
* Update NuGet to point to Azure Artifacts. (#658)

* Update NuGet to point to Azure Artifacts.

* Update docker reference.

* Reroute dotnet tool to public NuGet.

* Update nbgv-set-version-steps.yml

* Change the other nbgv to update too.

Co-authored-by: David Alcantar <50344095+daalcant@users.noreply.github.com>

* Fix Test job

Co-authored-by: Michael Scovetta <michael.scovetta@microsoft.com>
Co-authored-by: David Alcantar <50344095+daalcant@users.noreply.github.com>
  • Loading branch information
3 people committed Jan 6, 2023
1 parent f08478a commit f1fa334
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 6 deletions.
7 changes: 7 additions & 0 deletions NuGet.Config.AzureArtifacts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="PublicRegistriesFeed" value="https://twcsecurityassurance.pkgs.visualstudio.com/SecurityEngineering/_packaging/PublicRegistriesFeed/nuget/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion NuGet.Config → NuGet.Config.Public
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
4 changes: 2 additions & 2 deletions Pipelines/core-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ stages:
inputs:
packageType: 'sdk'
version: '${{ variables.CurrentSDK }}'
- script: 'dotnet tool update -g nbgv'
displayName: 'Install GitVersioning'
- script: 'dotnet tool update -g nbgv --configfile NuGet.Config.Public'
displayName: 'Update GitVersioning'
- task: PowerShell@2
displayName: Set Release Version
inputs:
Expand Down
3 changes: 3 additions & 0 deletions Pipelines/templates/dotnet-publish-linux-mac-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NuGetAuthenticate@1
- task: UseDotNet@2
displayName: Install Dotnet SDK
inputs:
Expand All @@ -60,6 +61,8 @@ jobs:
displayName: Restore
inputs:
command: 'restore'
feedsToUse: config
nugetConfigPath: NuGet.Config.AzureArtifacts
projects: ${{ parameters.projectPath }}
verbosityRestore: 'Normal'
- task: DotNetCoreCLI@2
Expand Down
3 changes: 3 additions & 0 deletions Pipelines/templates/dotnet-publish-win-netcore-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
pool:
vmImage: 'windows-latest'
steps:
- task: NuGetAuthenticate@1
- task: UseDotNet@2
displayName: Install Dotnet SDK
inputs:
Expand All @@ -60,6 +61,8 @@ jobs:
displayName: Restore
inputs:
command: 'restore'
feedsToUse: config
nugetConfigPath: NuGet.Config.AzureArtifacts
projects: ${{ parameters.projectPath }}
verbosityRestore: 'Normal'
- task: DotNetCoreCLI@2
Expand Down
11 changes: 10 additions & 1 deletion Pipelines/templates/dotnet-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
pool:
vmImage: 'windows-latest'
steps:
- task: NuGetAuthenticate@1
- task: UseDotNet@2
displayName: Install Dotnet SDK
inputs:
Expand All @@ -36,8 +37,16 @@ jobs:
inputs:
packageType: 'sdk'
version: ${{ parameters.dotnetVersionLTS }}
- task: DotNetCoreCLI@2
displayName: Dotnet Restore
inputs:
command: 'restore'
feedsToUse: config
nugetConfigPath: NuGet.Config.AzureArtifacts
projects: ${{ parameters.projectPath }}
verbosityRestore: 'Normal'
- task: DotNetCoreCLI@2
displayName: Dotnet Test
inputs:
command: 'test'
projects: ${{ parameters.projectPath }}
projects: ${{ parameters.projectPath }}
4 changes: 2 additions & 2 deletions Pipelines/templates/nbgv-set-version-steps.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
steps:
- script: 'dotnet tool update -g nbgv'
displayName: 'Install GitVersioning'
- script: 'dotnet tool update -g nbgv --configfile NuGet.Config.Public'
displayName: 'Update GitVersioning'
- task: PowerShell@2
displayName: Set Release Version
inputs:
Expand Down
3 changes: 3 additions & 0 deletions Pipelines/templates/nuget-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
vmImage: 'windows-latest'
steps:
- task: CodeQL3000Init@0
- task: NuGetAuthenticate@1
- task: UseDotNet@2
displayName: Install Dotnet SDK
inputs:
Expand All @@ -55,6 +56,8 @@ jobs:
displayName: Dotnet Restore
inputs:
command: 'restore'
feedsToUse: config
nugetConfigPath: NuGet.Config.AzureArtifacts
projects: ${{ parameters.projectPath }}
verbosityRestore: 'Normal'
- task: DotNetCoreCLI@2
Expand Down

0 comments on commit f1fa334

Please sign in to comment.