@@ -68,10 +68,10 @@ stages:
6868 vmImage : ' windows-latest'
6969
7070 variables :
71- - ${{ if eq(parameters.Sign, 'true') }} :
72- - group : CPythonSign
7371 - ${{ if eq(parameters.TestSign, 'true') }} :
7472 - group : CPythonTestSign
73+ - ${{ elseif eq(parameters.Sign, 'true') }} :
74+ - group : CPythonSign
7575 - ${{ if eq(parameters.Publish, 'true') }} :
7676 - group : PythonOrgPublish
7777
@@ -145,20 +145,21 @@ stages:
145145 PYMANAGER_APPX_PUBLISHER: $(TrustedSigningCertificateSubject)
146146
147147 - ${{ if or(eq(parameters.Sign, 'true'), eq(parameters.TestSign, 'true')) }} :
148- - powershell : >
149- dir -r *.exe, *.pyd | %{
150- sign code trusted-signing "$_"
151- -fd sha256 -t http://timestamp.acs.microsoft.com -td sha256
152- -tse "$(TrustedSigningUri)" -tsa "$(TrustedSigningAccount)" -tscp "$(TrustedSigningCertificateName)"
153- -d "PyManager $(Build.BuildNumber)"
154- -fl $env:SIGNLIST1
155- }
148+ - task : AzureCLI@2
156149 displayName : ' Sign binaries'
157- workingDirectory: $(LAYOUT_DIR)
158- env:
159- AZURE_CLIENT_ID: $(TrustedSigningClientId)
160- AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
161- AZURE_TENANT_ID: $(TrustedSigningTenantId)
150+ inputs :
151+ azureSubscription : ' Python Signing'
152+ scriptType : ps
153+ scriptLocation : inlineScript
154+ inlineScript : |
155+ dir -r *.exe, *.pyd | %{
156+ sign code trusted-signing "$_"
157+ -fd sha256 -t http://timestamp.acs.microsoft.com -td sha256
158+ -tse "$(TrustedSigningUri)" -tsa "$(TrustedSigningAccount)" -tscp "$(TrustedSigningCertificateName)"
159+ -d "PyManager $(Build.BuildNumber)"
160+ -fl $env:SIGNLIST1
161+ }
162+ workingDirectory : $(LAYOUT_DIR)
162163
163164 - powershell : |
164165 python make-msix.py
@@ -180,49 +181,35 @@ stages:
180181 PYMANAGER_APPX_PUBLISHER: $(TrustedSigningCertificateSubject)
181182
182183 - ${{ if or(eq(parameters.Sign, 'true'), eq(parameters.TestSign, 'true')) }} :
183- - powershell : >
184- dir *.msix | %{
185- sign code trusted-signing "$_"
186- -fd sha256 -t http://timestamp.acs.microsoft.com -td sha256
187- -tse "$(TrustedSigningUri)" -tsa "$(TrustedSigningAccount)" -tscp "$(TrustedSigningCertificateName)"
188- -d "PyManager $(Build.BuildNumber)"
189- -fl $env:SIGNLIST2
190- }
191- displayName: 'Sign MSIX package'
192- workingDirectory: $(DIST_DIR)
193- env:
194- AZURE_CLIENT_ID: $(TrustedSigningClientId)
195- AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
196- AZURE_TENANT_ID: $(TrustedSigningTenantId)
197-
198- - powershell : >
199- dir *.msi | %{
200- sign code trusted-signing "$_"
201- -fd sha256 -t http://timestamp.acs.microsoft.com -td sha256
202- -tse "$(TrustedSigningUri)" -tsa "$(TrustedSigningAccount)" -tscp "$(TrustedSigningCertificateName)"
203- -d "PyManager $(Build.BuildNumber)"
204- -fl $env:SIGNLIST3
205- }
206- displayName: 'Sign MSI package'
207- workingDirectory: $(DIST_DIR)
208- env:
209- AZURE_CLIENT_ID: $(TrustedSigningClientId)
210- AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
211- AZURE_TENANT_ID: $(TrustedSigningTenantId)
184+ - task : AzureCLI@2
185+ displayName : ' Sign packages'
186+ inputs :
187+ azureSubscription : ' Python Signing'
188+ scriptType : ps
189+ scriptLocation : inlineScript
190+ inlineScript : |
191+ dir *.msix, *.msi | %{
192+ sign code trusted-signing "$_"
193+ -fd sha256 -t http://timestamp.acs.microsoft.com -td sha256
194+ -tse "$(TrustedSigningUri)" -tsa "$(TrustedSigningAccount)" -tscp "$(TrustedSigningCertificateName)"
195+ -d "PyManager $(Build.BuildNumber)"
196+ -fl $env:SIGNLIST2
197+ }
198+ workingDirectory : $(DIST_DIR)
212199
213- - ${{ if eq(parameters.Sign, 'true') }} :
214- - powershell : Write-Host "##vso[build.addbuildtag]signed"
215- displayName : ' Add signed build tag'
216- - ${{ elseif eq(parameters.TestSign, 'true') }} :
200+ - ${{ if eq(parameters.TestSign, 'true') }} :
217201 - powershell : Write-Host "##vso[build.addbuildtag]test-signed"
218202 displayName : ' Add test-signed build tag'
203+ - ${{ elseif eq(parameters.Sign, 'true') }} :
204+ - powershell : Write-Host "##vso[build.addbuildtag]signed"
205+ displayName : ' Add signed build tag'
219206
220207 - publish : $(DIST_DIR)
221208 artifact : dist
222209 displayName : Publish distribution artifacts
223210
224211 - ${{ if eq(parameters.PostTest, 'true') }} :
225- - ${{ if eq(parameters.Sign, 'true') }} :
212+ - ${{ if and(ne(parameters.TestSign, 'true'), eq(parameters.Sign, 'true') ) }} :
226213 - powershell : |
227214 $msix = dir "$(DIST_DIR)\*.msix" | ?{ -not ($_.BaseName -match '.+-store') } | select -first 1
228215 Add-AppxPackage $msix
0 commit comments