Skip to content

Commit 03ed475

Browse files
authored
Add files missing in arcade update (#4376)
Add missing files in arcade update
1 parent 05bcc90 commit 03ed475

27 files changed

+2078
-0
lines changed
Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
parameters:
2+
# Job schema parameters - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job
3+
cancelTimeoutInMinutes: ''
4+
condition: ''
5+
container: ''
6+
continueOnError: false
7+
dependsOn: ''
8+
displayName: ''
9+
pool: ''
10+
steps: []
11+
strategy: ''
12+
timeoutInMinutes: ''
13+
variables: []
14+
workspace: ''
15+
templateContext: {}
16+
17+
# Job base template specific parameters
18+
# See schema documentation - https://github.com/dotnet/arcade/blob/master/Documentation/AzureDevOps/TemplateSchema.md
19+
# publishing defaults
20+
artifacts: ''
21+
enableMicrobuild: false
22+
enablePublishBuildArtifacts: false
23+
enablePublishBuildAssets: false
24+
enablePublishTestResults: false
25+
enablePublishUsingPipelines: false
26+
enableBuildRetry: false
27+
disableComponentGovernance: ''
28+
componentGovernanceIgnoreDirectories: ''
29+
mergeTestResults: false
30+
testRunTitle: ''
31+
testResultsFormat: ''
32+
name: ''
33+
preSteps: []
34+
artifactPublishSteps: []
35+
runAsPublic: false
36+
37+
# Sbom related params
38+
enableSbom: true
39+
PackageVersion: 9.0.0
40+
BuildDropPath: '$(Build.SourcesDirectory)/artifacts'
41+
42+
# 1es specific parameters
43+
is1ESPipeline: ''
44+
45+
jobs:
46+
- job: ${{ parameters.name }}
47+
48+
${{ if ne(parameters.cancelTimeoutInMinutes, '') }}:
49+
cancelTimeoutInMinutes: ${{ parameters.cancelTimeoutInMinutes }}
50+
51+
${{ if ne(parameters.condition, '') }}:
52+
condition: ${{ parameters.condition }}
53+
54+
${{ if ne(parameters.container, '') }}:
55+
container: ${{ parameters.container }}
56+
57+
${{ if ne(parameters.continueOnError, '') }}:
58+
continueOnError: ${{ parameters.continueOnError }}
59+
60+
${{ if ne(parameters.dependsOn, '') }}:
61+
dependsOn: ${{ parameters.dependsOn }}
62+
63+
${{ if ne(parameters.displayName, '') }}:
64+
displayName: ${{ parameters.displayName }}
65+
66+
${{ if ne(parameters.pool, '') }}:
67+
pool: ${{ parameters.pool }}
68+
69+
${{ if ne(parameters.strategy, '') }}:
70+
strategy: ${{ parameters.strategy }}
71+
72+
${{ if ne(parameters.timeoutInMinutes, '') }}:
73+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
74+
75+
${{ if ne(parameters.templateContext, '') }}:
76+
templateContext: ${{ parameters.templateContext }}
77+
78+
variables:
79+
- ${{ if ne(parameters.enableTelemetry, 'false') }}:
80+
- name: DOTNET_CLI_TELEMETRY_PROFILE
81+
value: '$(Build.Repository.Uri)'
82+
- ${{ if eq(parameters.enableRichCodeNavigation, 'true') }}:
83+
- name: EnableRichCodeNavigation
84+
value: 'true'
85+
# Retry signature validation up to three times, waiting 2 seconds between attempts.
86+
# See https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu3028#retry-untrusted-root-failures
87+
- name: NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY
88+
value: 3,2000
89+
- ${{ each variable in parameters.variables }}:
90+
# handle name-value variable syntax
91+
# example:
92+
# - name: [key]
93+
# value: [value]
94+
- ${{ if ne(variable.name, '') }}:
95+
- name: ${{ variable.name }}
96+
value: ${{ variable.value }}
97+
98+
# handle variable groups
99+
- ${{ if ne(variable.group, '') }}:
100+
- group: ${{ variable.group }}
101+
102+
# handle template variable syntax
103+
# example:
104+
# - template: path/to/template.yml
105+
# parameters:
106+
# [key]: [value]
107+
- ${{ if ne(variable.template, '') }}:
108+
- template: ${{ variable.template }}
109+
${{ if ne(variable.parameters, '') }}:
110+
parameters: ${{ variable.parameters }}
111+
112+
# handle key-value variable syntax.
113+
# example:
114+
# - [key]: [value]
115+
- ${{ if and(eq(variable.name, ''), eq(variable.group, ''), eq(variable.template, '')) }}:
116+
- ${{ each pair in variable }}:
117+
- name: ${{ pair.key }}
118+
value: ${{ pair.value }}
119+
120+
# DotNet-HelixApi-Access provides 'HelixApiAccessToken' for internal builds
121+
- ${{ if and(eq(parameters.enableTelemetry, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
122+
- group: DotNet-HelixApi-Access
123+
124+
${{ if ne(parameters.workspace, '') }}:
125+
workspace: ${{ parameters.workspace }}
126+
127+
steps:
128+
- ${{ if eq(parameters.is1ESPipeline, '') }}:
129+
- 'Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder.': error
130+
131+
- ${{ if ne(parameters.preSteps, '') }}:
132+
- ${{ each preStep in parameters.preSteps }}:
133+
- ${{ preStep }}
134+
135+
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
136+
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
137+
- task: MicroBuildSigningPlugin@4
138+
displayName: Install MicroBuild plugin
139+
inputs:
140+
signType: $(_SignType)
141+
zipSources: false
142+
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
143+
env:
144+
TeamName: $(_TeamName)
145+
MicroBuildOutputFolderOverride: '$(Agent.TempDirectory)'
146+
continueOnError: ${{ parameters.continueOnError }}
147+
condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
148+
149+
- ${{ if and(eq(parameters.runAsPublic, 'false'), eq(variables['System.TeamProject'], 'internal')) }}:
150+
- task: NuGetAuthenticate@1
151+
152+
- ${{ if and(ne(parameters.artifacts.download, 'false'), ne(parameters.artifacts.download, '')) }}:
153+
- task: DownloadPipelineArtifact@2
154+
inputs:
155+
buildType: current
156+
artifactName: ${{ coalesce(parameters.artifacts.download.name, 'Artifacts_$(Agent.OS)_$(_BuildConfig)') }}
157+
targetPath: ${{ coalesce(parameters.artifacts.download.path, 'artifacts') }}
158+
itemPattern: ${{ coalesce(parameters.artifacts.download.pattern, '**') }}
159+
160+
- ${{ each step in parameters.steps }}:
161+
- ${{ step }}
162+
163+
- ${{ if eq(parameters.enableRichCodeNavigation, true) }}:
164+
- task: RichCodeNavIndexer@0
165+
displayName: RichCodeNav Upload
166+
inputs:
167+
languages: ${{ coalesce(parameters.richCodeNavigationLanguage, 'csharp') }}
168+
environment: ${{ coalesce(parameters.richCodeNavigationEnvironment, 'internal') }}
169+
richNavLogOutputDirectory: $(Build.SourcesDirectory)/artifacts/bin
170+
uploadRichNavArtifacts: ${{ coalesce(parameters.richCodeNavigationUploadArtifacts, false) }}
171+
continueOnError: true
172+
173+
- template: /eng/common/core-templates/steps/component-governance.yml
174+
parameters:
175+
is1ESPipeline: ${{ parameters.is1ESPipeline }}
176+
${{ if eq(parameters.disableComponentGovernance, '') }}:
177+
${{ 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'))) }}:
178+
disableComponentGovernance: false
179+
${{ else }}:
180+
disableComponentGovernance: true
181+
${{ else }}:
182+
disableComponentGovernance: ${{ parameters.disableComponentGovernance }}
183+
componentGovernanceIgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
184+
185+
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
186+
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
187+
- task: MicroBuildCleanup@1
188+
displayName: Execute Microbuild cleanup tasks
189+
condition: and(always(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
190+
continueOnError: ${{ parameters.continueOnError }}
191+
env:
192+
TeamName: $(_TeamName)
193+
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}:
194+
- template: /eng/common/core-templates/steps/generate-sbom.yml
195+
parameters:
196+
is1ESPipeline: ${{ parameters.is1ESPipeline }}
197+
PackageVersion: ${{ parameters.packageVersion}}
198+
BuildDropPath: ${{ parameters.buildDropPath }}
199+
IgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }}
200+
publishArtifacts: false
201+
202+
# Publish test results
203+
- ${{ if and(eq(parameters.enablePublishTestResults, 'true'), eq(parameters.testResultsFormat, '')) }}:
204+
- ${{ if eq(parameters.testResultsFormat, 'xunit') }}:
205+
- task: PublishTestResults@2
206+
displayName: Publish XUnit Test Results
207+
inputs:
208+
testResultsFormat: 'xUnit'
209+
testResultsFiles: '*.xml'
210+
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
211+
testRunTitle: ${{ coalesce(parameters.testRunTitle, parameters.name, '$(System.JobName)') }}-xunit
212+
mergeTestResults: ${{ parameters.mergeTestResults }}
213+
continueOnError: true
214+
condition: always()
215+
- ${{ if eq(parameters.testResultsFormat, 'vstest') }}:
216+
- task: PublishTestResults@2
217+
displayName: Publish TRX Test Results
218+
inputs:
219+
testResultsFormat: 'VSTest'
220+
testResultsFiles: '*.trx'
221+
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
222+
testRunTitle: ${{ coalesce(parameters.testRunTitle, parameters.name, '$(System.JobName)') }}-trx
223+
mergeTestResults: ${{ parameters.mergeTestResults }}
224+
continueOnError: true
225+
condition: always()
226+
227+
# gather artifacts
228+
- ${{ if ne(parameters.artifacts.publish, '') }}:
229+
- ${{ if and(ne(parameters.artifacts.publish.artifacts, 'false'), ne(parameters.artifacts.publish.artifacts, '')) }}:
230+
- task: CopyFiles@2
231+
displayName: Gather binaries for publish to artifacts
232+
inputs:
233+
SourceFolder: 'artifacts/bin'
234+
Contents: '**'
235+
TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/bin'
236+
- task: CopyFiles@2
237+
displayName: Gather packages for publish to artifacts
238+
inputs:
239+
SourceFolder: 'artifacts/packages'
240+
Contents: '**'
241+
TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/packages'
242+
- ${{ if and(ne(parameters.artifacts.publish.logs, 'false'), ne(parameters.artifacts.publish.logs, '')) }}:
243+
- task: CopyFiles@2
244+
displayName: Gather logs for publish to artifacts
245+
inputs:
246+
SourceFolder: 'artifacts/log'
247+
Contents: '**'
248+
TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/log'
249+
250+
- ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}:
251+
- task: CopyFiles@2
252+
displayName: Gather logs for publish to artifacts
253+
inputs:
254+
SourceFolder: 'artifacts/log/$(_BuildConfig)'
255+
Contents: '**'
256+
TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/log/$(_BuildConfig)'
257+
- ${{ if eq(parameters.enableBuildRetry, 'true') }}:
258+
- task: CopyFiles@2
259+
displayName: Gather buildconfiguration for build retry
260+
inputs:
261+
SourceFolder: '$(Build.SourcesDirectory)/eng/common/BuildConfiguration'
262+
Contents: '**'
263+
TargetFolder: '$(Build.ArtifactStagingDirectory)/eng/common/BuildConfiguration'
264+
265+
- ${{ each step in parameters.artifactPublishSteps }}:
266+
- ${{ step }}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
parameters:
2+
# Optional: dependencies of the job
3+
dependsOn: ''
4+
5+
# Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool
6+
pool: ''
7+
8+
CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex
9+
GithubPat: $(BotAccount-dotnet-bot-repo-PAT)
10+
11+
SourcesDirectory: $(Build.SourcesDirectory)
12+
CreatePr: true
13+
AutoCompletePr: false
14+
ReusePr: true
15+
UseLfLineEndings: true
16+
UseCheckedInLocProjectJson: false
17+
SkipLocProjectJsonGeneration: false
18+
LanguageSet: VS_Main_Languages
19+
LclSource: lclFilesInRepo
20+
LclPackageId: ''
21+
RepoType: gitHub
22+
GitHubOrg: dotnet
23+
MirrorRepo: ''
24+
MirrorBranch: main
25+
condition: ''
26+
JobNameSuffix: ''
27+
is1ESPipeline: ''
28+
jobs:
29+
- job: OneLocBuild${{ parameters.JobNameSuffix }}
30+
31+
dependsOn: ${{ parameters.dependsOn }}
32+
33+
displayName: OneLocBuild${{ parameters.JobNameSuffix }}
34+
35+
variables:
36+
- group: OneLocBuildVariables # Contains the CeapexPat and GithubPat
37+
- name: _GenerateLocProjectArguments
38+
value: -SourcesDirectory ${{ parameters.SourcesDirectory }}
39+
-LanguageSet "${{ parameters.LanguageSet }}"
40+
-CreateNeutralXlfs
41+
- ${{ if eq(parameters.UseCheckedInLocProjectJson, 'true') }}:
42+
- name: _GenerateLocProjectArguments
43+
value: ${{ variables._GenerateLocProjectArguments }} -UseCheckedInLocProjectJson
44+
- template: /eng/common/core-templates/variables/pool-providers.yml
45+
parameters:
46+
is1ESPipeline: ${{ parameters.is1ESPipeline }}
47+
48+
${{ if ne(parameters.pool, '') }}:
49+
pool: ${{ parameters.pool }}
50+
${{ if eq(parameters.pool, '') }}:
51+
pool:
52+
# We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
53+
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
54+
name: AzurePipelines-EO
55+
image: 1ESPT-Windows2022
56+
demands: Cmd
57+
os: windows
58+
# If it's not devdiv, it's dnceng
59+
${{ if ne(variables['System.TeamProject'], 'DevDiv') }}:
60+
name: $(DncEngInternalBuildPool)
61+
image: 1es-windows-2022
62+
os: windows
63+
64+
steps:
65+
- ${{ if eq(parameters.is1ESPipeline, '') }}:
66+
- 'Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder.': error
67+
68+
- ${{ if ne(parameters.SkipLocProjectJsonGeneration, 'true') }}:
69+
- task: Powershell@2
70+
inputs:
71+
filePath: $(Build.SourcesDirectory)/eng/common/generate-locproject.ps1
72+
arguments: $(_GenerateLocProjectArguments)
73+
displayName: Generate LocProject.json
74+
condition: ${{ parameters.condition }}
75+
76+
- task: OneLocBuild@2
77+
displayName: OneLocBuild
78+
env:
79+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
80+
inputs:
81+
locProj: eng/Localize/LocProject.json
82+
outDir: $(Build.ArtifactStagingDirectory)
83+
lclSource: ${{ parameters.LclSource }}
84+
lclPackageId: ${{ parameters.LclPackageId }}
85+
isCreatePrSelected: ${{ parameters.CreatePr }}
86+
isAutoCompletePrSelected: ${{ parameters.AutoCompletePr }}
87+
${{ if eq(parameters.CreatePr, true) }}:
88+
isUseLfLineEndingsSelected: ${{ parameters.UseLfLineEndings }}
89+
${{ if eq(parameters.RepoType, 'gitHub') }}:
90+
isShouldReusePrSelected: ${{ parameters.ReusePr }}
91+
packageSourceAuth: patAuth
92+
patVariable: ${{ parameters.CeapexPat }}
93+
${{ if eq(parameters.RepoType, 'gitHub') }}:
94+
repoType: ${{ parameters.RepoType }}
95+
gitHubPatVariable: "${{ parameters.GithubPat }}"
96+
${{ if ne(parameters.MirrorRepo, '') }}:
97+
isMirrorRepoSelected: true
98+
gitHubOrganization: ${{ parameters.GitHubOrg }}
99+
mirrorRepo: ${{ parameters.MirrorRepo }}
100+
mirrorBranch: ${{ parameters.MirrorBranch }}
101+
condition: ${{ parameters.condition }}
102+
103+
- template: /eng/common/core-templates/steps/publish-build-artifacts.yml
104+
parameters:
105+
is1ESPipeline: ${{ parameters.is1ESPipeline }}
106+
args:
107+
displayName: Publish Localization Files
108+
pathToPublish: '$(Build.ArtifactStagingDirectory)/loc'
109+
publishLocation: Container
110+
artifactName: Loc
111+
condition: ${{ parameters.condition }}
112+
113+
- template: /eng/common/core-templates/steps/publish-build-artifacts.yml
114+
parameters:
115+
is1ESPipeline: ${{ parameters.is1ESPipeline }}
116+
args:
117+
displayName: Publish LocProject.json
118+
pathToPublish: '$(Build.SourcesDirectory)/eng/Localize/'
119+
publishLocation: Container
120+
artifactName: Loc
121+
condition: ${{ parameters.condition }}

0 commit comments

Comments
 (0)