Skip to content

Commit ff4b6f3

Browse files
authored
Remove checkout step from deployment (Azure#2392)
1 parent 8c90eb1 commit ff4b6f3

File tree

2 files changed

+20
-43
lines changed

2 files changed

+20
-43
lines changed

eng/pipelines/templates/stages/archetype-rust-release.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff 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"

eng/scripts/Publish-Crates.ps1

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)