Skip to content

Commit a8dee48

Browse files
committed
change declaration of cred provider to toml file
1 parent d8629be commit a8dee48

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

.pipelines/DSC-Official.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ extends:
137137
Write-Host "##vso[task.setsecret]$accessToken"
138138
$header = "Bearer $accessToken"
139139
Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
140-
141-
$credentialProvider = "cargo:token"
142-
Write-Host "##[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER]$credentialProvider"
143140
displayName: 'Get Azure DevOps Token'
144141
env:
145142
ob_restore_phase: true
@@ -148,6 +145,9 @@ extends:
148145
Write-Host "Use 'powershell' CFS"
149146
Add-Content -Path "./.cargo/config.toml" -Value '[source.crates-io]'
150147
Add-Content -Path "./.cargo/config.toml" -Value 'replace-with = "powershell"'
148+
Add-Content -Path "./.cargo/config.toml" -Value '[registry]'
149+
Add-Content -Path "./.cargo/config.toml" -Value 'global-credential-providers = ["cargo:token"]'
150+
151151
./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck
152152
displayName: 'Build $(buildName)'
153153
env:
@@ -274,16 +274,15 @@ extends:
274274
Write-Host "##vso[task.setsecret]$accessToken"
275275
$header = "Bearer $accessToken"
276276
Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
277-
278-
$credentialProvider = "cargo:token"
279-
Write-Host "##[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER]$credentialProvider"
280277
displayName: 'Get Azure DevOps Token'
281278
env:
282279
ob_restore_phase: true
283280
- pwsh: |
284281
Write-Host "Use 'powershell' CFS"
285282
Add-Content -Path "./.cargo/config.toml" -Value '[source.crates-io]'
286283
Add-Content -Path "./.cargo/config.toml" -Value 'replace-with = "powershell"'
284+
Add-Content -Path "./.cargo/config.toml" -Value '[registry]'
285+
Add-Content -Path "./.cargo/config.toml" -Value 'global-credential-providers = ["cargo:token"]'
287286
288287
./build.ps1 -Release -Architecture x86_64-unknown-linux-gnu
289288
./build.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-gnu -Release
@@ -322,16 +321,16 @@ extends:
322321
Write-Host "##vso[task.setsecret]$accessToken"
323322
$header = "Bearer $accessToken"
324323
Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
325-
326-
$credentialProvider = "cargo:token"
327-
Write-Host "##[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER]$credentialProvider"
328324
displayName: 'Get Azure DevOps Token'
329325
env:
330326
ob_restore_phase: true
331327
- pwsh: |
332328
Write-Host "Use 'powershell' CFS"
333329
Add-Content -Path "./.cargo/config.toml" -Value '[source.crates-io]'
334330
Add-Content -Path "./.cargo/config.toml" -Value 'replace-with = "powershell"'
331+
Add-Content -Path "./.cargo/config.toml" -Value '[registry]'
332+
Add-Content -Path "./.cargo/config.toml" -Value 'global-credential-providers = ["cargo:token"]'
333+
335334
./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu
336335
./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-gnu -Release
337336
Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
@@ -377,9 +376,6 @@ extends:
377376
Write-Host "##vso[task.setsecret]$accessToken"
378377
$header = "Bearer $accessToken"
379378
Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
380-
381-
#$credentialProvider = "cargo:token"
382-
#Write-Host "##[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER]$credentialProvider"
383379
displayName: 'Get Azure DevOps Token'
384380
env:
385381
ob_restore_phase: true

0 commit comments

Comments
 (0)