2019-06-14 15:29:20 +00:00
|
|
|
parameters:
|
|
|
|
ShouldPGO: false
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- template: ./checkout.yml
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
$d = (.\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }};
|
|
|
|
Write-Host "##vso[task.setvariable variable=VersionText]$($d.PythonVersion)"
|
|
|
|
Write-Host "##vso[task.setvariable variable=VersionNumber]$($d.PythonVersionNumber)"
|
|
|
|
Write-Host "##vso[task.setvariable variable=VersionHex]$($d.PythonVersionHex)"
|
|
|
|
Write-Host "##vso[task.setvariable variable=VersionUnique]$($d.PythonVersionUnique)"
|
|
|
|
Write-Host "##vso[build.addbuildtag]$($d.PythonVersion)"
|
|
|
|
Write-Host "##vso[build.addbuildtag]$($d.PythonVersion)-$(Name)"
|
|
|
|
displayName: 'Extract version numbers'
|
|
|
|
|
|
|
|
- ${{ if eq(parameters.ShouldPGO, 'false') }}:
|
|
|
|
- powershell: |
|
|
|
|
$env:SigningCertificate = $null
|
|
|
|
.\PCbuild\build.bat -v -p $(Platform) -c $(Configuration)
|
|
|
|
displayName: 'Run build'
|
|
|
|
env:
|
|
|
|
IncludeUwp: true
|
|
|
|
Py_OutDir: '$(Build.BinariesDirectory)\bin'
|
|
|
|
|
|
|
|
- ${{ if eq(parameters.ShouldPGO, 'true') }}:
|
|
|
|
- powershell: |
|
|
|
|
$env:SigningCertificate = $null
|
|
|
|
.\PCbuild\build.bat -v -p $(Platform) --pgo
|
|
|
|
displayName: 'Run build with PGO'
|
|
|
|
env:
|
|
|
|
IncludeUwp: true
|
|
|
|
Py_OutDir: '$(Build.BinariesDirectory)\bin'
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
$kitroot = (gp 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\').KitsRoot10
|
|
|
|
$tool = (gci -r "$kitroot\Bin\*\x64\signtool.exe" | sort FullName -Desc | select -First 1)
|
|
|
|
if (-not $tool) {
|
|
|
|
throw "SDK is not available"
|
|
|
|
}
|
|
|
|
Write-Host "##vso[task.prependpath]$($tool.Directory)"
|
|
|
|
displayName: 'Add WinSDK tools to path'
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
$env:SigningCertificate = $null
|
2019-12-10 05:10:22 +00:00
|
|
|
$(_HostPython) PC\layout -vv -b "$(Build.BinariesDirectory)\bin" -t "$(Build.BinariesDirectory)\catalog" --catalog "${env:CAT}.cdf" --preset-default --arch $(Arch)
|
2019-06-14 15:29:20 +00:00
|
|
|
makecat "${env:CAT}.cdf"
|
|
|
|
del "${env:CAT}.cdf"
|
|
|
|
if (-not (Test-Path "${env:CAT}.cat")) {
|
|
|
|
throw "Failed to build catalog file"
|
|
|
|
}
|
|
|
|
displayName: 'Generate catalog'
|
|
|
|
env:
|
|
|
|
CAT: $(Build.BinariesDirectory)\bin\$(Arch)\python
|
2019-11-20 17:30:47 +00:00
|
|
|
PYTHON_HEXVERSION: $(VersionHex)
|
2019-06-14 15:29:20 +00:00
|
|
|
|
2019-06-17 22:27:36 +00:00
|
|
|
- task: PublishPipelineArtifact@0
|
2019-06-14 15:29:20 +00:00
|
|
|
displayName: 'Publish binaries'
|
|
|
|
condition: and(succeeded(), not(and(eq(variables['Configuration'], 'Release'), variables['SigningCertificate'])))
|
|
|
|
inputs:
|
2019-06-17 22:27:36 +00:00
|
|
|
targetPath: '$(Build.BinariesDirectory)\bin\$(Arch)'
|
|
|
|
artifactName: bin_$(Name)
|
2019-06-14 15:29:20 +00:00
|
|
|
|
2019-06-17 22:27:36 +00:00
|
|
|
- task: PublishPipelineArtifact@0
|
2019-06-14 15:29:20 +00:00
|
|
|
displayName: 'Publish binaries for signing'
|
|
|
|
condition: and(succeeded(), and(eq(variables['Configuration'], 'Release'), variables['SigningCertificate']))
|
|
|
|
inputs:
|
2019-06-17 22:27:36 +00:00
|
|
|
targetPath: '$(Build.BinariesDirectory)\bin\$(Arch)'
|
|
|
|
artifactName: unsigned_bin_$(Name)
|
2019-06-14 15:29:20 +00:00
|
|
|
|
|
|
|
- task: CopyFiles@2
|
|
|
|
displayName: 'Layout Artifact: symbols'
|
|
|
|
inputs:
|
|
|
|
sourceFolder: $(Build.BinariesDirectory)\bin\$(Arch)
|
|
|
|
targetFolder: $(Build.ArtifactStagingDirectory)\symbols\$(Name)
|
|
|
|
flatten: true
|
|
|
|
contents: |
|
|
|
|
**\*.pdb
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish Artifact: symbols'
|
|
|
|
inputs:
|
|
|
|
PathToPublish: '$(Build.ArtifactStagingDirectory)\symbols'
|
|
|
|
ArtifactName: symbols
|