1
1
name : DSC-Release-$(Build.BuildId)
2
2
trigger : none
3
3
4
- parameters :
5
- - name : ' debugConsole'
6
- displayName : ' Enable debug console'
7
- type : boolean
8
- default : false
9
-
10
4
pr :
11
5
branches :
12
6
include :
13
7
- onebranch
14
8
- release*
15
9
10
+ schedules :
11
+ - cron : ' 0 3 * * 1'
12
+ displayName : Weekly Build
13
+ branches :
14
+ include :
15
+ - main
16
+ always : true
17
+
16
18
variables :
17
19
BuildConfiguration : ' release'
18
20
PackageRoot : ' $(System.ArtifactsDirectory)/Packages'
19
- LinuxContainerImage : ' mcr.microsoft.com/onebranch/cbl-mariner/build:2.0'
20
- WindowsContainerImage : onebranch.azurecr.io/windows/ltsc2019/vse2022:latest
21
+ # LinuxContainerImage: 'mcr.microsoft.com/onebranch/cbl-mariner/build:2.0'
22
+ LinuxContainerImage : ' onebranch.azurecr.io/linux/ubuntu-2204:latest'
23
+ WindowsContainerImage : ' onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
21
24
22
25
resources :
23
26
repositories :
@@ -30,7 +33,12 @@ extends:
30
33
template : v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates
31
34
parameters :
32
35
featureFlags :
33
- debugConsole : ${{ parameters.debugConsole }}
36
+ WindowsHostVersion :
37
+ Disk : Large
38
+ Version : 2022
39
+ Network : KS1 # note that this property is sticky so commenting out will use the previous set one
40
+ # Currently can't be used as some NPM pkgs like tree-sitter-cli reach out to GitHub to get the actual zip pkg
41
+ # Network: NetLock
34
42
customTags : ' ES365AIMigrationTooling'
35
43
globalSdl :
36
44
disableLegacyManifest : true
@@ -51,7 +59,7 @@ extends:
51
59
apiscan :
52
60
enabled : false
53
61
54
- stages :
62
+ stages :
55
63
- stage : BuildAndSign
56
64
displayName : Build Native Binaries
57
65
dependsOn : []
@@ -60,6 +68,7 @@ extends:
60
68
displayName : Set PackageVersion
61
69
pool :
62
70
type : windows
71
+ vmImage : windows-latest
63
72
variables :
64
73
repoRoot : $(Build.SourcesDirectory)\DSC
65
74
ob_sdl_tsa_configFile : $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json
@@ -124,24 +133,15 @@ extends:
124
133
displayName : Install Rust
125
134
env :
126
135
ob_restore_phase : true
127
- - task : AzureCLI@2
128
- inputs :
129
- azureSubscription : az-PowerShell-feed-ingestion
130
- scriptType : ' pscore'
131
- scriptLocation : ' inlineScript'
132
- inlineScript : |
133
- $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
134
-
135
- # Set the access token as a secret, so it doesn't get leaked in the logs
136
- Write-Host "##vso[task.setsecret]$accessToken"
137
- $header = "Bearer $accessToken"
138
- Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
139
- displayName : ' Get Azure DevOps Token'
140
- env :
141
- ob_restore_phase : true
142
136
- pwsh : |
143
137
Set-Location "$(Build.SourcesDirectory)/DSC"
144
- ./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck -UseCFS
138
+ $LLVMBIN = "$($env:PROGRAMFILES)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\bin"
139
+ if (!(Test-Path $LLVMBIN)) {
140
+ throw "LLVM path '$LLVMBIN' does not exist"
141
+ }
142
+ $env:PATH += ";$LLVMBIN"
143
+ write-verbose -verbose (gcm clang.exe | out-string)
144
+ ./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck
145
145
displayName: 'Build $(buildName)'
146
146
env:
147
147
ob_restore_phase: true
@@ -201,16 +201,20 @@ extends:
201
201
dependsOn : BuildWin
202
202
variables :
203
203
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
204
+ ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
205
+ ob_sdl_sbom_enabled : true
206
+ ob_signing_setup_enabled : true
207
+ ob_sdl_codeql_compiled_enabled : true
204
208
pool :
205
209
type : windows
206
210
steps :
211
+ - checkout : self
207
212
- download : current
208
213
artifact : drop_BuildAndSign_BuildWinx64
209
214
patterns : ' *.msix'
210
215
- download : current
211
216
artifact : drop_BuildAndSign_BuildWinarm64
212
217
patterns : ' *.msix'
213
- - checkout : self
214
218
- pwsh : |
215
219
Set-Location "$(Build.SourcesDirectory)/DSC"
216
220
$null = New-Item -ItemType Directory -Path "./bin/msix" -Force -ErrorAction Ignore
@@ -221,25 +225,6 @@ extends:
221
225
displayName: 'Create msixbundle'
222
226
condition: succeeded()
223
227
224
- - job : PublishSigned
225
- dependsOn : BuildWin
226
- variables :
227
- signOutPath : $[ dependencies.BuildWin.outputs['signOutPath.signOutPath'] ]
228
- ob_sdl_tsa_configFile : $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json
229
- ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
230
- ob_sdl_sbom_enabled : false
231
- ob_signing_setup_enabled : false
232
- ob_sdl_codeql_compiled_enabled : false
233
- pool :
234
- type : windows
235
- steps :
236
- - task : CopyFiles@2
237
- displayName : " Copy Files for 'PublishPipelineArtifact@1' publish task"
238
- inputs :
239
- SourceFolder : $(signOutPath)
240
- Contents : ' **'
241
- TargetFolder : $(Build.ArtifactStagingDirectory)/signed
242
-
243
228
- job : BuildLinux
244
229
dependsOn : SetPackageVersion
245
230
variables :
@@ -257,23 +242,8 @@ extends:
257
242
displayName : Install Rust
258
243
env :
259
244
ob_restore_phase : true
260
- - task : AzureCLI@2
261
- inputs :
262
- azureSubscription : az-PowerShell-feed-ingestion
263
- scriptType : ' pscore'
264
- scriptLocation : ' inlineScript'
265
- inlineScript : |
266
- $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
267
-
268
- # Set the access token as a secret, so it doesn't get leaked in the logs
269
- Write-Host "##vso[task.setsecret]$accessToken"
270
- $header = "Bearer $accessToken"
271
- Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
272
- displayName : ' Get Azure DevOps Token'
273
- env :
274
- ob_restore_phase : true
275
245
- pwsh : |
276
- ./build.ps1 -Release -Architecture x86_64-unknown-linux-gnu -UseCFS
246
+ ./build.ps1 -Release -Architecture x86_64-unknown-linux-gnu
277
247
./build.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-gnu -Release
278
248
Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
279
249
displayName: 'Build x86_64-unknown-linux-gnu'
@@ -287,7 +257,6 @@ extends:
287
257
displayName : Linux-ARM64-gnu
288
258
pool :
289
259
type : linux
290
- hostArchitecture : arm64
291
260
steps :
292
261
- task : RustInstaller@1
293
262
inputs :
@@ -297,26 +266,72 @@ extends:
297
266
displayName : Install Rust
298
267
env :
299
268
ob_restore_phase : true
300
- - task : AzureCLI@2
269
+ - pwsh : |
270
+ apt update
271
+ apt -y install gcc-aarch64-linux-gnu
272
+ ./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu
273
+ ./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-gnu -Release
274
+ Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
275
+ displayName: 'Build aarch64-unknown-linux-gnu'
276
+ condition: succeeded()
277
+
278
+ - job : BuildLinuxMusl
279
+ dependsOn : SetPackageVersion
280
+ variables :
281
+ PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
282
+ ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
283
+ displayName : Linux-x64-musl
284
+ pool :
285
+ type : linux
286
+ steps :
287
+ - task : RustInstaller@1
301
288
inputs :
302
- azureSubscription : az-PowerShell-feed-ingestion
303
- scriptType : ' pscore'
304
- scriptLocation : ' inlineScript'
305
- inlineScript : |
306
- $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
289
+ rustVersion : ms-stable
290
+ toolchainFeed : https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
291
+ additionalTargets : x86_64-unknown-linux-musl
292
+ displayName : Install Rust
293
+ env :
294
+ ob_restore_phase : true
295
+ - pwsh : |
296
+ apt update
297
+ apt -y install musl-tools
298
+ ./build.ps1 -Release -Architecture x86_64-unknown-linux-musl
299
+ ./build.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-musl -Release
300
+ Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
301
+ displayName: 'Build x86_64-unknown-linux-musl'
302
+ condition: succeeded()
307
303
308
- # Set the access token as a secret, so it doesn't get leaked in the logs
309
- Write-Host "##vso[task.setsecret]$accessToken"
310
- $header = "Bearer $accessToken"
311
- Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
312
- displayName : ' Get Azure DevOps Token'
304
+ - job : BuildLinuxArm64Musl
305
+ dependsOn : SetPackageVersion
306
+ variables :
307
+ PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
308
+ ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
309
+ displayName : Linux-ARM64-musl
310
+ pool :
311
+ type : linux
312
+ steps :
313
+ - task : RustInstaller@1
314
+ inputs :
315
+ rustVersion : ms-stable
316
+ toolchainFeed : https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
317
+ additionalTargets : aarch64-unknown-linux-musl
318
+ displayName : Install Rust
313
319
env :
314
320
ob_restore_phase : true
315
321
- pwsh : |
316
- ./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu -UseCFS
317
- ./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-gnu -Release
322
+ $env:CC_aarch64_unknown_linux_musl='clang'
323
+ $env:AR_aarch64_unknown_linux_musl='llvm-ar'
324
+ $env:CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Clink-self-contained=yes -Clinker=rust-lld"
325
+ apt update
326
+ apt -y install clang
327
+ apt -y install llvm
328
+ apt -y install musl-tools
329
+ apt -y install gcc-multilib
330
+ rustup default stable-aarch64-unknown-linux-musl
331
+ ./build.ps1 -Release -Architecture aarch64-unknown-linux-musl
332
+ ./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-musl -Release
318
333
Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
319
- displayName: 'Build aarch64-unknown-linux-gnu '
334
+ displayName: 'Build aarch64-unknown-linux-musl '
320
335
condition: succeeded()
321
336
322
337
- job : BuildMac
@@ -345,23 +360,8 @@ extends:
345
360
displayName : Install Rust
346
361
env :
347
362
ob_restore_phase : true
348
- - task : AzureCLI@2
349
- inputs :
350
- azureSubscription : az-PowerShell-feed-ingestion
351
- scriptType : ' pscore'
352
- scriptLocation : ' inlineScript'
353
- inlineScript : |
354
- $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
355
-
356
- # Set the access token as a secret, so it doesn't get leaked in the logs
357
- Write-Host "##vso[task.setsecret]$accessToken"
358
- $header = "Bearer $accessToken"
359
- Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
360
- displayName : ' Get Azure DevOps Token'
361
- env :
362
- ob_restore_phase : true
363
363
- pwsh : |
364
- ./build.ps1 -Release -Architecture $(buildName) -UseCFS
364
+ ./build.ps1 -Release -Architecture $(buildName)
365
365
./build.ps1 -PackageType tgz -Architecture $(buildName) -Release
366
366
Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
367
367
Write-Host "##vso[artifact.upload containerfolder=release;artifactname=release]$(ob_outputDirectory)/DSC-$(PackageVersion)-$(buildName).tar.gz"
@@ -370,9 +370,9 @@ extends:
370
370
371
371
- stage : Release
372
372
dependsOn : BuildAndSign
373
+ condition : ne(variables['Build.Reason'], 'Schedule')
373
374
variables :
374
375
PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
375
- drop : $(Pipeline.Workspace)/drop_build_main
376
376
jobs :
377
377
- job : Validation
378
378
displayName : Manual validation
@@ -392,10 +392,17 @@ extends:
392
392
pool :
393
393
type : windows
394
394
variables :
395
- ob_outputDirectory : ' $(Build.SourcesDirectory)'
395
+ ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
396
+ ob_sdl_sbom_enabled : false
397
+ ob_signing_setup_enabled : false
398
+ ob_sdl_codeql_compiled_enabled : false
399
+ drop : $(Pipeline.Workspace)/drop_build_main
396
400
steps :
397
401
- download : current
398
402
displayName : Download artifacts
403
+ patterns : |
404
+ '**/*.zip'
405
+ '**/*.tar.gz'
399
406
- task : GitHubRelease@1
400
407
displayName : Create GitHub release
401
408
inputs :
0 commit comments