Skip to content

Commit 7f8da57

Browse files
authored
Setup internal feeds in internal builds (#90637)
* Setup internal feeds in internal builds * Add 8 explicitly for now * Fix condition on mono-wasm workloads
1 parent 35b6357 commit 7f8da57

File tree

5 files changed

+63
-7
lines changed

5 files changed

+63
-7
lines changed

eng/common/SetupNugetSources.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
33
#
44
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
5-
# under <packageSourceCredentials> for each Maestro managed private feed. Two additional credential
5+
# under <packageSourceCredentials> for each Maestro managed private feed. Two additional credential
66
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
77
#
88
# This script needs to be called in every job that will restore packages and which the base repo has
@@ -37,7 +37,7 @@ Set-StrictMode -Version 2.0
3737
# Add source entry to PackageSources
3838
function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $Password) {
3939
$packageSource = $sources.SelectSingleNode("add[@key='$SourceName']")
40-
40+
4141
if ($packageSource -eq $null)
4242
{
4343
$packageSource = $doc.CreateElement("add")
@@ -48,7 +48,7 @@ function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Usern
4848
else {
4949
Write-Host "Package source $SourceName already present."
5050
}
51-
51+
5252
AddCredential -Creds $creds -Source $SourceName -Username $Username -Password $Password
5353
}
5454

@@ -89,7 +89,7 @@ function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $Passw
8989
$maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]")
9090

9191
Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds."
92-
92+
9393
ForEach ($PackageSource in $maestroPrivateSources) {
9494
Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key
9595
AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -Password $Password

eng/common/SetupNugetSources.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
55
#
66
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
7-
# under <packageSourceCredentials> for each Maestro's managed private feed. Two additional credential
7+
# under <packageSourceCredentials> for each Maestro's managed private feed. Two additional credential
88
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
99
#
1010
# This script needs to be called in every job that will restore packages and which the base repo has
@@ -68,7 +68,7 @@ if [ "$?" != "0" ]; then
6868
sed -i.bak "s|$ConfigNodeHeader|$ConfigNodeHeader${NL}$PackageSourcesTemplate|" $ConfigFile
6969
fi
7070

71-
# Ensure there is a <packageSourceCredentials>...</packageSourceCredentials> section.
71+
# Ensure there is a <packageSourceCredentials>...</packageSourceCredentials> section.
7272
grep -i "<packageSourceCredentials>" $ConfigFile
7373
if [ "$?" != "0" ]; then
7474
echo "Adding <packageSourceCredentials>...</packageSourceCredentials> section."
@@ -142,7 +142,7 @@ IFS=$PrevIFS
142142

143143
for FeedName in ${PackageSources[@]} ; do
144144
# Check if there is no existing credential for this FeedName
145-
grep -i "<$FeedName>" $ConfigFile
145+
grep -i "<$FeedName>" $ConfigFile
146146
if [ "$?" != "0" ]; then
147147
echo "Adding credentials for $FeedName."
148148

eng/pipelines/common/global-build-job.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
variables:
6969
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
7070
- group: DotNet-HelixApi-Access
71+
- group: AzureDevOps-Artifact-Feeds-Pats
7172

7273
- name: _osParameter
7374
value: -os ${{ parameters.osGroup }}
@@ -182,6 +183,24 @@ jobs:
182183
- ${{ if and(eq(parameters.isOfficialBuild, true), notin(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator')) }}:
183184
- template: /eng/pipelines/common/restore-internal-tools.yml
184185

186+
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
187+
- ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.hostedOs, 'windows')) }}:
188+
- task: Bash@3
189+
displayName: Setup Private Feeds Credentials
190+
inputs:
191+
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
192+
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
193+
env:
194+
Token: $(dn-bot-dnceng-artifact-feeds-rw)
195+
- ${{ else }}:
196+
- task: PowerShell@2
197+
displayName: Setup Private Feeds Credentials
198+
inputs:
199+
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
200+
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
201+
env:
202+
Token: $(dn-bot-dnceng-artifact-feeds-rw)
203+
185204
- ${{ each monoCrossAOTTargetOS in parameters.monoCrossAOTTargetOS }}:
186205
- task: DownloadPipelineArtifact@2
187206
displayName: Download ${{monoCrossAOTTargetOS}} AOT offset files

eng/pipelines/coreclr/templates/build-job.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,24 @@ jobs:
143143
continueOnError: false
144144
condition: and(succeeded(), in(variables['SignType'], 'real', 'test'))
145145

146+
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
147+
- ${{ if ne(parameters.osGroup, 'windows') }}:
148+
- task: Bash@3
149+
displayName: Setup Private Feeds Credentials
150+
inputs:
151+
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
152+
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
153+
env:
154+
Token: $(dn-bot-dnceng-artifact-feeds-rw)
155+
- ${{ if eq(parameters.osGroup, 'windows') }}:
156+
- task: PowerShell@2
157+
displayName: Setup Private Feeds Credentials
158+
inputs:
159+
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
160+
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
161+
env:
162+
Token: $(dn-bot-dnceng-artifact-feeds-rw)
163+
146164
- ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}:
147165
- script: |
148166
du -sh $(Build.SourcesDirectory)/*

eng/pipelines/libraries/base-job.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
variables:
5050
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
5151
- group: DotNet-HelixApi-Access
52+
- group: AzureDevOps-Artifact-Feeds-Pats
5253

5354
- _buildScriptFileName: build
5455

@@ -137,4 +138,22 @@ jobs:
137138
artifactName: '$(_runtimeArtifactName)'
138139
displayName: '$(runtimeFlavorName) build drop'
139140

141+
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
142+
- ${{ if ne(parameters.osGroup, 'windows') }}:
143+
- task: Bash@3
144+
displayName: Setup Private Feeds Credentials
145+
inputs:
146+
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
147+
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
148+
env:
149+
Token: $(dn-bot-dnceng-artifact-feeds-rw)
150+
- ${{ if eq(parameters.osGroup, 'windows') }}:
151+
- task: PowerShell@2
152+
displayName: Setup Private Feeds Credentials
153+
inputs:
154+
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
155+
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
156+
env:
157+
Token: $(dn-bot-dnceng-artifact-feeds-rw)
158+
140159
- ${{ parameters.steps }}

0 commit comments

Comments
 (0)