-
-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathstage-pack-msix.yml
More file actions
134 lines (113 loc) · 4.41 KB
/
stage-pack-msix.yml
File metadata and controls
134 lines (113 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
parameters:
SigningCertificate: ''
jobs:
- job: Pack_MSIX
displayName: Pack MSIX bundles
workspace:
clean: all
variables:
SigningCertificate: ${{ parameters.SigningCertificate }}
strategy:
matrix:
amd64:
Name: amd64
Artifact: appx
Suffix:
ShouldSign: true
amd64_store:
Name: amd64
Artifact: appxstore
Suffix: -store
CreateMsixUpload: true
arm64:
Name: arm64
Artifact: appx
Suffix:
ShouldSign: true
arm64_store:
Name: arm64
Artifact: appxstore
Suffix: -store
CreateMsixUpload: true
steps:
- template: ./checkout.yml
- download: current
artifact: layout_$(Artifact)_$(Name)
displayName: 'Download artifact: layout_$(Artifact)_$(Name)'
- download: current
artifact: symbols
patterns: $(Name)\*
displayName: 'Download artifact: symbols'
- 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: |
./Tools/msi/make_appx.ps1 -layout "$(Pipeline.Workspace)\layout_$(Artifact)_$(Name)" -msix "$(Build.ArtifactStagingDirectory)\msix\$(Filename).msix"
displayName: 'Build msix'
- powershell: |
7z a -tzip "$(Build.ArtifactStagingDirectory)\msix\$(Filename).appxsym" *.pdb
displayName: 'Build appxsym'
workingDirectory: $(Pipeline.Workspace)\symbols\$(Name)
- powershell: |
7z a -tzip "$(Build.ArtifactStagingDirectory)\msixupload\$(Filename).msixupload" *
displayName: 'Build msixupload'
condition: and(succeeded(), eq(variables['CreateMsixUpload'], 'true'))
workingDirectory: $(Build.ArtifactStagingDirectory)\msix
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: MSIX'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\msix'
${{ if parameters.SigningCertificate }}:
ArtifactName: unsigned_msix
${{ else }}:
ArtifactName: msix
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: MSIXUpload'
condition: and(succeeded(), eq(variables['CreateMsixUpload'], 'true'))
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\msixupload'
ArtifactName: msixupload
- ${{ if parameters.SigningCertificate }}:
- job: Sign_MSIX
displayName: Sign side-loadable MSIX bundles
dependsOn:
- Pack_MSIX
workspace:
clean: all
variables:
- ${{ if eq(parameters.SigningCertificate, 'PythonSoftwareFoundation') }}:
- group: CPythonSign
- ${{ if eq(parameters.SigningCertificate, 'TestSign') }}:
- group: CPythonTestSign
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=SigningDescription]Python $($d.PythonVersion)"
displayName: 'Update signing description'
condition: and(succeeded(), not(variables['SigningDescription']))
- task: DownloadBuildArtifacts@0
displayName: 'Download Artifact: unsigned_msix'
inputs:
artifactName: unsigned_msix
downloadPath: $(Build.BinariesDirectory)
# Getting "Error: SignerSign() failed." (-2147024885/0x8007000b)"?
# It may be that the certificate info collected in stage-sign.yml is wrong. Check that
# you do not have multiple matches for the certificate name you have specified.
- template: sign-files.yml
parameters:
Include: '*.msix'
# Additional filter to avoid recursively signing package contents
Filter: '*.msix'
WorkingDir: $(Build.BinariesDirectory)\unsigned_msix
SigningCertificate: ${{ parameters.SigningCertificate }}
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: MSIX'
inputs:
PathtoPublish: '$(Build.BinariesDirectory)\unsigned_msix'
ArtifactName: msix