File tree Expand file tree Collapse file tree 2 files changed +20
-43
lines changed
pipelines/templates/stages Expand file tree Collapse file tree 2 files changed +20
-43
lines changed Original file line number Diff line number Diff line change @@ -84,25 +84,33 @@ stages:
8484 runOnce :
8585 deploy :
8686 steps :
87- - template : /eng/common/pipelines/templates/steps/sparse-checkout.yml
88- parameters :
89- skipCheckoutNone : true
90-
9187 - template : /eng/pipelines/templates/steps/use-rust.yml@self
9288 parameters :
9389 Toolchain : stable
9490
95- - task : PowerShell@2
91+ - pwsh : |
92+ $additionalOwners = @('heaths', 'hallipr')
93+ $token = $env:CARGO_REGISTRY_TOKEN
94+ $crateName = '${{artifact.name}}'
95+
96+ $manifestPath = "$(Pipeline.Workspace)/drop/$crateName/Cargo.toml"
97+ Write-Host "> cargo publish --manifest-path `"$manifestPath`""
98+ cargo publish --manifest-path $manifestPath
99+ if (!$?) {
100+ Write-Error "Failed to publish package: '$crateName'"
101+ exit 1
102+ }
103+
104+ $existingOwners = (cargo owner --list $crateName) -replace " \(.*", ""
105+ $missingOwners = $additionalOwners | Where-Object { $existingOwners -notcontains $_ }
106+
107+ foreach ($owner in $missingOwners) {
108+ Write-Host "> cargo owner --add $owner $crateName"
109+ cargo owner --add $owner $crateName
110+ }
96111 displayName: Publish Crate
97112 env:
98113 CARGO_REGISTRY_TOKEN: $(azure-sdk-cratesio-token)
99- inputs :
100- targetType : filePath
101- filePath : $(Build.SourcesDirectory)/eng/scripts/Publish-Crates.ps1
102- arguments : >
103- -PackagesPath '$(Pipeline.Workspace)/drop'
104- -CrateNames '${{artifact.name}}'
105- -AdditionalOwners 'heaths','hallipr'
106114
107115 # - job: CreateApiReview
108116 # displayName: "Api Review"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments