7
7
- onebranch
8
8
- release/v*
9
9
10
+ parameters :
11
+ - name : OfficialBuild
12
+ type : boolean
13
+ default : false
14
+
10
15
variables :
11
- BuildConfiguration : ' release'
12
- PackageRoot : ' $(System.ArtifactsDirectory)/Packages'
13
- WindowsContainerImage : ' onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
14
- Codeql.TSAEnabled : true
16
+ - name : BuildConfiguration
17
+ value : ' release'
18
+ - name : PackageRoot
19
+ value : ' $(System.ArtifactsDirectory)/Packages'
20
+ - name : WindowsContainerImage
21
+ value : ' onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
22
+ - name : Codeql.TSAEnabled
23
+ value : true
24
+ - name : templateFile
25
+ value : ${{ iif ( parameters.OfficialBuild, 'v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates', 'v2/OneBranch.NonOfficial.CrossPlat.yml@onebranchTemplates' ) }}
26
+ - group : DSC-Rust.SDK
27
+ - name : officialBuild
28
+ value : ${{ parameters.OfficialBuild }}
15
29
16
30
resources :
17
31
repositories :
@@ -21,7 +35,7 @@ resources:
21
35
ref : refs/heads/main
22
36
23
37
extends :
24
- template : v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates
38
+ template : ${{ variables.templateFile }}
25
39
parameters :
26
40
featureFlags :
27
41
WindowsHostVersion :
@@ -78,7 +92,7 @@ extends:
78
92
- task : AzureCLI@2
79
93
displayName : Get Az Token
80
94
inputs :
81
- azureSubscription : az-blob-cicd-infra
95
+ azureSubscription : PowerShell-CICD-Feed-Access
82
96
scriptType : pscore
83
97
scriptLocation : inlineScript
84
98
inlineScript : |
@@ -105,14 +119,16 @@ extends:
105
119
buildName : x86_64-pc-windows-msvc
106
120
signSrcPath : ' $(signSrcPath)'
107
121
PackageRoot : ' $(PackageRoot)'
108
- token : ' $(AzToken)'
122
+ aztoken : ' $(AzToken)'
123
+ rustSDK : ' $(Rust.SDK)'
109
124
110
125
- job : BuildWin_arm64
111
126
dependsOn : SetPackageVersion
112
127
variables :
113
128
ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
114
129
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
115
130
signSrcPath : ' $(Build.SourcesDirectory)\out'
131
+ AzToken : $[ dependencies.SetPackageVersion.outputs['AzToken'] ]
116
132
ob_sdl_sbom_enabled : true
117
133
ob_signing_setup_enabled : true
118
134
ob_sdl_codeql_compiled_enabled : true
@@ -124,7 +140,8 @@ extends:
124
140
buildName : aarch64-pc-windows-msvc
125
141
signSrcPath : ' $(signSrcPath)'
126
142
PackageRoot : ' $(PackageRoot)'
127
- token : ' $(AzToken)'
143
+ aztoken : ' $(AzToken)'
144
+ rustSDK : ' $(Rust.SDK)'
128
145
129
146
- job : CreateMsixBundle
130
147
dependsOn :
@@ -162,6 +179,7 @@ extends:
162
179
condition: succeeded()
163
180
164
181
- job : SignMsixBundle
182
+ condition : and(succeeded(), eq(variables.officialBuild, true))
165
183
dependsOn : CreateMsixBundle
166
184
variables :
167
185
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
@@ -208,15 +226,15 @@ extends:
208
226
- task : RustInstaller@1
209
227
inputs :
210
228
rustVersion : ms-stable
211
- toolchainFeed : https://pkgs.dev.azure.com/mscodehub/ Rust/_packaging/Rust/nuget/v3/index.json
229
+ toolchainFeed : $( Rust.SDK)
212
230
additionalTargets : x86_64-unknown-linux-musl
213
231
displayName : Install Rust
214
232
env :
215
233
ob_restore_phase : true
216
234
- pwsh : |
217
235
apt update
218
236
apt -y install musl-tools
219
- $header = "Bearer $accessToken "
237
+ $header = "Bearer $(AzToken) "
220
238
$env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header
221
239
$env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token'
222
240
./build.ps1 -Release -Architecture x86_64-unknown-linux-musl
@@ -243,15 +261,15 @@ extends:
243
261
- task : RustInstaller@1
244
262
inputs :
245
263
rustVersion : ms-stable
246
- toolchainFeed : https://pkgs.dev.azure.com/mscodehub/ Rust/_packaging/Rust/nuget/v3/index.json
264
+ toolchainFeed : $( Rust.SDK)
247
265
additionalTargets : aarch64-unknown-linux-musl
248
266
displayName : Install Rust
249
267
env :
250
268
ob_restore_phase : true
251
269
- task : AzureCLI@2
252
270
displayName : Azure CLI
253
271
inputs :
254
- azureSubscription : az-blob-cicd-infra
272
+ azureSubscription : PowerShell-CICD-Feed-Access
255
273
scriptType : pscore
256
274
scriptLocation : inlineScript
257
275
inlineScript : |
@@ -264,14 +282,15 @@ extends:
264
282
apt -y install clang
265
283
apt -y install llvm
266
284
apt -y install musl-tools
267
- apt -y install gcc-multilib
285
+ apt -y install musl-gcc
286
+ #apt -y install gcc-multilib
268
287
apt -y install libssl-dev
269
288
apt -y install pkg-config
270
289
msrustup default stable-aarch64-unknown-linux-musl
271
290
if ((openssl version -d) -match 'OPENSSLDIR: "(?<dir>.*?)"') {
272
291
$env:OPENSSL_LIB_DIR = $matches['dir']
273
292
}
274
- $header = "Bearer $accessToken "
293
+ $header = "Bearer $(AzToken) "
275
294
$env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header
276
295
$env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token'
277
296
./build.ps1 -Release -Architecture aarch64-unknown-linux-musl
@@ -302,23 +321,24 @@ extends:
302
321
- task : RustInstaller@1
303
322
inputs :
304
323
rustVersion : ms-stable
305
- toolchainFeed : https://pkgs.dev.azure.com/mscodehub/ Rust/_packaging/Rust/nuget/v3/index.json
324
+ toolchainFeed : $( Rust.SDK)
306
325
additionalTargets : $(buildName)
307
326
displayName : Install Rust
308
327
env :
309
328
ob_restore_phase : true
310
329
- task : AzureCLI@2
311
330
displayName : Azure CLI
312
331
inputs :
313
- azureSubscription : az-blob-cicd-infra
332
+ azureSubscription : PowerShell-CICD-Feed-Access
314
333
scriptType : pscore
315
334
scriptLocation : inlineScript
316
335
inlineScript : |
317
336
az account show
318
337
- pwsh : |
319
- $header = "Bearer $accessToken "
338
+ $header = "Bearer $(AzToken) "
320
339
$env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header
321
340
$env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token'
341
+ Write-Verbose -Verbose "Building for $(buildName)"
322
342
./build.ps1 -Release -Architecture $(buildName)
323
343
./build.ps1 -PackageType tgz -Architecture $(buildName) -Release
324
344
Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
0 commit comments