@@ -19,36 +19,72 @@ stages:
1919 - stage : Signing
2020 dependsOn : ${{parameters.DependsOn}}
2121 jobs :
22- - deployment : SignPackage
23- environment : esrp
22+ - job : SignPackage
2423 timeoutInMinutes : 20
2524 pool :
26- name : azsdk-pool-mms-ubuntu-2004-general
27- image : azsdk-pool-mms-ubuntu-2004-1espt
28- os : linux
29-
30- strategy :
31- runOnce :
32- deploy :
33- steps :
34- - checkout : self
35-
36- - checkout : azure-sdk-build-tools
37- path : azure-sdk-build-tools
38-
39- - download : current
40- artifact : ${{parameters.ArtifactName}}
41- timeoutInMinutes : 5
42-
43- - template : /tools/java-esrp-signing/java-esrp-signing.yml@azure-sdk-build-tools
44- parameters :
45- Artifacts : ${{parameters.Artifacts}}
46- ArtifactDirectory : $(Pipeline.Workspace)/${{parameters.ArtifactName}}
47-
48- - template : /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
49- parameters :
50- ArtifactName : ${{parameters.ArtifactName}}-signed
51- ArtifactPath : $(Pipeline.Workspace)/${{parameters.ArtifactName}}
25+ name : azsdk-pool-mms-win-2022-general
26+ image : azsdk-pool-mms-win-2022-1espt
27+ os : windows
28+ steps :
29+ - checkout : self
30+
31+ - checkout : azure-sdk-build-tools
32+ path : azure-sdk-build-tools
33+
34+ - template : /eng/common/pipelines/templates/steps/sparse-checkout.yml
35+ parameters :
36+ SkipCheckoutNone : true
37+ Repositories :
38+ - Name : Azure/azure-sdk-for-android
39+ Commitish : $(Build.SourceVersion)
40+ WorkingDirectory : $(Pipeline.Workspace)/azure-sdk-for-android
41+
42+ - download : current
43+ displayName : ' Download Artifact: ${{parameters.ArtifactName}}'
44+ artifact : ${{parameters.ArtifactName}}
45+
46+ - template : /tools/java-esrp-signing/java-esrp-signing.yml@azure-sdk-build-tools
47+ parameters :
48+ Artifacts : ${{parameters.Artifacts}}
49+ ArtifactDirectory : $(Pipeline.Workspace)/${{parameters.ArtifactName}}
50+
51+ # Publish the ESRP signed directory. This will still be used by the
52+ # Dev feed publish.
53+ - template : /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
54+ parameters :
55+ ArtifactPath : $(Pipeline.Workspace)/${{parameters.ArtifactName}}
56+ ArtifactName : ${{parameters.ArtifactName}}-signed
57+
58+ # Downloading the ESRP signed artifacts
59+ - download : current
60+ displayName : ' Download Signed Artifacts'
61+ artifact : ${{parameters.ArtifactName}}-signed
62+
63+ # Unfortunately, the way single libraries publishing works with ESRP is that only
64+ # what's being published can be in the directory. gpg sign and flatten needs to be
65+ # done for each artifact and the resulting directory is filtered by the groupId and
66+ # artifactId. The flattened directory needs to have the artifact name in it to be
67+ # unique since each publish task only publishes a single library.
68+ - ${{ each artifact in parameters.Artifacts }} :
69+ - template : tools/gpg/gpg.yml@azure-sdk-build-tools
70+ - template : /eng/pipelines/templates/steps/gpg-sign-and-flatten.yml
71+ parameters :
72+ ArtifactID : ${{artifact.name}}
73+ GroupID : ${{artifact.groupId}}
74+ ArtifactDirectory : $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed
75+ OutputDirectory : $(Pipeline.Workspace)/${{parameters.ArtifactName}}-${{artifact.name}}-esrp-gpg-signed
76+ FlattenedESRPDirectory : $(Pipeline.Workspace)/${{parameters.ArtifactName}}-${{artifact.name}}-esrp-flattened
77+ # Note: In spite of the fact that the variable is named JavaRepoRoot, the
78+ # root needs to be the root of the android repository. This template, like many
79+ # of the release steps and scripts, is copied from Java.
80+ JavaRepoRoot : $(Pipeline.Workspace)/azure-sdk-for-android
81+
82+ # The packages-esrp-gpg-signed will be used for the ESRP publish for Android which
83+ # is still a single library publish and doesn't require the flattened directory
84+ - template : /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
85+ parameters :
86+ ArtifactPath : ' $(Pipeline.Workspace)/${{parameters.ArtifactName}}-${{artifact.name}}-esrp-flattened'
87+ ArtifactName : ' ${{parameters.ArtifactName}}-${{artifact.name}}-esrp-flattened'
5288
5389 # We generate two interdependent stages for each artifact listed in the ci.yml file, creates the release
5490 # in GitHub. The Release stage publishes to Maven Central. Both stages require approval since they
@@ -62,10 +98,9 @@ stages:
6298 dependsOn : Signing
6399 condition : and(succeeded(), ne(variables['SetDevVersion'], 'true'), ne(variables['Skip.Release'], 'true'), ne(variables['Build.Repository.Name'], 'Azure/azure-sdk-for-android-pr'))
64100 jobs :
65- - deployment : TagRepository
101+ - job : TagRepository
66102 displayName : " Create release tag"
67103 condition : ne(variables['Skip.TagRepository'], 'true')
68- environment : maven
69104 timeoutInMinutes : 5
70105 dependsOn :
71106 - ${{ if eq(parameters.VerifyVersions, 'true')}} :
@@ -75,92 +110,67 @@ stages:
75110 name : azsdk-pool-mms-win-2022-general
76111 image : azsdk-pool-mms-win-2022-1espt
77112 os : windows
78-
79- strategy :
80- runOnce :
81- deploy :
82- steps :
83- - checkout : self
84- - download : current
85- displayName : ' Download Artifact: ${{parameters.ArtifactName}}-signed'
86- artifact : ${{parameters.ArtifactName}}-signed
87- - template : /eng/common/pipelines/templates/steps/create-tags-and-git-release.yml
88- parameters :
89- ArtifactLocation : $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.safeName}}
90- PackageRepository : Maven
91- ReleaseSha : $(Build.SourceVersion)
113+ steps :
114+ - checkout : self
115+ - download : current
116+ displayName : ' Download Artifact: ${{parameters.ArtifactName}}-signed'
117+ artifact : ${{parameters.ArtifactName}}-signed
118+ - template : /eng/common/pipelines/templates/steps/create-tags-and-git-release.yml
119+ parameters :
120+ ArtifactLocation : $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.safeName}}
121+ PackageRepository : Maven
122+ ReleaseSha : $(Build.SourceVersion)
92123
93124 - ${{if ne(artifact.options.skipPublishPackage, 'true')}} :
94- - deployment : PublishPackage
95- displayName : " Publish to Maven Central"
125+ - deployment : PublishESRPPackage
126+ displayName : " Publish to Maven Central via ESRP "
96127 condition : and(succeeded(), ne(variables['Skip.PublishPackage'], 'true'))
97128 environment : maven
98129 dependsOn : TagRepository
99130
131+ templateContext :
132+ type : releaseJob
133+ isProduction : true
134+ inputs :
135+ - input : pipelineArtifact
136+ artifactName : ' ${{parameters.ArtifactName}}-${{artifact.name}}-esrp-flattened'
137+ targetPath : ' $(Pipeline.Workspace)/${{parameters.ArtifactName}}-${{artifact.name}}-esrp-flattened'
138+
100139 pool :
101140 name : azsdk-pool-mms-win-2022-general
102141 image : azsdk-pool-mms-win-2022-1espt
103142 os : windows
104-
105143 strategy :
106144 runOnce :
107145 deploy :
108146 steps :
109- - checkout : self
110- - checkout : azure-sdk-build-tools
111- path : azure-sdk-build-tools
112- - template : tools/gpg/gpg.yml@azure-sdk-build-tools
113- - template : /eng/common/pipelines/templates/steps/sparse-checkout.yml
147+ - template : /eng/pipelines/templates/steps/java-esrp-publishing.yml
114148 parameters :
115- SkipCheckoutNone : true
116- Repositories :
117- - Name : Azure/azure-sdk-for-android
118- Commitish : $(Build.SourceVersion)
119- WorkingDirectory : $(Pipeline.Workspace)/azure-sdk-for-android
120-
121- - template : /eng/pipelines/templates/steps/java-publishing.yml
122- parameters :
123- ArtifactID : ${{artifact.name}}
124- GroupID : ${{artifact.groupId}}
125- ArtifactDirectory : $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed
126- OutputDirectory : $(Pipeline.Workspace)/EsrpPackages
127- Target : EsrpRelease
128- # Note: In spite of the fact that the variable is named JavaRepoRoot, the
129- # root needs to be the root of the android repository
130- JavaRepoRoot : $(Pipeline.Workspace)/azure-sdk-for-android
131-
132- - template : /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
133- parameters :
134- ArtifactName : ${{parameters.ArtifactName}}-${{artifact.name}}-esrp-$(System.JobAttempt)
135- ArtifactPath : $(Pipeline.Workspace)/EsrpPackages
149+ FlattenedDirectory : $(Pipeline.Workspace)/${{parameters.ArtifactName}}-${{artifact.name}}-esrp-flattened
136150
137151 - ${{if ne(artifact.options.skipPublishDocs, 'true')}} :
138- - deployment : PublishDocs
152+ - job : PublishDocs
139153 displayName : Publish Docs to GitHubIO Blob Storage
140154 condition : and(succeeded(), ne(variables['Skip.PublishDocs'], 'true'))
141- environment : maven
142- dependsOn : PublishPackage
155+ dependsOn : PublishESRPPackage
143156
144157 pool :
145158 name : azsdk-pool-mms-win-2022-general
146159 image : azsdk-pool-mms-win-2022-1espt
147160 os : windows
148161
149- strategy :
150- runOnce :
151- deploy :
152- steps :
153- - template : /eng/common/pipelines/templates/steps/sparse-checkout.yml
154- - download : current
155- displayName : ' Download Artifact: ${{parameters.ArtifactName}}-signed'
156- artifact : ${{parameters.ArtifactName}}-signed
157- patterns : ${{artifact.safeName}}/**
158- - pwsh : |
159- Get-ChildItem -Recurse $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.safeName}}
160- workingDirectory: $(Pipeline.Workspace)
161- displayName: Output Visible Artifacts
162- - template : /eng/common/pipelines/templates/steps/publish-blobs.yml
163- parameters :
164- FolderForUpload : ' $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.safeName}}'
165- TargetLanguage : ' android'
166- ArtifactLocation : $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.safeName}}
162+ steps :
163+ - template : /eng/common/pipelines/templates/steps/sparse-checkout.yml
164+ - download : current
165+ displayName : ' Download Artifact: ${{parameters.ArtifactName}}-signed'
166+ artifact : ${{parameters.ArtifactName}}-signed
167+ patterns : ${{artifact.safeName}}/**
168+ - pwsh : |
169+ Get-ChildItem -Recurse $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.safeName}}
170+ workingDirectory: $(Pipeline.Workspace)
171+ displayName: Output Visible Artifacts
172+ - template : /eng/common/pipelines/templates/steps/publish-blobs.yml
173+ parameters :
174+ FolderForUpload : ' $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.safeName}}'
175+ TargetLanguage : ' android'
176+ ArtifactLocation : $(Pipeline.Workspace)/${{parameters.ArtifactName}}-signed/${{artifact.safeName}}
0 commit comments