|
4 | 4 | condition: and(succeeded(), and(eq(variables['DoMSI'], 'true'), eq(variables['DoEmbed'], 'true'))) |
5 | 5 |
|
6 | 6 | pool: |
7 | | - vmName: win2016-vs2017 |
| 7 | + #vmName: win2016-vs2017 |
| 8 | + name: 'Windows Release' |
8 | 9 |
|
9 | 10 | workspace: |
10 | 11 | clean: all |
11 | 12 |
|
12 | 13 | steps: |
13 | | - - checkout: none |
| 14 | + - template: ./checkout.yml |
14 | 15 |
|
15 | | - - task: DownloadBuildArtifacts@0 |
| 16 | + - task: UsePythonVersion@0 |
| 17 | + displayName: 'Use Python 3.6 or later' |
| 18 | + inputs: |
| 19 | + versionSpec: '>=3.6' |
| 20 | + |
| 21 | + - task: DownloadPipelineArtifact@1 |
16 | 22 | displayName: 'Download artifact: Doc' |
| 23 | + condition: and(succeeded(), not(variables['BuildToPublish'])) |
17 | 24 | inputs: |
18 | 25 | artifactName: Doc |
19 | | - downloadPath: $(Build.BinariesDirectory) |
| 26 | + targetPath: $(Build.BinariesDirectory)\Doc |
20 | 27 |
|
21 | | - - task: DownloadBuildArtifacts@0 |
| 28 | + - task: DownloadPipelineArtifact@1 |
22 | 29 | displayName: 'Download artifact: msi' |
| 30 | + condition: and(succeeded(), not(variables['BuildToPublish'])) |
23 | 31 | inputs: |
24 | 32 | artifactName: msi |
25 | | - downloadPath: $(Build.BinariesDirectory) |
| 33 | + targetPath: $(Build.BinariesDirectory)\msi |
26 | 34 |
|
27 | 35 | - task: DownloadBuildArtifacts@0 |
28 | 36 | displayName: 'Download artifact: embed' |
| 37 | + condition: and(succeeded(), not(variables['BuildToPublish'])) |
| 38 | + inputs: |
| 39 | + artifactName: embed |
| 40 | + downloadPath: $(Build.BinariesDirectory) |
| 41 | + |
| 42 | + |
| 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']) |
29 | 70 | inputs: |
30 | 71 | artifactName: embed |
31 | 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' |
32 | 84 |
|
33 | | - # TODO: eq(variables['SigningCertificate'], 'Python Software Foundation') |
34 | | - # If we are not real-signed, DO NOT PUBLISH |
| 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 |
0 commit comments