Debian Codegraph @

external/linker/eng/common/templates/phases/base.yml

raw
1 parameters:
2 # Optional: Clean sources before building
3 clean: true
4
5 # Optional: Git fetch depth
6 fetchDepth: ''
7
8 # Optional: name of the phase (not specifying phase name may cause name collisions)
9 name: ''
10 # Optional: display name of the phase
11 displayName: ''
12
13 # Optional: condition for the job to run
14 condition: ''
15
16 # Optional: dependencies of the phase
17 dependsOn: ''
18
19 # Required: A defined YAML queue
20 queue: {}
21
22 # Required: build steps
23 steps: []
24
25 # Optional: variables
26 variables: {}
27
28 # Optional: should run as a public build even in the internal project
29 # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects.
30 runAsPublic: false
31
32 ## Telemetry variables
33
34 # Optional: enable sending telemetry
35 # if 'true', these "variables" must be specified in the variables object or as part of the queue matrix
36 # _HelixBuildConfig - differentiate between Debug, Release, other
37 # _HelixSource - Example: build/product
38 # _HelixType - Example: official/dotnet/arcade/$(Build.SourceBranch)
39 enableTelemetry: false
40
41 # Optional: Enable installing Microbuild plugin
42 # if 'true', these "variables" must be specified in the variables object or as part of the queue matrix
43 # _TeamName - the name of your team
44 # _SignType - 'test' or 'real'
45 enableMicrobuild: false
46
47 # Internal resources (telemetry, microbuild) can only be accessed from non-public projects,
48 # and some (Microbuild) should only be applied to non-PR cases for internal builds.
49
50 phases:
51 - phase: ${{ parameters.name }}
52
53 ${{ if ne(parameters.displayName, '') }}:
54 displayName: ${{ parameters.displayName }}
55
56 ${{ if ne(parameters.condition, '') }}:
57 condition: ${{ parameters.condition }}
58
59 ${{ if ne(parameters.dependsOn, '') }}:
60 dependsOn: ${{ parameters.dependsOn }}
61
62 queue: ${{ parameters.queue }}
63
64 ${{ if ne(parameters.variables, '') }}:
65 variables:
66 ${{ insert }}: ${{ parameters.variables }}
67
68 steps:
69 - checkout: self
70 clean: ${{ parameters.clean }}
71 ${{ if ne(parameters.fetchDepth, '') }}:
72 fetchDepth: ${{ parameters.fetchDepth }}
73
74 - ${{ if eq(parameters.enableTelemetry, 'true') }}:
75 - template: /eng/common/templates/steps/telemetry-start.yml
76 parameters:
77 buildConfig: $(_HelixBuildConfig)
78 helixSource: $(_HelixSource)
79 helixType: $(_HelixType)
80 runAsPublic: ${{ parameters.runAsPublic }}
81
82 - ${{ if eq(parameters.enableMicrobuild, 'true') }}:
83 # Internal only resource, and Microbuild signing shouldn't be applied to PRs.
84 - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
85 - task: MicroBuildSigningPlugin@2
86 displayName: Install MicroBuild plugin
87 inputs:
88 signType: $(_SignType)
89 zipSources: false
90 feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
91
92 env:
93 TeamName: $(_TeamName)
94 continueOnError: false
95 condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
96
97 # Run provided build steps
98 - ${{ parameters.steps }}
99
100 - ${{ if eq(parameters.enableMicrobuild, 'true') }}:
101 # Internal only resources
102 - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
103 - task: MicroBuildCleanup@1
104 displayName: Execute Microbuild cleanup tasks
105 condition: and(always(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT'))
106 env:
107 TeamName: $(_TeamName)
108
109 - ${{ if eq(parameters.enableTelemetry, 'true') }}:
110 - template: /eng/common/templates/steps/telemetry-end.yml
111 parameters:
112 helixSource: $(_HelixSource)
113 helixType: $(_HelixType)
114
115 - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
116 - task: CopyFiles@2
117 displayName: Gather Asset Manifests
118 inputs:
119 SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest'
120 TargetFolder: '$(Build.StagingDirectory)/AssetManifests'
121 continueOnError: false
122 condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
123 - task: PublishBuildArtifacts@1
124 displayName: Push Asset Manifests
125 inputs:
126 PathtoPublish: '$(Build.StagingDirectory)/AssetManifests'
127 PublishLocation: Container
128 ArtifactName: AssetManifests
129 continueOnError: false
130 condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))