@@ -24,7 +24,7 @@ parameters:
2424 enablePublishBuildAssets : false
2525 enablePublishTestResults : false
2626 enablePublishUsingPipelines : false
27- disableComponentGovernance : false
27+ disableComponentGovernance : ' '
2828 mergeTestResults : false
2929 testRunTitle : ' '
3030 testResultsFormat : ' '
7373 - ${{ if eq(parameters.enableRichCodeNavigation, 'true') }} :
7474 - name : EnableRichCodeNavigation
7575 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
7680 - ${{ each variable in parameters.variables }} :
7781 # handle name-value variable syntax
7882 # example:
8185 - ${{ if ne(variable.name, '') }} :
8286 - name : ${{ variable.name }}
8387 value : ${{ variable.value }}
84-
88+
8589 # handle variable groups
8690 - ${{ if ne(variable.group, '') }} :
8791 - group : ${{ variable.group }}
@@ -142,14 +146,20 @@ jobs:
142146 richNavLogOutputDirectory : $(Build.SourcesDirectory)/artifacts/bin
143147 continueOnError : true
144148
145- - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), ne(parameters.disableComponentGovernance, 'true')) }} :
146- - task : ComponentGovernanceComponentDetection@0
147- continueOnError : true
149+ - template : /eng/common/templates/steps/component-governance.yml
150+ parameters :
151+ ${{ if eq(parameters.disableComponentGovernance, '') }} :
152+ ${{ 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'))) }} :
153+ disableComponentGovernance : false
154+ ${{ else }} :
155+ disableComponentGovernance : true
156+ ${{ else }} :
157+ disableComponentGovernance : ${{ parameters.disableComponentGovernance }}
148158
149159 - ${{ if eq(parameters.enableMicrobuild, 'true') }} :
150160 - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }} :
151161 - task : MicroBuildCleanup@1
152- displayName : Execute Microbuild cleanup tasks
162+ displayName : Execute Microbuild cleanup tasks
153163 condition : and(always(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
154164 continueOnError : ${{ parameters.continueOnError }}
155165 env :
@@ -217,7 +227,7 @@ jobs:
217227 displayName : Publish XUnit Test Results
218228 inputs :
219229 testResultsFormat : ' xUnit'
220- testResultsFiles : ' *.xml'
230+ testResultsFiles : ' *.xml'
221231 searchFolder : ' $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
222232 testRunTitle : ${{ coalesce(parameters.testRunTitle, parameters.name, '$(System.JobName)') }}-xunit
223233 mergeTestResults : ${{ parameters.mergeTestResults }}
@@ -228,7 +238,7 @@ jobs:
228238 displayName : Publish TRX Test Results
229239 inputs :
230240 testResultsFormat : ' VSTest'
231- testResultsFiles : ' *.trx'
241+ testResultsFiles : ' *.trx'
232242 searchFolder : ' $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
233243 testRunTitle : ${{ coalesce(parameters.testRunTitle, parameters.name, '$(System.JobName)') }}-trx
234244 mergeTestResults : ${{ parameters.mergeTestResults }}
0 commit comments