@@ -101,20 +101,20 @@ extends:
101
101
displayName : BuildWin
102
102
steps :
103
103
- checkout : self
104
- env :
104
+ env :
105
105
ob_restore_phase : true
106
106
- task : CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step.
107
107
inputs :
108
108
Enabled : true
109
109
AnalyzeInPipeline : true
110
110
Language : rust
111
- env :
111
+ env :
112
112
ob_restore_phase : true
113
113
- pwsh : |
114
114
$tmpdir = "$(Agent.TempDirectory)"
115
115
Write-Host "##vso[task.setvariable variable=CARGO_TARGET_DIR;]$tmpdir"
116
116
displayName: 🛠️ Workaround for the LoadLibrary ACCESS_VIOLATION OneBranch issue
117
- env:
117
+ env:
118
118
ob_restore_phase: true
119
119
- task : RustInstaller@1
120
120
inputs :
@@ -123,14 +123,14 @@ extends:
123
123
cratesIoFeedOverride : sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/
124
124
additionalTargets : $(buildName)
125
125
displayName : Install Rust
126
- env :
126
+ env :
127
127
ob_restore_phase : true
128
128
- task : CargoAuthenticate@0
129
129
inputs :
130
130
configFile : " $(Build.SourcesDirectory)/DSC/.cargo/config.toml"
131
131
cargoServiceConnections : azDO-Cargo-PowerShell-feed-Ingestion
132
132
displayName : Authenticating cargo crates registry
133
- env :
133
+ env :
134
134
ob_restore_phase : true
135
135
- pwsh : |
136
136
Set-Location "$(Build.SourcesDirectory)/DSC"
@@ -139,12 +139,12 @@ extends:
139
139
Add-Content -Path "./.cargo/config.toml" -Value 'replace-with = "powershell"'
140
140
./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck
141
141
displayName: 'Build $(buildName)'
142
- env:
142
+ env:
143
143
ob_restore_phase: true
144
144
condition: succeeded()
145
145
- task : CodeQL3000Finalize@0 # Add CodeQL Finalize task right after your 'Build' step.
146
146
condition : always()
147
- env :
147
+ env :
148
148
ob_restore_phase : true
149
149
- pwsh : |
150
150
$null = New-Item -ItemType Directory -Path "$(PackageRoot)" -ErrorAction Ignore
@@ -159,7 +159,7 @@ extends:
159
159
write-host 'Binaries in $(signSrcPath)'
160
160
dir -r "$(signSrcPath)"
161
161
displayName: Copy built binaries
162
- env:
162
+ env:
163
163
ob_restore_phase: true
164
164
condition: succeeded()
165
165
- task : onebranch.pipeline.signing@1
@@ -249,14 +249,22 @@ extends:
249
249
cratesIoFeedOverride : sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/
250
250
additionalTargets : x86_64-unknown-linux-gnu
251
251
displayName : Install Rust
252
- env :
252
+ env :
253
253
ob_restore_phase : true
254
- - task : CargoAuthenticate@0
254
+ - task : AzureCLI@2
255
255
inputs :
256
- configFile : " .cargo/config.toml"
257
- cargoServiceConnections : azDO-Cargo-PowerShell-feed-Ingestion
258
- displayName : Authenticating cargo crates registry
259
- env :
256
+ azureSubscription : az-PowerShell-feed-ingestion
257
+ scriptType : ' pscore'
258
+ scriptLocation : ' inlineScript'
259
+ inlineScript : |
260
+ $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
261
+
262
+ # Set the access token as a secret, so it doesn't get leaked in the logs
263
+ Write-Host "##vso[task.setsecret]$accessToken"
264
+ $header = Bearer $accessToken
265
+ Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN;issecret=true]$header"
266
+ displayName : ' Get Azure DevOps Token'
267
+ env :
260
268
ob_restore_phase : true
261
269
- pwsh : |
262
270
Write-Host "Use 'powershell' CFS"
@@ -285,14 +293,22 @@ extends:
285
293
cratesIoFeedOverride : sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/
286
294
additionalTargets : aarch64-unknown-linux-gnu
287
295
displayName : Install Rust
288
- env :
296
+ env :
289
297
ob_restore_phase : true
290
- - task : CargoAuthenticate@0
298
+ - task : AzureCLI@2
291
299
inputs :
292
- configFile : " .cargo/config.toml"
293
- cargoServiceConnections : azDO-Cargo-PowerShell-feed-Ingestion
294
- displayName : Authenticating cargo crates registry
295
- env :
300
+ azureSubscription : az-PowerShell-feed-ingestion
301
+ scriptType : ' pscore'
302
+ scriptLocation : ' inlineScript'
303
+ inlineScript : |
304
+ $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
305
+
306
+ # Set the access token as a secret, so it doesn't get leaked in the logs
307
+ Write-Host "##vso[task.setsecret]$accessToken"
308
+ $header = Bearer $accessToken
309
+ Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN;issecret=true]$header"
310
+ displayName : ' Get Azure DevOps Token'
311
+ env :
296
312
ob_restore_phase : true
297
313
- pwsh : |
298
314
Write-Host "Use 'powershell' CFS"
@@ -329,14 +345,14 @@ extends:
329
345
cratesIoFeedOverride : sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/
330
346
additionalTargets : $(buildName)
331
347
displayName : Install Rust
332
- env :
348
+ env :
333
349
ob_restore_phase : true
334
350
- task : CargoAuthenticate@0
335
351
inputs :
336
352
configFile : " .cargo/config.toml"
337
353
cargoServiceConnections : azDO-Cargo-PowerShell-feed-Ingestion
338
354
displayName : Authenticating cargo crates registry
339
- env :
355
+ env :
340
356
ob_restore_phase : true
341
357
- pwsh : |
342
358
Write-Host "Use 'powershell' CFS"
0 commit comments