@@ -24,7 +24,7 @@ parameters:
24
24
enablePublishBuildAssets : false
25
25
enablePublishTestResults : false
26
26
enablePublishUsingPipelines : false
27
- disableComponentGovernance : false
27
+ disableComponentGovernance : ' '
28
28
mergeTestResults : false
29
29
testRunTitle : ' '
30
30
testResultsFormat : ' '
73
73
- ${{ if eq(parameters.enableRichCodeNavigation, 'true') }} :
74
74
- name : EnableRichCodeNavigation
75
75
value : ' true'
76
+ # Retry signature validation up to three times, waiting 2 seconds between attempts.
77
+ # See https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu3028#retry-untrusted-root-failures
78
+ - name : NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY
79
+ value : 3,2000
76
80
- ${{ each variable in parameters.variables }} :
77
81
# handle name-value variable syntax
78
82
# example:
81
85
- ${{ if ne(variable.name, '') }} :
82
86
- name : ${{ variable.name }}
83
87
value : ${{ variable.value }}
84
-
88
+
85
89
# handle variable groups
86
90
- ${{ if ne(variable.group, '') }} :
87
91
- group : ${{ variable.group }}
@@ -141,14 +145,20 @@ jobs:
141
145
richNavLogOutputDirectory : $(Build.SourcesDirectory)/artifacts/bin
142
146
continueOnError : true
143
147
144
- - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), ne(parameters.disableComponentGovernance, 'true')) }} :
145
- - task : ComponentGovernanceComponentDetection@0
146
- continueOnError : true
148
+ - template : /eng/common/templates/steps/component-governance.yml
149
+ parameters :
150
+ ${{ if eq(parameters.disableComponentGovernance, '') }} :
151
+ ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.runAsPublic, 'false'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dotnet/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/microsoft/'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }} :
152
+ disableComponentGovernance : false
153
+ ${{ else }} :
154
+ disableComponentGovernance : true
155
+ ${{ else }} :
156
+ disableComponentGovernance : ${{ parameters.disableComponentGovernance }}
147
157
148
158
- ${{ if eq(parameters.enableMicrobuild, 'true') }} :
149
159
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }} :
150
160
- task : MicroBuildCleanup@1
151
- displayName : Execute Microbuild cleanup tasks
161
+ displayName : Execute Microbuild cleanup tasks
152
162
condition : and(always(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
153
163
continueOnError : ${{ parameters.continueOnError }}
154
164
env :
@@ -216,7 +226,7 @@ jobs:
216
226
displayName : Publish XUnit Test Results
217
227
inputs :
218
228
testResultsFormat : ' xUnit'
219
- testResultsFiles : ' *.xml'
229
+ testResultsFiles : ' *.xml'
220
230
searchFolder : ' $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
221
231
testRunTitle : ${{ coalesce(parameters.testRunTitle, parameters.name, '$(System.JobName)') }}-xunit
222
232
mergeTestResults : ${{ parameters.mergeTestResults }}
@@ -227,7 +237,7 @@ jobs:
227
237
displayName : Publish TRX Test Results
228
238
inputs :
229
239
testResultsFormat : ' VSTest'
230
- testResultsFiles : ' *.trx'
240
+ testResultsFiles : ' *.trx'
231
241
searchFolder : ' $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
232
242
testRunTitle : ${{ coalesce(parameters.testRunTitle, parameters.name, '$(System.JobName)') }}-trx
233
243
mergeTestResults : ${{ parameters.mergeTestResults }}
0 commit comments