@@ -64,10 +64,10 @@ stages:
6464 vmImage : ' windows-latest'
6565
6666 variables :
67- - ${{ if eq(parameters.Sign, 'true') }} :
68- - group : CPythonSign
6967 - ${{ if eq(parameters.TestSign, 'true') }} :
7068 - group : CPythonTestSign
69+ - ${{ elseif eq(parameters.Sign, 'true') }} :
70+ - group : CPythonSign
7171 - ${{ if eq(parameters.Publish, 'true') }} :
7272 - group : PythonOrgPublish
7373
@@ -87,11 +87,20 @@ stages:
8787 displayName : ' Install Nuget'
8888
8989 - powershell : |
90- nuget install -o host_python -x -noninteractive -prerelease python
91- Write-Host "##vso[task.prependpath]$(gi host_python\python\tools)"
92- displayName: 'Install host Python'
90+ nuget install python -Version 3.14.0 -x -noninteractive -o host_python
91+ $py = Get-Item host_python\python\tools
92+ Write-Host "Adding $py to PATH"
93+ Write-Host "##vso[task.prependpath]$py"
94+ displayName: Set up Python 3.14.0
9395 workingDirectory: $(Build.BinariesDirectory)
9496
97+ - powershell : >
98+ python -c "import sys;
99+ print(sys.version);
100+ print(sys.executable);
101+ sys.exit(0 if sys.version_info[:5] == (3, 14, 0, 'final', 0) else 1)"
102+ displayName: Check Python version is 3.14.0
103+
95104 - powershell : |
96105 python -m pip install "pymsbuild>=1.2.0b1"
97106 displayName: 'Install build dependencies'
@@ -122,6 +131,26 @@ stages:
122131 displayName: 'Install signing tool and generate files'
123132 workingDirectory: $(Build.BinariesDirectory)
124133
134+ - task : AzureCLI@2
135+ displayName : ' Azure Login (1/2)'
136+ inputs :
137+ azureSubscription : ' Python Signing'
138+ scriptType : ' ps'
139+ scriptLocation : ' inlineScript'
140+ inlineScript : |
141+ "##vso[task.setvariable variable=AZURE_CLIENT_ID;issecret=true]${env:servicePrincipalId}"
142+ "##vso[task.setvariable variable=AZURE_ID_TOKEN;issecret=true]${env:idToken}"
143+ "##vso[task.setvariable variable=AZURE_TENANT_ID;issecret=true]${env:tenantId}"
144+ addSpnToEnvironment : true
145+
146+ - powershell : >
147+ az login --service-principal
148+ -u $(AZURE_CLIENT_ID)
149+ --tenant $(AZURE_TENANT_ID)
150+ --allow-no-subscriptions
151+ --federated-token $(AZURE_ID_TOKEN)
152+ displayName: 'Azure Login (2/2)'
153+
125154 - powershell : |
126155 python make.py
127156 displayName: 'Build package'
@@ -142,10 +171,6 @@ stages:
142171 }
143172 displayName: 'Sign binaries'
144173 workingDirectory: $(LAYOUT_DIR)
145- env:
146- AZURE_CLIENT_ID: $(TrustedSigningClientId)
147- AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
148- AZURE_TENANT_ID: $(TrustedSigningTenantId)
149174
150175 - powershell : |
151176 python make-msix.py
@@ -177,10 +202,6 @@ stages:
177202 }
178203 displayName: 'Sign MSIX package'
179204 workingDirectory: $(DIST_DIR)
180- env:
181- AZURE_CLIENT_ID: $(TrustedSigningClientId)
182- AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
183- AZURE_TENANT_ID: $(TrustedSigningTenantId)
184205
185206 - powershell : >
186207 dir *.msi | %{
@@ -192,28 +213,23 @@ stages:
192213 }
193214 displayName: 'Sign MSI package'
194215 workingDirectory: $(DIST_DIR)
195- env:
196- AZURE_CLIENT_ID: $(TrustedSigningClientId)
197- AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
198- AZURE_TENANT_ID: $(TrustedSigningTenantId)
199216
200- - ${{ if eq(parameters.Sign, 'true') }} :
201- - powershell : Write-Host "##vso[build.addbuildtag]signed"
202- displayName : ' Add signed build tag'
203- - ${{ elseif eq(parameters.TestSign, 'true') }} :
217+ - ${{ if eq(parameters.TestSign, 'true') }} :
204218 - powershell : Write-Host "##vso[build.addbuildtag]test-signed"
205219 displayName : ' Add test-signed build tag'
220+ - ${{ elseif eq(parameters.Sign, 'true') }} :
221+ - powershell : Write-Host "##vso[build.addbuildtag]signed"
222+ displayName : ' Add signed build tag'
206223
207224 - publish : $(DIST_DIR)
208225 artifact : dist
209226 displayName : Publish distribution artifacts
210227
211228 - ${{ if eq(parameters.PostTest, 'true') }} :
212- - ${{ if eq(parameters.Sign, 'true') }} :
229+ - ${{ if and(ne(parameters.TestSign, 'true'), eq(parameters.Sign, 'true') ) }} :
213230 - powershell : |
214231 $msix = dir "$(DIST_DIR)\*.msix" | ?{ -not ($_.BaseName -match '.+-store') } | select -first 1
215232 Add-AppxPackage $msix
216- Get-AppxPackage PythonSoftwareFoundation.PythonManager
217233 displayName: 'Install signed MSIX'
218234
219235 - ${{ else }} :
@@ -222,53 +238,62 @@ stages:
222238 cp $msix "${msix}.zip"
223239 Expand-Archive "${msix}.zip" (mkdir -Force $env:TEST_MSIX)
224240 Add-AppxPackage -Register "${env:TEST_MSIX}\appxmanifest.xml"
225- Get-AppxPackage PythonSoftwareFoundation.PythonManager
226241 displayName: 'Register unsigned MSIX'
227242 env:
228243 TEST_MSIX: $(TEST_MSIX_DIR)
229244
230245 - powershell : |
231- gcm pymanager
232- gcm pywmanager
233- # These are likely present due to the machine configuration,
246+ $p = Get-AppxPackage PythonSoftwareFoundation.PythonManager
247+ $p
248+ Set-AppxPackageAutoUpdateSettings $p.PackageFamilyName -CheckOnLaunch $false
249+ Set-AppxPackageAutoUpdateSettings $p.PackageFamilyName -ShowPrompt $false
250+ Set-AppxPackageAutoUpdateSettings $p.PackageFamilyName -PauseUpdates -HoursToPause 1
251+ Get-AppxPackageAutoUpdateSettings $p.PackageFamilyName
252+ displayName: 'Update MSIX settings'
253+
254+ - powershell : |
255+ # Some of these are likely present due to the machine configuration,
234256 # but we'll check for them anyway.
235- gcm py
236- gcm python
237- gcm pyw
238- gcm pythonw
257+ gcm pymanager, pywmanager, py, python, pyw, pythonw | Format-Table -AutoSize
239258 displayName: 'Ensure global commands are present'
240259
241260 - powershell : |
242- pymanager
261+ pymanager help
243262 displayName: 'Show help output'
263+ timeoutInMinutes: 1
244264
245265 - powershell : |
246266 pymanager install -vv default
247267 displayName: 'Install default runtime'
268+ timeoutInMinutes: 5
248269 env:
249270 PYMANAGER_DEBUG: true
250271
251272 - powershell : |
252273 pymanager list
253274 displayName: 'List installed runtimes'
275+ timeoutInMinutes: 1
254276 env:
255277 PYMANAGER_DEBUG: true
256278
257279 - powershell : |
258280 pymanager --list-paths
259281 displayName: 'List installed runtimes (legacy)'
282+ timeoutInMinutes: 1
260283 env:
261284 PYMANAGER_DEBUG: true
262285
263286 - powershell : |
264287 pymanager exec -m site
265288 displayName: 'Launch default runtime'
289+ timeoutInMinutes: 1
266290 env:
267291 PYMANAGER_DEBUG: true
268292
269293 - powershell : |
270294 pymanager uninstall -y default
271295 displayName: 'Uninstall runtime'
296+ timeoutInMinutes: 3
272297 env:
273298 PYMANAGER_DEBUG: true
274299
@@ -282,6 +307,7 @@ stages:
282307 pymanager install --configure -y
283308 if ($?) { pymanager list }
284309 displayName: 'Emulate first launch'
310+ timeoutInMinutes: 5
285311 env:
286312 PYTHON_MANAGER_INCLUDE_UNMANAGED: false
287313 PYTHON_MANAGER_CONFIG: .\test-config.json
@@ -293,13 +319,27 @@ stages:
293319 pymanager list --source .\bundle
294320 pymanager install --source .\bundle 3 3-32 3-64 3-arm64
295321 displayName: 'Offline bundle download and install'
322+ timeoutInMinutes: 5
296323 env:
297324 PYMANAGER_DEBUG: true
298325
299326 - powershell : |
300327 Get-AppxPackage PythonSoftwareFoundation.PythonManager | Remove-AppxPackage
301328 displayName: 'Remove MSIX'
302329
330+ - powershell : |
331+ $files = gci -File * -EA SilentlyContinue
332+ $hashes = $files | `
333+ Sort-Object Name | `
334+ Format-Table Name, @{
335+ Label="MD5";
336+ Expression={(Get-FileHash $_ -Algorithm MD5).Hash}
337+ }, Length -AutoSize | `
338+ Out-String -Width 4096
339+ $hashes
340+ workingDirectory: $(DIST_DIR)
341+ displayName: 'Generate hashes (MD5)'
342+
303343 - ${{ if eq(parameters.Publish, 'true') }} :
304344 - ${{ if eq(parameters.Sign, 'true') }} :
305345 - task : DownloadSecureFile@1
0 commit comments