Skip to content

Commit d56a237

Browse files
authored
Fix some Windows release build script issues (GH-31931)
* Fix the condition used when excluding ARM64 packages from publish * Do not publish anything unless the traditional installer works * Fix disabling of MSI build * Add override conditions for publish steps * Allow overriding the Nuget version number during build
1 parent e707ceb commit d56a237

File tree

5 files changed

+85
-59
lines changed

5 files changed

+85
-59
lines changed

.azure-pipelines/windows-release.yml

+63-52
Original file line numberDiff line numberDiff line change
@@ -136,69 +136,80 @@ stages:
136136
- template: windows-release/stage-test-embed.yml
137137
- template: windows-release/stage-test-nuget.yml
138138

139-
- stage: Layout_MSIX
140-
displayName: Generate MSIX layouts
141-
dependsOn: Sign
142-
condition: and(succeeded(), eq(variables['DoMSIX'], 'true'))
143-
jobs:
144-
- template: windows-release/stage-layout-msix.yml
145-
parameters:
146-
ARM64TclTk: ${{ parameters.ARM64TclTk }}
147-
148-
- stage: Pack_MSIX
149-
displayName: Package MSIX
150-
dependsOn: Layout_MSIX
151-
jobs:
152-
- template: windows-release/stage-pack-msix.yml
153-
154-
- stage: Build_MSI
155-
displayName: Build MSI installer
156-
dependsOn: Sign
157-
condition: and(succeeded(), eq(variables['DoMSI'], 'true'))
158-
jobs:
159-
- template: windows-release/stage-msi.yml
160-
parameters:
161-
ARM64TclTk: ${{ parameters.ARM64TclTk }}
162-
163-
- stage: Test_MSI
164-
displayName: Test MSI installer
165-
dependsOn: Build_MSI
166-
jobs:
167-
- template: windows-release/stage-test-msi.yml
139+
- ${{ if eq(parameters.DoMSIX, 'true') }}:
140+
- stage: Layout_MSIX
141+
displayName: Generate MSIX layouts
142+
dependsOn: Sign
143+
jobs:
144+
- template: windows-release/stage-layout-msix.yml
145+
parameters:
146+
ARM64TclTk: ${{ parameters.ARM64TclTk }}
168147

169-
- ${{ if eq(parameters.DoPublish, 'true') }}:
170-
- stage: PublishPyDotOrg
171-
displayName: Publish to python.org
172-
dependsOn: ['Test_MSI', 'Test']
148+
- stage: Pack_MSIX
149+
displayName: Package MSIX
150+
dependsOn: Layout_MSIX
173151
jobs:
174-
- template: windows-release/stage-publish-pythonorg.yml
152+
- template: windows-release/stage-pack-msix.yml
175153

176-
- stage: PublishNuget
177-
displayName: Publish to nuget.org
178-
dependsOn: Test
154+
- ${{ if eq(parameters.DoMSI, 'true') }}:
155+
- stage: Build_MSI
156+
displayName: Build MSI installer
157+
dependsOn: Sign
179158
jobs:
180-
- template: windows-release/stage-publish-nugetorg.yml
159+
- template: windows-release/stage-msi.yml
160+
parameters:
161+
ARM64TclTk: ${{ parameters.ARM64TclTk }}
181162

182-
- stage: PublishStore
183-
displayName: Publish to Store
184-
dependsOn: Pack_MSIX
163+
- stage: Test_MSI
164+
displayName: Test MSI installer
165+
dependsOn: Build_MSI
185166
jobs:
186-
- template: windows-release/stage-publish-store.yml
167+
- template: windows-release/stage-test-msi.yml
168+
169+
- ${{ if eq(parameters.DoPublish, 'true') }}:
170+
- ${{ if eq(parameters.DoMSI, 'true') }}:
171+
- stage: PublishPyDotOrg
172+
displayName: Publish to python.org
173+
dependsOn: ['Test_MSI', 'Test']
174+
jobs:
175+
- template: windows-release/stage-publish-pythonorg.yml
176+
177+
- ${{ if eq(parameters.DoNuget, 'true') }}:
178+
- stage: PublishNuget
179+
displayName: Publish to nuget.org
180+
${{ if eq(parameters.DoMSI, 'true') }}:
181+
dependsOn: ['Test_MSI', 'Test']
182+
${{ else }}:
183+
dependsOn: 'Test'
184+
jobs:
185+
- template: windows-release/stage-publish-nugetorg.yml
186+
187+
- ${{ if eq(parameters.DoMSIX, 'true') }}:
188+
- stage: PublishStore
189+
displayName: Publish to Store
190+
${{ if eq(parameters.DoMSI, 'true') }}:
191+
dependsOn: ['Test_MSI', 'Pack_MSIX']
192+
${{ else }}:
193+
dependsOn: 'Pack_MSIX'
194+
jobs:
195+
- template: windows-release/stage-publish-store.yml
187196

