blob: 2dd354a8c276f63274257ed270cd9992b4af06cb [file] [log] [blame]
Steve Dowerf78e66c2019-06-14 14:20:16 -07001jobs:
2- job: Publish_Python
3 displayName: Publish python.org packages
4 condition: and(succeeded(), and(eq(variables['DoMSI'], 'true'), eq(variables['DoEmbed'], 'true')))
5
6 pool:
Miss Islington (bot)12f33122019-07-13 03:10:33 -07007 #vmName: win2016-vs2017
8 name: 'Windows Release'
Steve Dowerf78e66c2019-06-14 14:20:16 -07009
10 workspace:
11 clean: all
12
13 steps:
Miss Islington (bot)12f33122019-07-13 03:10:33 -070014 - template: ./checkout.yml
Steve Dowerf78e66c2019-06-14 14:20:16 -070015
Miss Islington (bot)12f33122019-07-13 03:10:33 -070016 - task: UsePythonVersion@0
17 displayName: 'Use Python 3.6 or later'
18 inputs:
19 versionSpec: '>=3.6'
20
21 - task: DownloadPipelineArtifact@1
Steve Dowerf78e66c2019-06-14 14:20:16 -070022 displayName: 'Download artifact: Doc'
Miss Islington (bot)12f33122019-07-13 03:10:33 -070023 condition: and(succeeded(), not(variables['BuildToPublish']))
Steve Dowerf78e66c2019-06-14 14:20:16 -070024 inputs:
25 artifactName: Doc
Miss Islington (bot)12f33122019-07-13 03:10:33 -070026 targetPath: $(Build.BinariesDirectory)\Doc
Steve Dowerf78e66c2019-06-14 14:20:16 -070027
Miss Islington (bot)12f33122019-07-13 03:10:33 -070028 - task: DownloadPipelineArtifact@1
Steve Dowerf78e66c2019-06-14 14:20:16 -070029 displayName: 'Download artifact: msi'
Miss Islington (bot)12f33122019-07-13 03:10:33 -070030 condition: and(succeeded(), not(variables['BuildToPublish']))
Steve Dowerf78e66c2019-06-14 14:20:16 -070031 inputs:
32 artifactName: msi
Miss Islington (bot)12f33122019-07-13 03:10:33 -070033 targetPath: $(Build.BinariesDirectory)\msi
Steve Dowerf78e66c2019-06-14 14:20:16 -070034
35 - task: DownloadBuildArtifacts@0
36 displayName: 'Download artifact: embed'
Miss Islington (bot)12f33122019-07-13 03:10:33 -070037 condition: and(succeeded(), not(variables['BuildToPublish']))
Steve Dowerf78e66c2019-06-14 14:20:16 -070038 inputs:
39 artifactName: embed
40 downloadPath: $(Build.BinariesDirectory)
41
Miss Islington (bot)12f33122019-07-13 03:10:33 -070042
43 - task: DownloadPipelineArtifact@1
44 displayName: 'Download artifact from $(BuildToPublish): Doc'
45 condition: and(succeeded(), variables['BuildToPublish'])
46 inputs:
47 artifactName: Doc
48 targetPath: $(Build.BinariesDirectory)\Doc
49 buildType: specific
50 project: cpython
51 pipeline: 21
52 buildVersionToDownload: specific
53 buildId: $(BuildToPublish)
54
55 - task: DownloadPipelineArtifact@1
56 displayName: 'Download artifact from $(BuildToPublish): msi'
57 condition: and(succeeded(), variables['BuildToPublish'])
58 inputs:
59 artifactName: msi
60 targetPath: $(Build.BinariesDirectory)\msi
61 buildType: specific
62 project: cpython
63 pipeline: 21
64 buildVersionToDownload: specific
65 buildId: $(BuildToPublish)
66
67 - task: DownloadBuildArtifacts@0
68 displayName: 'Download artifact from $(BuildToPublish): embed'
69 condition: and(succeeded(), variables['BuildToPublish'])
70 inputs:
71 artifactName: embed
72 downloadPath: $(Build.BinariesDirectory)
73 buildType: specific
74 project: cpython
75 pipeline: Windows-Release
76 buildVersionToDownload: specific
77 buildId: $(BuildToPublish)
78
79
80 - template: ./gpg-sign.yml
81 parameters:
82 GPGKeyFile: 'python-signing.key'
83 Files: 'doc\htmlhelp\*.chm, msi\*\*, embed\*.zip'
84
85 - powershell: >
86 $(Build.SourcesDirectory)\Tools\msi\uploadrelease.ps1
87 -build msi
88 -user $(PyDotOrgUsername)
89 -server $(PyDotOrgServer)
90 -doc_htmlhelp doc\htmlhelp
91 -embed embed
92 -skippurge
93 -skiptest
94 -skiphash
95 condition: and(succeeded(), eq(variables['SigningCertificate'], variables['__RealSigningCertificate']))
96 workingDirectory: $(Build.BinariesDirectory)
97 displayName: 'Upload files to python.org'
98
99 - powershell: >
100 python
101 "$(Build.SourcesDirectory)\Tools\msi\purge.py"
102 (gci msi\*\python-*.exe | %{ $_.Name -replace 'python-(.+?)(-|\.exe).+', '$1' } | select -First 1)
103 workingDirectory: $(Build.BinariesDirectory)
104 displayName: 'Purge CDN'
105
106 - powershell: |
107 $failures = 0
108 gci "msi\*\*-webinstall.exe" -File | %{
109 $d = mkdir "tests\$($_.BaseName)" -Force
110 gci $d -r -File | del
111 $ic = copy $_ $d -PassThru
112 "Checking layout for $($ic.Name)"
113 Start-Process -wait $ic "/passive", "/layout", "$d\layout", "/log", "$d\log\install.log"
114 if (-not $?) {
115 Write-Error "Failed to validate layout of $($inst.Name)"
116 $failures += 1
117 }
118 }
119 if ($failures) {
120 Write-Error "Failed to validate $failures installers"
121 exit 1
122 }
123 #condition: and(succeeded(), eq(variables['SigningCertificate'], variables['__RealSigningCertificate']))
124 workingDirectory: $(Build.BinariesDirectory)
125 displayName: 'Test layouts'
126
127 - powershell: |
128 $hashes = gci doc\htmlhelp\python*.chm, msi\*\*.exe, embed\*.zip | `
129 Sort-Object Name | `
130 Format-Table Name, @{
131 Label="MD5";
132 Expression={(Get-FileHash $_ -Algorithm MD5).Hash}
133 }, Length -AutoSize | `
134 Out-String -Width 4096
135 $d = mkdir "$(Build.ArtifactStagingDirectory)\hashes" -Force
136 $hashes | Out-File "$d\hashes.txt" -Encoding ascii
137 $hashes
138 workingDirectory: $(Build.BinariesDirectory)
139 displayName: 'Generate hashes'
140
141 - powershell: |
142 "Copying:"
143 (gci msi\*\python*.asc, doc\htmlhelp\*.asc, embed\*.asc).FullName
144 $d = mkdir "$(Build.ArtifactStagingDirectory)\hashes" -Force
145 move msi\*\python*.asc, doc\htmlhelp\*.asc, embed\*.asc $d -Force
146 gci msi -Directory | %{ move "msi\$_\*.asc" (mkdir "$d\$_" -Force) }
147 workingDirectory: $(Build.BinariesDirectory)
148 displayName: 'Copy GPG signatures for build'
149
150 - task: PublishPipelineArtifact@0
151 displayName: 'Publish Artifact: hashes'
152 inputs:
153 targetPath: '$(Build.ArtifactStagingDirectory)\hashes'
154 artifactName: hashes