-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
base-job.yml
146 lines (123 loc) · 6.16 KB
/
base-job.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
parameters:
buildConfig: ''
osGroup: ''
archType: ''
osSubgroup: ''
crossBuild: false
framework: 'net9.0'
isSourceBuild: false
liveRuntimeBuildConfig: ''
runtimeFlavor: 'coreclr'
timeoutInMinutes: 150
condition: true
container: ''
steps: []
dependsOn: []
dependOnEvaluatePaths: false
disableComponentGovernance: false
variables: {}
name: ''
displayName: ''
testDisplayName: ''
testScope: ''
pool: ''
runTests: false
SuperPmiCollect: false
jobs:
- template: /eng/common/templates/job/job.yml
parameters:
displayName: ${{ format('Libraries {0} {1}{2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
name: ${{ format('libraries_{0}_{1}{2}_{3}_{4}', parameters.name, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
enableTelemetry: ${{ parameters.isOfficialBuild }} # TODO: figure out if it's needed
container: ${{ parameters.container }}
condition: and(succeeded(), ${{ parameters.condition }})
helixRepo: dotnet/runtime
pool: ${{ parameters.pool }}
# Disable component governance if requested or on musl machines where it does not work well
${{ if or(eq(parameters.disableComponentGovernance, true), eq(parameters.osSubGroup, '_musl')) }}:
disableComponentGovernance: true
variables:
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: DotNet-HelixApi-Access
- group: AzureDevOps-Artifact-Feeds-Pats
- _buildScriptFileName: build
- _msbuildCommonParameters: ''
# rename this variable, due to collision with build-native.proj
- _osArg: ''
- _finalFrameworkArg: ''
- _testModeArg: ''
- _buildScript: $(_buildScriptFileName)$(scriptExt)
- _testScopeArg: ''
- _extraHelixArguments: ''
- _crossBuildPropertyArg: ''
- _testRunNamePrefixSuffix: ''
- librariesBuildArtifactName: ${{ format('libraries_bin_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ if ne(parameters.testScope, '') }}:
- _testScopeArg: -testscope ${{ parameters.testScope }}
- ${{ if eq(parameters.crossBuild, true) }}:
- _crossBuildPropertyArg: /p:CrossBuild=true
# force a value for OS when cross-building
- ${{ if in(parameters.osGroup, 'browser', 'ios', 'tvos', 'android', 'freebsd') }}:
- _osArg: -os ${{ parameters.osGroup }}
- ${{ if ne(parameters.framework, '') }}:
- _finalFrameworkArg: -framework ${{ parameters.framework }}
- _extraHelixArguments: /p:BuildTargetFramework=${{ parameters.framework }}
- ${{ if eq(parameters.isOfficialBuild, true) }}:
- _msbuildCommonParameters: /p:OfficialBuildId=$(Build.BuildNumber)
- _runtimeArtifactName: ''
- _runtimeDownloadPath: ''
- _runtimeArtifactsPathArg: ''
- _runtimeConfigurationArg: ''
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- _runtimeDownloadPath: '$(Build.SourcesDirectory)/artifacts/transport/${{ parameters.runtimeFlavor }}'
- _runtimeConfigurationArg: -rc ${{ parameters.liveRuntimeBuildConfig }}
- ${{ if eq(parameters.runTests, true) }}:
- _runtimeArtifactName: '$(runtimeFlavorName)Product_${{ parameters.runtimeVariant}}_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveRuntimeBuildConfig }}'
- _runtimeArtifactsPathArg: ' /p:RuntimeArtifactsPath=$(_runtimeDownloadPath)'
- ${{ if eq(parameters.testDisplayName, '') }}:
- _testRunNamePrefixSuffix: $(runtimeFlavorName)_${{ parameters.liveRuntimeBuildConfig }}
- ${{ if ne(parameters.testDisplayName, '') }}:
- _testRunNamePrefixSuffix: ${{ parameters.testDisplayName }}
- ${{ if ne(parameters.osGroup, 'windows') }}:
- _buildScript: ./$(_buildScriptFileName)$(scriptExt)
- _buildArguments: $(_runtimeConfigurationArg) -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_testModeArg) $(_testScopeArg) $(_osArg) $(_msbuildCommonParameters) $(_runtimeArtifactsPathArg) $(_crossBuildPropertyArg)
- ${{ parameters.variables }}
# we need to override this value to support build-coreclr-and-libraries-job.yml
- _BuildConfig: ${{ parameters.buildConfig }}
dependsOn:
- ${{ if eq(parameters.dependOnEvaluatePaths, true) }}:
- evaluate_paths
- ${{ parameters.dependsOn }}
workspace:
clean: all
enablePublishBuildArtifacts: true
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
steps:
- checkout: self
clean: true
fetchDepth: $(checkoutFetchDepth)
- ${{ if and(ne(parameters.liveRuntimeBuildConfig, ''), eq(parameters.runTests, true)) }}:
- template: /eng/pipelines/common/download-artifact-step.yml
parameters:
unpackFolder: $(_runtimeDownloadPath)
artifactFileName: '$(_runtimeArtifactName)$(archiveExtension)'
artifactName: '$(_runtimeArtifactName)'
displayName: '$(runtimeFlavorName) build drop'
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- ${{ if ne(parameters.osGroup, 'windows') }}:
- task: Bash@3
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- ${{ if eq(parameters.osGroup, 'windows') }}:
- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- ${{ parameters.steps }}