2019-06-14 12:29:20 -03:00
|
|
|
jobs:
|
|
|
|
- job: Pack_MSIX
|
|
|
|
displayName: Pack MSIX bundles
|
|
|
|
|
|
|
|
pool:
|
2020-02-28 20:21:46 -04:00
|
|
|
vmImage: windows-2019
|
2019-06-14 12:29:20 -03:00
|
|
|
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
amd64:
|
|
|
|
Name: amd64
|
|
|
|
Artifact: appx
|
|
|
|
Suffix:
|
|
|
|
ShouldSign: true
|
|
|
|
amd64_store:
|
|
|
|
Name: amd64
|
|
|
|
Artifact: appxstore
|
|
|
|
Suffix: -store
|
|
|
|
Upload: true
|
2019-11-20 13:30:47 -04:00
|
|
|
arm64:
|
|
|
|
Name: arm64
|
|
|
|
Artifact: appx
|
|
|
|
Suffix:
|
|
|
|
ShouldSign: true
|
|
|
|
arm64_store:
|
|
|
|
Name: arm64
|
|
|
|
Artifact: appxstore
|
|
|
|
Suffix: -store
|
|
|
|
Upload: true
|
2019-06-14 12:29:20 -03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- template: ./checkout.yml
|
|
|
|
|
2019-06-17 19:27:36 -03:00
|
|
|
- task: DownloadPipelineArtifact@1
|
2019-06-14 12:29:20 -03:00
|
|
|
displayName: 'Download artifact: layout_$(Artifact)_$(Name)'
|
|
|
|
inputs:
|
|
|
|
artifactName: layout_$(Artifact)_$(Name)
|
2019-06-17 19:27:36 -03:00
|
|
|
targetPath: $(Build.BinariesDirectory)\layout
|
2019-06-14 12:29:20 -03:00
|
|
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: 'Download artifact: symbols'
|
|
|
|
inputs:
|
|
|
|
artifactName: symbols
|
|
|
|
downloadPath: $(Build.BinariesDirectory)
|
|
|
|
|
|
|
|
- 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[task.setvariable variable=Filename]python-$($d.PythonVersion)-$(Name)$(Suffix)"
|
|
|
|
displayName: 'Extract version numbers'
|
|
|
|
|
|
|
|
- powershell: |
|
2019-06-17 19:27:36 -03:00
|
|
|
./Tools/msi/make_appx.ps1 -layout "$(Build.BinariesDirectory)\layout" -msix "$(Build.ArtifactStagingDirectory)\msix\$(Filename).msix"
|
2019-06-14 12:29:20 -03:00
|
|
|
displayName: 'Build msix'
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
7z a -tzip "$(Build.ArtifactStagingDirectory)\msix\$(Filename).appxsym" *.pdb
|
|
|
|
displayName: 'Build appxsym'
|
|
|
|
workingDirectory: $(Build.BinariesDirectory)\symbols\$(Name)
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish Artifact: MSIX'
|
|
|
|
condition: and(succeeded(), or(ne(variables['ShouldSign'], 'true'), not(variables['SigningCertificate'])))
|
|
|
|
inputs:
|
|
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)\msix'
|
|
|
|
ArtifactName: msix
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish Artifact: MSIX'
|
|
|
|
condition: and(succeeded(), and(eq(variables['ShouldSign'], 'true'), variables['SigningCertificate']))
|
|
|
|
inputs:
|
|
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)\msix'
|
|
|
|
ArtifactName: unsigned_msix
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
7z a -tzip "$(Build.ArtifactStagingDirectory)\msixupload\$(Filename).msixupload" *
|
|
|
|
displayName: 'Build msixupload'
|
|
|
|
condition: and(succeeded(), eq(variables['Upload'], 'true'))
|
|
|
|
workingDirectory: $(Build.ArtifactStagingDirectory)\msix
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish Artifact: MSIXUpload'
|
|
|
|
condition: and(succeeded(), eq(variables['Upload'], 'true'))
|
|
|
|
inputs:
|
|
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)\msixupload'
|
|
|
|
ArtifactName: msixupload
|
|
|
|
|
|
|
|
|
|
|
|
- job: Sign_MSIX
|
|
|
|
displayName: Sign side-loadable MSIX bundles
|
|
|
|
dependsOn:
|
|
|
|
- Pack_MSIX
|
|
|
|
condition: and(succeeded(), variables['SigningCertificate'])
|
|
|
|
|
|
|
|
pool:
|
|
|
|
name: 'Windows Release'
|
|
|
|
|
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
|
|
|
|
steps:
|
2020-08-06 13:36:22 -03:00
|
|
|
- template: ./checkout.yml
|
2019-06-14 12:29:20 -03:00
|
|
|
- template: ./find-sdk.yml
|
|
|
|
|
2020-08-06 13:36:22 -03:00
|
|
|
- powershell: |
|
|
|
|
$d = (.\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }};
|
|
|
|
Write-Host "##vso[task.setvariable variable=SigningDescription]Python $($d.PythonVersion)"
|
|
|
|
displayName: 'Update signing description'
|
|
|
|
condition: and(succeeded(), not(variables['SigningDescription']))
|
|
|
|
|
2019-06-14 12:29:20 -03:00
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
displayName: 'Download Artifact: unsigned_msix'
|
|
|
|
inputs:
|
|
|
|
artifactName: unsigned_msix
|
|
|
|
downloadPath: $(Build.BinariesDirectory)
|
|
|
|
|
2020-11-03 18:31:49 -04:00
|
|
|
# MSIX must be signed and timestamped simultaneously
|
2019-06-14 12:29:20 -03:00
|
|
|
- powershell: |
|
|
|
|
$failed = $true
|
|
|
|
foreach ($retry in 1..3) {
|
2020-11-03 18:31:49 -04:00
|
|
|
signtool sign /a /n "$(SigningCertificate)" /fd sha256 /tr http://timestamp.digicert.com/ /td sha256 /d "$(SigningDescription)" (gi *.msix)
|
2019-06-14 12:29:20 -03:00
|
|
|
if ($?) {
|
|
|
|
$failed = $false
|
|
|
|
break
|
|
|
|
}
|
|
|
|
sleep 1
|
|
|
|
}
|
|
|
|
if ($failed) {
|
|
|
|
throw "Failed to sign MSIX"
|
|
|
|
}
|
|
|
|
displayName: 'Sign MSIX'
|
|
|
|
workingDirectory: $(Build.BinariesDirectory)\unsigned_msix
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish Artifact: MSIX'
|
|
|
|
inputs:
|
|
|
|
PathtoPublish: '$(Build.BinariesDirectory)\unsigned_msix'
|
|
|
|
ArtifactName: msix
|