Skip to content

Commit 0dac0d8

Browse files
authored
Add Release Pipeline (#392)
* add a release stage to manually queued internal 'client' pipeline * leverage ESRP release task to push artifacts to pypi
1 parent 3347e21 commit 0dac0d8

2 files changed

Lines changed: 101 additions & 1 deletion

File tree

.azure-pipelines/client.yml

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extends:
1414
template: /.azure-pipelines/templates/stages/1es-redirect.yml
1515
parameters:
1616
stages:
17-
- stage:
17+
- stage: Build_and_Test
1818
displayName: 'Build and Test'
1919
variables:
2020
- template: /.azure-pipelines/templates/variables/image.yml
@@ -460,3 +460,94 @@ extends:
460460
testResultsFiles: '**/test-results-*.xml'
461461
testResultsFormat: 'JUnit'
462462
testRunTitle: 'ManyLinux2014 Python $(PythonVersion)'
463+
464+
- stage: Release
465+
dependsOn: Build_and_Test
466+
467+
jobs:
468+
- deployment: Publish
469+
environment: 'package-publish'
470+
pool:
471+
name: azsdk-pool-mms-ubuntu-2004-general
472+
image: azsdk-pool-mms-ubuntu-2004-1espt
473+
os: linux
474+
475+
strategy:
476+
runOnce:
477+
deploy:
478+
steps:
479+
- checkout: self
480+
481+
- template: /.azure-pipelines/templates/steps/download-targeted-artifacts.yml
482+
parameters:
483+
ArtifactList:
484+
- 'uamqp-sdist'
485+
- 'uamqp-linux-3.8-whl'
486+
- 'uamqp-linux-3.9-whl'
487+
- 'uamqp-linux-3.10-whl'
488+
- 'uamqp-linux-3.11-whl'
489+
- 'uamqp-linux-3.12-whl'
490+
- 'uamqp-macosx10.9-3.8-whl'
491+
- 'uamqp-macosx10.9-3.9-whl'
492+
- 'uamqp-macosx10.9-3.10-whl'
493+
- 'uamqp-macosx10.9-3.11-whl'
494+
- 'uamqp-macosx10.9-3.12-whl'
495+
- 'uamqp-manylinux2014_x86_64-3.8-x64-whl'
496+
- 'uamqp-manylinux2014_x86_64-3.9-x64-whl'
497+
- 'uamqp-manylinux2014_x86_64-3.10-x64-whl'
498+
- 'uamqp-manylinux2014_x86_64-3.11-x64-whl'
499+
- 'uamqp-manylinux2014_x86_64-3.12-x64-whl'
500+
- 'uamqp-winx64-3.8-whl'
501+
- 'uamqp-winx64-3.9-whl'
502+
- 'uamqp-winx64-3.10-whl'
503+
- 'uamqp-winx64-3.11-whl'
504+
- 'uamqp-winx64-3.12-whl'
505+
- 'uamqp-winx86-3.8-whl'
506+
- 'uamqp-winx86-3.9-whl'
507+
- 'uamqp-winx86-3.10-whl'
508+
- 'uamqp-winx86-3.11-whl'
509+
- 'uamqp-winx86-3.12-whl'
510+
511+
- pwsh: |
512+
$root = "$(Pipeline.Workspace)"
513+
$itemsForCopy = Get-ChildItem $root -Recurse -Force
514+
| Where-Object { ($_.Name -like "*.tar.gz" -or $_.Name -like "*.whl") }
515+
516+
Push-Location $root
517+
518+
foreach ($item in $itemsForCopy) {
519+
$source = $item.FullName
520+
$sourceFolder = $item.DirectoryName
521+
522+
$fileRelPath = (Resolve-Path -relative $source).Substring(2)
523+
$destinationFile = Join-Path $(Build.ArtifactStagingDirectory) $fileRelPath
524+
525+
$folderRelPath = (Resolve-Path -relative $sourceFolder).Substring(2)
526+
$destinationFolder = Join-Path $(Build.ArtifactStagingDirectory) $folderRelPath
527+
528+
if (!(Test-Path $destinationFolder)){
529+
New-Item -Path $destinationFolder -ItemType Directory -Force
530+
}
531+
Copy-Item -Path $source -Destination $destinationFile -Force
532+
}
533+
534+
Write-Host "Artifacts for Publish"
535+
Get-ChildItem "$(Build.ArtifactStagingDirectory)" -Recurse -Force | % { Write-Host $_.FullName }
536+
displayName: Move artifact to $(Build.ArtifactStagingDirectory)
537+
538+
- task: EsrpRelease@7
539+
displayName: 'Publish to ESRP'
540+
inputs:
541+
ConnectedServiceName: 'Azure SDK Engineering System'
542+
ClientId: '5f81938c-2544-4f1f-9251-dd9de5b8a81b'
543+
KeyVaultName: 'AzureSDKEngKeyVault'
544+
AuthCertName: 'azure-sdk-esrp-release-auth-certificate'
545+
SignCertName: 'azure-sdk-esrp-release-sign-certificate'
546+
Intent: 'PackageDistribution'
547+
ContentType: 'PyPI'
548+
FolderLocation: $(Build.ArtifactStagingDirectory)
549+
Owners: $(Build.RequestedForEmail)
550+
Approvers: $(Build.RequestedForEmail)
551+
ServiceEndpointUrl: 'https://api.esrp.microsoft.com'
552+
MainPublisher: 'ESRPRELPACMANTEST'
553+
DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
parameters:
2+
ArtifactList: []
3+
4+
steps:
5+
- ${{ each artifact in parameters.ArtifactList }}:
6+
- download: current
7+
displayName: "Download ${{ artifact }}"
8+
artifact: ${{ artifact }}
9+
timeoutInMinutes: 5

0 commit comments

Comments
 (0)