Skip to content

Commit 2b7e955

Browse files
authored
Configure Pipelines to use Nuget.Config (#507)
* Create nuget.config.azure * Configure Pipeline to use Nuget.Config
1 parent 72697df commit 2b7e955

3 files changed

Lines changed: 54 additions & 2 deletions

File tree

Pipelines/core-pipeline.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resources:
77
- repository: templates
88
type: git
99
name: Data/OSS-Tools-Pipeline-Templates
10-
ref: refs/tags/v2.0.0
10+
ref: refs/tags/v2.0.4
1111
- repository: 1esPipelines
1212
type: git
1313
name: 1ESPipelineTemplates/1ESPipelineTemplates
@@ -40,6 +40,11 @@ extends:
4040
poolImage: MSSecurity-1ES-Windows-2022
4141
poolOs: windows
4242
projectPath: 'src/oss-tests/oss-tests.csproj'
43+
includeNuGetOrg: false
44+
nugetFeedsToUse: 'config'
45+
nugetConfigPath: 'nuget.config.azure'
46+
onInit:
47+
- task: NuGetAuthenticate@1
4348

4449
- stage: Build
4550
dependsOn:
@@ -53,6 +58,11 @@ extends:
5358
projectName: 'oss-gadget-cli'
5459
exePath: 'ossgadget'
5560
artifactName: 'linux-mac-archive'
61+
includeNuGetOrg: false
62+
nugetFeedsToUse: 'config'
63+
nugetConfigPath: 'nuget.config.azure'
64+
onInit:
65+
- task: NuGetAuthenticate@1
5666
preBuild:
5767
- template: nbgv-set-version-steps.yml@templates
5868
- template: dotnet-publish-win-netcore-job.yml@templates
@@ -62,6 +72,11 @@ extends:
6272
projectPath: 'src/OSSGadget.sln'
6373
projectName: 'oss-gadget-cli'
6474
artifactName: 'win-netcore-archive'
75+
includeNuGetOrg: false
76+
nugetFeedsToUse: 'config'
77+
nugetConfigPath: 'nuget.config.azure'
78+
onInit:
79+
- task: NuGetAuthenticate@1
6580
preBuild:
6681
- template: nbgv-set-version-steps.yml@templates
6782
- template: nuget-build-job.yml@templates
@@ -72,6 +87,11 @@ extends:
7287
projectPath: 'src/oss-find-squats-lib/oss-find-squats-lib.csproj'
7388
projectName: 'oss-find-squats-lib'
7489
artifactName: 'nuget-find-squats-lib-archive'
90+
includeNuGetOrg: false
91+
nugetFeedsToUse: 'config'
92+
nugetConfigPath: 'nuget.config.azure'
93+
onInit:
94+
- task: NuGetAuthenticate@1
7595
preBuild:
7696
- template: nbgv-set-version-steps.yml@templates
7797
- template: nuget-build-job.yml@templates
@@ -82,6 +102,11 @@ extends:
82102
projectPath: 'src/Shared/Shared.Lib.csproj'
83103
projectName: 'Shared.Lib'
84104
artifactName: 'nuget-shared-lib-archive'
105+
includeNuGetOrg: false
106+
nugetFeedsToUse: 'config'
107+
nugetConfigPath: 'nuget.config.azure'
108+
onInit:
109+
- task: NuGetAuthenticate@1
85110
preBuild:
86111
- template: nbgv-set-version-steps.yml@templates
87112
- template: nuget-build-job.yml@templates
@@ -92,6 +117,11 @@ extends:
92117
projectPath: 'src/Shared.CLI/Shared.CLI.csproj'
93118
projectName: 'Shared.CLI'
94119
artifactName: 'nuget-shared-cli-archive'
120+
includeNuGetOrg: false
121+
nugetFeedsToUse: 'config'
122+
nugetConfigPath: 'nuget.config.azure'
123+
onInit:
124+
- task: NuGetAuthenticate@1
95125
preBuild:
96126
- template: nbgv-set-version-steps.yml@templates
97127
- template: nuget-build-job.yml@templates
@@ -102,6 +132,11 @@ extends:
102132
projectPath: 'src/oss-gadget-cli/oss-gadget-cli.csproj'
103133
projectName: 'oss-gadget-cli'
104134
artifactName: 'nuget-cli-archive'
135+
includeNuGetOrg: false
136+
nugetFeedsToUse: 'config'
137+
nugetConfigPath: 'nuget.config.azure'
138+
onInit:
139+
- task: NuGetAuthenticate@1
105140
preBuild:
106141
- template: nbgv-set-version-steps.yml@templates
107142

Pipelines/ossgadget-pr.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resources:
1010
- repository: templates
1111
type: git
1212
name: SecurityEngineering/OSS-Tools-Pipeline-Templates
13-
ref: refs/tags/v2.0.1
13+
ref: refs/tags/v2.0.4
1414
- repository: 1esPipelines
1515
type: git
1616
name: 1ESPipelineTemplates/1ESPipelineTemplates
@@ -38,6 +38,11 @@ extends:
3838
poolImage: MSSecurity-1ES-Windows-2022
3939
poolOs: windows
4040
projectPath: 'src/oss-tests/oss-tests.csproj'
41+
includeNuGetOrg: false
42+
nugetFeedsToUse: 'config'
43+
nugetConfigPath: 'nuget.config.azure'
44+
onInit:
45+
- task: NuGetAuthenticate@1
4146

4247
- stage: Build
4348
jobs:
@@ -53,5 +58,10 @@ extends:
5358
poolImage: MSSecurity-1ES-Windows-2022
5459
poolOs: windows
5560
artifactName: 'OSSGadget-archive'
61+
includeNuGetOrg: false
62+
nugetFeedsToUse: 'config'
63+
nugetConfigPath: 'nuget.config.azure'
64+
onInit:
65+
- task: NuGetAuthenticate@1
5666
preBuild:
5767
- template: nbgv-set-version-steps.yml@templates

nuget.config.azure

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="PublicRegistriesFeed" value="https://twcsecurityassurance.pkgs.visualstudio.com/SecurityEngineering/_packaging/PublicRegistriesFeed/nuget/v3/index.json" />
6+
</packageSources>
7+
</configuration>

0 commit comments

Comments
 (0)