188197
- ${{ else }}:
189198
- stage: PublishExisting
190199
displayName: Publish existing build
191200
dependsOn: []
192-
condition: and(succeeded(), eq(variables['DoPublish'], 'true'))
193201
jobs:
194-
- template: windows-release/stage-publish-pythonorg.yml
195-
parameters:
196-
BuildToPublish: ${{ parameters.BuildToPublish }}
202+
- ${{ if eq(parameters.DoMSI, 'true') }}:
203+
- template: windows-release/stage-publish-pythonorg.yml
204+
parameters:
205+
BuildToPublish: ${{ parameters.BuildToPublish }}
197206

198-
- template: windows-release/stage-publish-nugetorg.yml
199-
parameters:
200-
BuildToPublish: ${{ parameters.BuildToPublish }}
207+
- ${{ if eq(parameters.DoNuget, 'true') }}:
208+
- template: windows-release/stage-publish-nugetorg.yml
209+
parameters:
210+
BuildToPublish: ${{ parameters.BuildToPublish }}
201211

202-
- template: windows-release/stage-publish-store.yml
203-
parameters:
204-
BuildToPublish: ${{ parameters.BuildToPublish }}
212+
- ${{ if eq(parameters.DoMSIX, 'true') }}:
213+
- template: windows-release/stage-publish-store.yml
214+
parameters:
215+
BuildToPublish: ${{ parameters.BuildToPublish }}

.azure-pipelines/windows-release/stage-pack-nuget.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,23 @@ jobs:
3232
inputs:
3333
versionSpec: '>=5.0'
3434

35-
- powershell: |
36-
nuget pack "$(Build.BinariesDirectory)\layout\python.nuspec" -OutputDirectory $(Build.ArtifactStagingDirectory) -NoPackageAnalysis -NonInteractive
35+
- powershell: >
36+
nuget pack
37+
"$(Build.BinariesDirectory)\layout\python.nuspec"
38+
-OutputDirectory $(Build.ArtifactStagingDirectory)
39+
-NoPackageAnalysis
40+
-NonInteractive
41+
condition: and(succeeded(), not(variables['OverrideNugetVersion']))
42+
displayName: 'Create nuget package'
43+
44+
- powershell: >
45+
nuget pack
46+
"$(Build.BinariesDirectory)\layout\python.nuspec"
47+
-OutputDirectory $(Build.ArtifactStagingDirectory)
48+
-NoPackageAnalysis
49+
-NonInteractive
50+
-Version "$(OverrideNugetVersion)"
51+
condition: and(succeeded(), variables['OverrideNugetVersion'])
3752
displayName: 'Create nuget package'
3853
3954
- powershell: |

.azure-pipelines/windows-release/stage-publish-nugetorg.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ parameters:
44
jobs:
55
- job: Publish_Nuget
66
displayName: Publish Nuget packages
7-
condition: and(succeeded(), eq(variables['DoNuget'], 'true'))
7+
condition: and(succeeded(), eq(variables['DoNuget'], 'true'), ne(variables['SkipNugetPublish'], 'true'))
88

99
pool:
1010
vmImage: windows-2022
@@ -38,7 +38,7 @@ jobs:
3838
- powershell: 'gci pythonarm*.nupkg | %{ Write-Host "Not publishing: $($_.Name)"; gi $_ } | del'
3939
displayName: 'Prevent publishing ARM64 packages'
4040
workingDirectory: '$(Build.BinariesDirectory)\nuget'
41-
condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
41+
condition: and(succeeded(), ne(variables['PublishARM64'], 'true'))
4242

4343
- task: NuGetCommand@2
4444
displayName: Push packages

.azure-pipelines/windows-release/stage-publish-pythonorg.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ parameters:
44
jobs:
55
- job: Publish_Python
66
displayName: Publish python.org packages
7-
condition: and(succeeded(), and(eq(variables['DoMSI'], 'true'), eq(variables['DoEmbed'], 'true')))
7+
condition: and(succeeded(), eq(variables['DoMSI'], 'true'), eq(variables['DoEmbed'], 'true'), ne(variables['SkipPythonOrgPublish'], 'true'))
88

99
pool:
1010
#vmImage: windows-2022
@@ -81,7 +81,7 @@ jobs:
8181
- powershell: 'gci *embed-arm*.zip | %{ Write-Host "Not publishing: $($_.Name)"; gi $_ } | del'
8282
displayName: 'Prevent publishing ARM64 packages'
8383
workingDirectory: '$(Build.BinariesDirectory)\embed'
84-
condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
84+
condition: and(succeeded(), ne(variables['PublishARM64'], 'true'))
8585

8686

8787
- template: ./gpg-sign.yml

.azure-pipelines/windows-release/stage-publish-store.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ parameters:
44
jobs:
55
- job: Publish_Store
66
displayName: Publish Store packages
7-
condition: and(succeeded(), eq(variables['DoMSIX'], 'true'))
7+
condition: and(succeeded(), eq(variables['DoMSIX'], 'true'), ne(variables['SkipMSIXPublish'], 'true'))
88

99
pool:
1010
vmImage: windows-2022

0 commit comments

Comments
 (0)