/
releaseBuild.yml
229 lines (192 loc) · 6.19 KB
/
releaseBuild.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
name: UnifiedPackageBuild-$(Build.BuildId)
trigger:
branches:
include:
- master
- release*
pr:
branches:
include:
- master
- release*
parameters:
- name: ForceAzureBlobDelete
displayName: Delete Azure Blob
type: string
values:
- true
- false
default: false
resources:
repositories:
- repository: ComplianceRepo
type: github
endpoint: ComplianceGHRepo
name: PowerShell/compliance
ref: master
variables:
- name: DOTNET_CLI_TELEMETRY_OPTOUT
value: 1
- name: POWERSHELL_TELEMETRY_OPTOUT
value: 1
- name: NugetSecurityAnalysisWarningLevel
value: none
# Prevents auto-injection of nuget-security-analysis@0
- name: skipNugetSecurityAnalysis
value: true
- name: branchCounterKey
value: $[format('{0:yyyyMMdd}-{1}', pipeline.startTime,variables['Build.SourceBranch'])]
- name: branchCounter
value: $[counter(variables['branchCounterKey'], 1)]
- name: ForceAzureBlobDelete
value: ${{ parameters.ForceAzureBlobDelete }}
- name: Github_Build_Repository_Uri
value: https://github.com/powershell/powershell
- name: SBOMGenerator_Formats
value: spdx:2.2
- name: BUILDSECMON_OPT_IN
value: true
stages:
- stage: prep
jobs:
- template: templates/checkAzureContainer.yml
- stage: macos
dependsOn: ['prep']
jobs:
- template: templates/mac.yml
parameters:
buildArchitecture: x64
- template: templates/mac.yml
parameters:
buildArchitecture: arm64
- template: templates/mac-file-signing.yml
parameters:
buildArchitecture: x64
- template: templates/mac-file-signing.yml
parameters:
buildArchitecture: arm64
- template: templates/mac-package-build.yml
parameters:
buildArchitecture: x64
- template: templates/mac-package-build.yml
parameters:
buildArchitecture: arm64
- template: templates/mac-package-signing.yml
parameters:
buildArchitecture: x64
- template: templates/mac-package-signing.yml
parameters:
buildArchitecture: arm64
- stage: linux
dependsOn: ['prep']
jobs:
- template: templates/linux.yml
parameters:
buildName: deb
- template: templates/linux.yml
parameters:
buildName: rpm
uploadDisplayName: Upload and Sign
- template: templates/linux.yml
parameters:
buildName: fxdependent
parentJob: build_deb
- template: templates/linux.yml
parameters:
buildName: alpine
- stage: windows
dependsOn: ['prep']
jobs:
- template: templates/windows-hosted-build.yml
parameters:
Architecture: x64
- template: templates/windows-hosted-build.yml
parameters:
Architecture: x64
BuildConfiguration: minSize
- template: templates/windows-hosted-build.yml
parameters:
Architecture: x86
- template: templates/windows-hosted-build.yml
parameters:
Architecture: arm
- template: templates/windows-hosted-build.yml
parameters:
Architecture: arm64
- template: templates/windows-hosted-build.yml
parameters:
Architecture: fxdependent
- template: templates/windows-hosted-build.yml
parameters:
Architecture: fxdependentWinDesktop
- template: templates/windows-packaging.yml
parameters:
Architecture: x64
parentJob: build_windows_x64_release
- template: templates/windows-packaging.yml
parameters:
Architecture: x64
BuildConfiguration: minSize
parentJob: build_windows_x64_minSize
- template: templates/windows-packaging.yml
parameters:
Architecture: x86
parentJob: build_windows_x86_release
- template: templates/windows-packaging.yml
parameters:
Architecture: arm
parentJob: build_windows_arm_release
- template: templates/windows-packaging.yml
parameters:
Architecture: arm64
parentJob: build_windows_arm64_release
- template: templates/windows-packaging.yml
parameters:
Architecture: fxdependent
parentJob: build_windows_fxdependent_release
- template: templates/windows-packaging.yml
parameters:
Architecture: fxdependentWinDesktop
parentJob: build_windows_fxdependentWinDesktop_release
- template: templates/windows-package-signing.yml
parameters:
parentJobs:
- sign_windows_x64_release
- sign_windows_x64_minSize
- sign_windows_x86_release
- sign_windows_arm_release
- sign_windows_arm64_release
- sign_windows_fxdependent_release
- sign_windows_fxdependentWinDesktop_release
- stage: compliance
dependsOn: ['windows']
jobs:
- template: templates/compliance.yml
- stage: nuget_and_json
dependsOn: ['windows','linux','macOS']
jobs:
- template: templates/nuget.yml
- template: templates/json.yml
- stage: test_and_release_artifacts
dependsOn: ['prep']
jobs:
- template: templates/testartifacts.yml
- job: release_json
displayName: Create and Upload release.json
pool:
name: PowerShell1ES
demands:
- ImageOverride -equals PSMMS2019-Secure
steps:
- checkout: self
clean: true
- template: templates/SetVersionVariables.yml
parameters:
ReleaseTagVar: $(ReleaseTagVar)
- powershell: |
$metadata = Get-Content '$(Build.SourcesDirectory)/tools/metadata.json' -Raw | ConvertFrom-Json
$LTS = $metadata.LTSRelease.Latest
@{ ReleaseVersion = "$(Version)"; LTSRelease = $LTS } | ConvertTo-Json | Out-File "$(Build.StagingDirectory)\release.json"
Get-Content "$(Build.StagingDirectory)\release.json"
Write-Host "##vso[artifact.upload containerfolder=metadata;artifactname=metadata]$(Build.StagingDirectory)\release.json"
displayName: Create and upload release.json file to build artifact