|
1 | 1 | parameters:
|
2 | 2 | BuildToPublish: ''
|
| 3 | + HashAlgorithms: ['SHA256', 'MD5'] |
3 | 4 |
|
4 | 5 | jobs:
|
5 | 6 | - job: Publish_Python
|
@@ -154,23 +155,24 @@ jobs:
|
154 | 155 | workingDirectory: $(Build.BinariesDirectory)
|
155 | 156 | displayName: 'Test layouts'
|
156 | 157 |
|
157 |
| - - powershell: | |
158 |
| - $files = gci -File "msi\*\*.exe", "embed\*.zip" |
159 |
| -
8000
if ("$(DoCHM)" -ieq "true") { |
160 |
| - $files = $files + (gci -File "doc\htmlhelp\python*.chm") |
161 |
| - } |
162 |
| - $hashes = $files | ` |
163 |
| - Sort-Object Name | ` |
164 |
| - Format-Table Name, @{ |
165 |
| - Label="MD5"; |
166 |
| - Expression={(Get-FileHash $_ -Algorithm MD5).Hash} |
167 |
| - }, Length -AutoSize | ` |
168 |
| - Out-String -Width 4096 |
169 |
| - $d = mkdir "$(Build.ArtifactStagingDirectory)\hashes" -Force |
170 |
| - $hashes | Out-File "$d\hashes.txt" -Encoding ascii |
171 |
| - $hashes |
172 |
| - workingDirectory: $(Build.BinariesDirectory) |
173 |
| - displayName: 'Generate hashes' |
| 158 | + - ${{ each alg in parameters.HashAlgorithms }}: |
| 159 | + - powershell: | |
| 160 | + $files = gci -File "msi\*\*.exe", "embed\*.zip" |
| 161 | + if ("$(DoCHM)" -ieq "true") { |
| 162 | + $files = $files + (gci -File "doc\htmlhelp\python*.chm") |
| 163 | + } |
| 164 | + $hashes = $files | ` |
| 165 | + Sort-Object Name | ` |
| 166 | + Format-Table Name, @{ |
| 167 | + Label="${{ alg }}"; |
| 168 | + Expression={(Get-FileHash $_ -Algorithm ${{ alg }}).Hash} |
| 169 | + }, Length -AutoSize | ` |
| 170 | + Out-String -Width 4096 |
| 171 | + $d = mkdir "$(Build.ArtifactStagingDirectory)\hashes" -Force |
| 172 | + $hashes | Out-File "$d\hashes.txt" -Encoding ascii -Append |
| 173 | + $hashes |
| 174 | + workingDirectory: $(Build.BinariesDirectory) |
| 175 | + displayName: 'Generate hashes (${{ alg }})' |
174 | 176 |
|
175 | 177 | - powershell: |
|
176 | 178 | "Copying:"
|
|
0 commit comments