11parameters :
22 BuildToPublish : ' '
33 HashAlgorithms : ['SHA256']
4- FeedPath : ' srv/ftp/download/__index_windows__.json'
54
65jobs :
7- - job : Publish_Python
8- displayName : Publish python.org packages
9- condition : and(succeeded(), eq(variables['DoMSI'], 'true'), eq(variables['DoEmbed'], 'true'), ne(variables['SkipPythonOrgPublish'], 'true'))
6+ - job : Publish_PyManager
7+ displayName : Publish PyManager packages to python.org
8+ condition : and(succeeded(), ne(variables['SkipPythonOrgPublish'], 'true'))
109
1110 pool :
1211 vmImage : windows-2022
@@ -24,29 +23,23 @@ jobs:
2423 versionSpec : ' >=3.10'
2524
2625 - ${{ if parameters.BuildToPublish }} :
27- - task : DownloadPipelineArtifact@1
28- displayName : ' Download artifact from ${{ parameters.BuildToPublish }}: pymanager'
29- inputs :
30- artifactName : pymanager
31- targetPath : $(Build.BinariesDirectory)
32- buildType : specific
33- project : $(System.TeamProject)
34- pipeline : $(Build.DefinitionName)
35- buildVersionToDownload : specific
36- buildId : ${{ parameters.BuildToPublish }}
26+ - ${{ each Name in variables.artifacts }} :
27+ - task : DownloadPipelineArtifact@1
28+ displayName : ' Download artifact from ${{ parameters.BuildToPublish}}: pymanager_${{ Name }}'
29+ inputs :
30+ artifactName : pymanager_${{ Name }}
31+ targetPath : $(Pipeline.Workspace)
32+ buildType : specific
33+ project : $(System.TeamProject)
34+ pipeline : $(Build.DefinitionName)
35+ buildVersionToDownload : specific
36+ buildId : ${{ parameters.BuildToPublish }}
3737
3838 - ${{ else }} :
39- - task : DownloadPipelineArtifact@1
40- displayName : ' Download artifact: pymanager'
41- inputs :
42- artifactName : pymanager
43- targetPath : $(Build.BinariesDirectory)
44-
45- # Note that ARM64 MSIs are skipped at build when this option is specified
46- - powershell : ' gci *embed-arm*.zip | %{ Write-Host "Not publishing: $($_.Name)"; gi $_ } | del'
47- displayName : ' Prevent publishing ARM64 packages'
48- workingDirectory : ' $(Build.BinariesDirectory)\pymanager'
49- condition : and(succeeded(), ne(variables['PublishARM64'], 'true'))
39+ - ${{ each Name in variables.artifacts }} :
40+ - download : current
41+ artifact : pymanager_${{ Name }}
42+ displayName : ' Download artifact: pymanager_${{ Name }}'
5043
5144
5245 - task : DownloadSecureFile@1
@@ -56,25 +49,24 @@ jobs:
5649 displayName : ' Download PuTTY key'
5750
5851 - powershell : |
59- "Uploading following files :"
60- dir *
52+ "Uploading following packages :"
53+ dir "*\__install__.json"
6154 python merge-and-upload.py
62- workingDirectory: $(Build.BinariesDirectory )
55+ workingDirectory: $(Pipeline.Workspace )
6356 displayName: 'Upload ZIPs'
6457 env:
65- UPLOAD_URL_PREFIX: 'https://www.python.org/ftp/'
66- UPLOAD_PATH_PREFIX: '/srv/www.python.org/ftp/'
67- INDEX_URL: 'https://www.python.org/ftp/python/__index_windows__.json'
68- INDEX_PATH: ${{ parameters.FeedPath }}
58+ INDEX_URL: '$(PyDotOrgUrlPrefix)python/__index_windows__.json'
6959 INDEX_FILE: '$(Build.ArtifactStagingDirectory)\index\__index__.json'
60+ UPLOAD_URL_PREFIX: $(PyDotOrgUrlPrefix)
61+ UPLOAD_PATH_PREFIX: $(PyDotOrgUploadPathPrefix)
7062 UPLOAD_HOST: $(PyDotOrgServer)
7163 UPLOAD_HOST_KEY: $(PyDotOrgHostKey)
72- UPLOAD_KEYFILE: $(sshkey.secureFilePath)
7364 UPLOAD_USER: $(PyDotOrgUsername)
65+ UPLOAD_KEYFILE: $(sshkey.secureFilePath)
7466
7567 - ${{ each alg in parameters.HashAlgorithms }} :
7668 - powershell : |
77- $files = gci -File "*.zip"
69+ $files = (dir "*\__install__.json").Directory | %{ dir -File "$_\ *.zip" }
7870 $hashes = $files | `
7971 Sort-Object Name | `
8072 Format-Table Name, @{
8577 $d = mkdir "$(Build.ArtifactStagingDirectory)\hashes" -Force
8678 $hashes | Out-File "$d\hashes.txt" -Encoding ascii -Append
8779 $hashes
88- workingDirectory: $(Build.BinariesDirectory )
80+ workingDirectory: $(Pipeline.Workspace )
8981 displayName: 'Generate hashes (${{ alg }})'
9082
9183 - publish : ' $(Build.ArtifactStagingDirectory)\index'
0 commit comments