@@ -18,7 +18,6 @@ schedules:
18
18
variables :
19
19
BuildConfiguration : ' release'
20
20
PackageRoot : ' $(System.ArtifactsDirectory)/Packages'
21
- # LinuxContainerImage: 'mcr.microsoft.com/onebranch/cbl-mariner/build:2.0'
22
21
WindowsContainerImage : ' onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
23
22
Codeql.TSAEnabled : true
24
23
@@ -87,212 +86,17 @@ extends:
87
86
88
87
- job : BuildWin_x64
89
88
dependsOn : SetPackageVersion
90
- variables :
91
- buildName : x86_64-pc-windows-msvc
92
- PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
93
- ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
94
- ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
95
- repoRoot : ' $(Build.SourcesDirectory)\DSC'
96
- signSrcPath : ' $(Build.SourcesDirectory)\out'
97
- ob_sdl_sbom_enabled : true
98
- ob_signing_setup_enabled : true
99
- ob_sdl_codeql_compiled_enabled : true
100
- pool :
101
- type : windows
102
- displayName : BuildWin_x64
103
89
steps :
104
- - checkout : self
105
- env :
106
- ob_restore_phase : true
107
- - task : CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step.
108
- inputs :
109
- Enabled : true
110
- AnalyzeInPipeline : true
111
- Language : rust
112
- env :
113
- ob_restore_phase : true
114
- - pwsh : |
115
- $tmpdir = "$(Agent.TempDirectory)"
116
- Write-Host "##vso[task.setvariable variable=CARGO_TARGET_DIR;]$tmpdir"
117
- displayName: 🛠️ Workaround for the LoadLibrary ACCESS_VIOLATION OneBranch issue
118
- env:
119
- ob_restore_phase: true
120
- - task : RustInstaller@1
121
- inputs :
122
- rustVersion : ms-stable
123
- toolchainFeed : https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
124
- additionalTargets : $(buildName)
125
- displayName : Install Rust
126
- env :
127
- ob_restore_phase : true
128
- - pwsh : |
129
- Set-Location "$(Build.SourcesDirectory)/DSC"
130
- $LLVMBIN = "$($env:PROGRAMFILES)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\bin"
131
- if (!(Test-Path $LLVMBIN)) {
132
- throw "LLVM path '$LLVMBIN' does not exist"
133
- }
134
- $env:PATH += ";$LLVMBIN"
135
- write-verbose -verbose (gcm clang.exe | out-string)
136
- ./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck
137
- displayName: 'Build $(buildName)'
138
- env:
139
- ob_restore_phase: true
140
- condition: succeeded()
141
- - task : CodeQL3000Finalize@0 # Add CodeQL Finalize task right after your 'Build' step.
142
- condition : always()
143
- env :
144
- ob_restore_phase : true
145
- - pwsh : |
146
- $null = New-Item -ItemType Directory -Path "$(PackageRoot)" -ErrorAction Ignore
147
- $null = New-Item -ItemType Directory -Path "$(PackageRoot)/out" -ErrorAction Ignore
148
- $null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore
149
- # workaround known issue of building in OneBranch copying from TMP folder
150
- $null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore
151
- # copy only the exes from the TMP folder since it contains intermediately built files we don't want to sign
152
- write-host 'Binaries in $(env:CARGO_TARGET_DIR)'
153
- Copy-Item -Path "$env:CARGO_TARGET_DIR/$(buildName)/$(BuildConfiguration)/*.exe" -Destination "$(signSrcPath)" -Verbose
154
- Copy-Item -Path "$(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)/*" -Recurse -Destination "$(signSrcPath)" -Verbose -Force
155
- write-host 'Binaries in $(signSrcPath)'
156
- dir -r "$(signSrcPath)"
157
- displayName: Copy built binaries
158
- env:
159
- ob_restore_phase: true
160
- condition: succeeded()
161
- - task : onebranch.pipeline.signing@1
162
- displayName : Sign 1st party files
163
- inputs :
164
- command : ' sign'
165
- signing_profile : external_distribution
166
- files_to_sign : |
167
- **\*.exe;
168
- **\*.ps1;
169
- **\*.psd1;
170
- **\*.psm1;
171
- search_root : $(signSrcPath)
172
- - task : CopyFiles@2
173
- displayName : " Copy signed files to build target dir"
174
- inputs :
175
- SourceFolder : " $(signSrcPath)"
176
- Contents : ' **'
177
- TargetFolder : $(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)
178
- OverWrite : true
179
- - pwsh : |
180
- Set-Location "$(Build.SourcesDirectory)/DSC"
181
- ./build.ps1 -PackageType zip -Architecture $(buildName) -Release
182
- Copy-Item ./bin/*.zip "$(ob_outputDirectory)" -Verbose
183
- displayName: 'Zip $(buildName)'
184
- condition: succeeded()
185
- - pwsh : |
186
- Set-Location "$(Build.SourcesDirectory)/DSC"
187
- ./build.ps1 -PackageType msix -Architecture $(buildName) -Release -UseX64MakeAppx
188
- Copy-Item ./bin/msix/*.msix "$(ob_outputDirectory)" -Verbose
189
- displayName: 'Create msix for $(buildName)'
190
- condition: succeeded()
90
+ - template : ./DSC-Windows.yml
91
+ parameters :
92
+ buildName : x86_64-pc-windows-msvc
191
93
192
94
- job : BuildWin_arm64
193
95
dependsOn : SetPackageVersion
194
- variables :
195
- buildName : aarch64-pc-windows-msvc
196
- PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
197
- ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
198
- ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
199
- repoRoot : ' $(Build.SourcesDirectory)\DSC'
200
- signSrcPath : ' $(Build.SourcesDirectory)\out'
201
- ob_sdl_sbom_enabled : true
202
- ob_signing_setup_enabled : true
203
- ob_sdl_codeql_compiled_enabled : true
204
- pool :
205
- type : windows
206
- hostArchitecture : arm64
207
- displayName : BuildWin_arm64
208
96
steps :
209
- - checkout : self
210
- env :
211
- ob_restore_phase : true
212
- - task : CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step.
213
- inputs :
214
- Enabled : true
215
- AnalyzeInPipeline : true
216
- Language : rust
217
- env :
218
- ob_restore_phase : true
219
- - pwsh : |
220
- $tmpdir = "$(Agent.TempDirectory)"
221
- Write-Host "##vso[task.setvariable variable=CARGO_TARGET_DIR;]$tmpdir"
222
- displayName: 🛠️ Workaround for the LoadLibrary ACCESS_VIOLATION OneBranch issue
223
- env:
224
- ob_restore_phase: true
225
- - task : RustInstaller@1
226
- inputs :
227
- rustVersion : ms-stable
228
- toolchainFeed : https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
229
- additionalTargets : $(buildName)
230
- displayName : Install Rust
231
- env :
232
- ob_restore_phase : true
233
- - pwsh : |
234
- Set-Location "$(Build.SourcesDirectory)/DSC"
235
- $LLVMBIN = "$($env:PROGRAMFILES)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\bin"
236
- if (!(Test-Path $LLVMBIN)) {
237
- throw "LLVM path '$LLVMBIN' does not exist"
238
- }
239
- $env:PATH += ";$LLVMBIN"
240
- write-verbose -verbose (gcm clang.exe | out-string)
241
- ./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck
242
- displayName: 'Build $(buildName)'
243
- env:
244
- ob_restore_phase: true
245
- condition: succeeded()
246
- - task : CodeQL3000Finalize@0 # Add CodeQL Finalize task right after your 'Build' step.
247
- condition : always()
248
- env :
249
- ob_restore_phase : true
250
- - pwsh : |
251
- $null = New-Item -ItemType Directory -Path "$(PackageRoot)" -ErrorAction Ignore
252
- $null = New-Item -ItemType Directory -Path "$(PackageRoot)/out" -ErrorAction Ignore
253
- $null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore
254
- # workaround known issue of building in OneBranch copying from TMP folder
255
- $null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore
256
- # copy only the exes from the TMP folder since it contains intermediately built files we don't want to sign
257
- write-host 'Binaries in $(env:CARGO_TARGET_DIR)'
258
- Copy-Item -Path "$env:CARGO_TARGET_DIR/$(buildName)/$(BuildConfiguration)/*.exe" -Destination "$(signSrcPath)" -Verbose
259
- Copy-Item -Path "$(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)/*" -Recurse -Destination "$(signSrcPath)" -Verbose -Force
260
- write-host 'Binaries in $(signSrcPath)'
261
- dir -r "$(signSrcPath)"
262
- displayName: Copy built binaries
263
- env:
264
- ob_restore_phase: true
265
- condition: succeeded()
266
- - task : onebranch.pipeline.signing@1
267
- displayName : Sign 1st party files
268
- inputs :
269
- command : ' sign'
270
- signing_profile : external_distribution
271
- files_to_sign : |
272
- **\*.exe;
273
- **\*.ps1;
274
- **\*.psd1;
275
- **\*.psm1;
276
- search_root : $(signSrcPath)
277
- - task : CopyFiles@2
278
- displayName : " Copy signed files to build target dir"
279
- inputs :
280
- SourceFolder : " $(signSrcPath)"
281
- Contents : ' **'
282
- TargetFolder : $(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)
283
- OverWrite : true
284
- - pwsh : |
285
- Set-Location "$(Build.SourcesDirectory)/DSC"
286
- ./build.ps1 -PackageType zip -Architecture $(buildName) -Release
287
- Copy-Item ./bin/*.zip "$(ob_outputDirectory)" -Verbose
288
- displayName: 'Zip $(buildName)'
289
- condition: succeeded()
290
- - pwsh : |
291
- Set-Location "$(Build.SourcesDirectory)/DSC"
292
- ./build.ps1 -PackageType msix -Architecture $(buildName) -Release -UseX64MakeAppx
293
- Copy-Item ./bin/msix/*.msix "$(ob_outputDirectory)" -Verbose
294
- displayName: 'Create msix for $(buildName)'
295
- condition: succeeded()
97
+ - template : ./DSC-Windows.yml
98
+ parameters :
99
+ buildName : aarch64-pc-windows-msvc
296
100
297
101
- job : CreateMsixBundle
298
102
dependsOn :
@@ -324,62 +128,6 @@ extends:
324
128
displayName: 'Create msixbundle'
325
129
condition: succeeded()
326
130
327
- # - job: BuildLinux
328
- # dependsOn: SetPackageVersion
329
- # variables:
330
- # LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204:latest'
331
- # PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
332
- # ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
333
- # displayName: Linux-x64-gnu
334
- # pool:
335
- # type: linux
336
- # steps:
337
- # - task: RustInstaller@1
338
- # inputs:
339
- # rustVersion: ms-stable
340
- # toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
341
- # additionalTargets: x86_64-unknown-linux-gnu
342
- # displayName: Install Rust
343
- # env:
344
- # ob_restore_phase: true
345
- # - pwsh: |
346
- # ./build.ps1 -Release -Architecture x86_64-unknown-linux-gnu
347
- # ./build.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-gnu -Release
348
- # Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
349
- # displayName: 'Build x86_64-unknown-linux-gnu'
350
- # condition: succeeded()
351
-
352
- # - job: BuildLinuxArm64
353
- # dependsOn: SetPackageVersion
354
- # variables:
355
- # LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2004-arm64:latest'
356
- # PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
357
- # ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
358
- # displayName: Linux-ARM64-gnu
359
- # pool:
360
- # type: linux
361
- # hostArchitecture: arm64
362
- # steps:
363
- # - task: RustInstaller@1
364
- # inputs:
365
- # rustVersion: ms-stable
366
- # toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
367
- # additionalTargets: aarch64-unknown-linux-gnu
368
- # displayName: Install Rust
369
- # env:
370
- # ob_restore_phase: true
371
- # - pwsh: |
372
- # apt update
373
- # apt -y install gcc-aarch64-linux-gnu
374
- # if ((openssl version -d) -match 'OPENSSLDIR: "(?<dir>.*?)"') {
375
- # $env:OPENSSL_LIB_DIR = $matches['dir']
376
- # }
377
- # ./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu
378
- # ./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-gnu -Release
379
- # Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
380
- # displayName: 'Build aarch64-unknown-linux-gnu'
381
- # condition: succeeded()
382
-
383
131
- job : BuildLinuxMusl
384
132
dependsOn : SetPackageVersion
385
133
variables :
0 commit comments