Skip to content

Commit

Permalink
Fix some Windows release build script issues (pythonGH-31931)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
zooba authored Mar 16, 2022
1 parent e707ceb commit d56a237
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 59 deletions.
115 changes: 63 additions & 52 deletions .azure-pipelines/windows-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,69 +136,80 @@ stages:
- template: windows-release/stage-test-embed.yml
- template: windows-release/stage-test-nuget.yml

- stage: Layout_MSIX
displayName: Generate MSIX layouts
dependsOn: Sign
condition: and(succeeded(), eq(variables['DoMSIX'], 'true'))
jobs:
- template: windows-release/stage-layout-msix.yml
parameters:
ARM64TclTk: ${{ parameters.ARM64TclTk }}

- stage: Pack_MSIX
displayName: Package MSIX
dependsOn: Layout_MSIX
jobs:
- template: windows-release/stage-pack-msix.yml

- stage: Build_MSI
displayName: Build MSI installer
dependsOn: Sign
condition: and(succeeded(), eq(variables['DoMSI'], 'true'))
jobs:
- template: windows-release/stage-msi.yml
parameters:
ARM64TclTk: ${{ parameters.ARM64TclTk }}

- stage: Test_MSI
displayName: Test MSI installer
dependsOn: Build_MSI
jobs:
- template: windows-release/stage-test-msi.yml
- ${{ if eq(parameters.DoMSIX, 'true') }}:
- stage: Layout_MSIX
displayName: Generate MSIX layouts
dependsOn: Sign
jobs:
- template: windows-release/stage-layout-msix.yml
parameters:
ARM64TclTk: ${{ parameters.ARM64TclTk }}

- ${{ if eq(parameters.DoPublish, 'true') }}:
- stage: PublishPyDotOrg
displayName: Publish to python.org
dependsOn: ['Test_MSI', 'Test']
- stage: Pack_MSIX
displayName: Package MSIX
dependsOn: Layout_MSIX
jobs:
- template: windows-release/stage-publish-pythonorg.yml
- template: windows-release/stage-pack-msix.yml

- stage: PublishNuget
displayName: Publish to nuget.org
dependsOn: Test
- ${{ if eq(parameters.DoMSI, 'true') }}:
- stage: Build_MSI
displayName: Build MSI installer
dependsOn: Sign
jobs:
- template: windows-release/stage-publish-nugetorg.yml
- template: windows-release/stage-msi.yml
parameters:
ARM64TclTk: ${{ parameters.ARM64TclTk }}

- stage: PublishStore
displayName: Publish to Store
dependsOn: Pack_MSIX
- stage: Test_MSI
displayName: Test MSI installer
dependsOn: Build_MSI
jobs:
- template: windows-release/stage-publish-store.yml
- template: windows-release/stage-test-msi.yml

- ${{ if eq(parameters.DoPublish, 'true') }}:
- ${{ if eq(parameters.DoMSI, 'true') }}:
- stage: PublishPyDotOrg
displayName: Publish to python.org
dependsOn: ['Test_MSI', 'Test']
jobs:
- template: windows-release/stage-publish-pythonorg.yml

- ${{ if eq(parameters.DoNuget, 'true') }}:
- stage: PublishNuget
displayName: Publish to nuget.org
${{ if eq(parameters.DoMSI, 'true') }}:
dependsOn: ['Test_MSI', 'Test']
${{ else }}:
dependsOn: 'Test'
jobs:
- template: windows-release/stage-publish-nugetorg.yml

- ${{ if eq(parameters.DoMSIX, 'true') }}:
- stage: PublishStore
displayName: Publish to Store
${{ if eq(parameters.DoMSI, 'true') }}:
dependsOn: ['Test_MSI', 'Pack_MSIX']
${{ else }}:
dependsOn: 'Pack_MSIX'
jobs:
- template: windows-release/stage-publish-store.yml

- ${{ else }}:
- stage: PublishExisting
displayName: Publish existing build
dependsOn: []
condition: and(succeeded(), eq(variables['DoPublish'], 'true'))
jobs:
- template: windows-release/stage-publish-pythonorg.yml
parameters:
BuildToPublish: ${{ parameters.BuildToPublish }}
- ${{ if eq(parameters.DoMSI, 'true') }}:
- template: windows-release/stage-publish-pythonorg.yml
parameters:
BuildToPublish: ${{ parameters.BuildToPublish }}

- template: windows-release/stage-publish-nugetorg.yml
parameters:
BuildToPublish: ${{ parameters.BuildToPublish }}
- ${{ if eq(parameters.DoNuget, 'true') }}:
- template: windows-release/stage-publish-nugetorg.yml
parameters:
BuildToPublish: ${{ parameters.BuildToPublish }}

- template: windows-release/stage-publish-store.yml
parameters:
BuildToPublish: ${{ parameters.BuildToPublish }}
- ${{ if eq(parameters.DoMSIX, 'true') }}:
- template: windows-release/stage-publish-store.yml
parameters:
BuildToPublish: ${{ parameters.BuildToPublish }}
19 changes: 17 additions & 2 deletions .azure-pipelines/windows-release/stage-pack-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,23 @@ jobs:
inputs:
versionSpec: '>=5.0'

- powershell: |
nuget pack "$(Build.BinariesDirectory)\layout\python.nuspec" -OutputDirectory $(Build.ArtifactStagingDirectory) -NoPackageAnalysis -NonInteractive
- powershell: >
nuget pack
"$(Build.BinariesDirectory)\layout\python.nuspec"
-OutputDirectory $(Build.ArtifactStagingDirectory)
-NoPackageAnalysis
-NonInteractive
condition: and(succeeded(), not(variables['OverrideNugetVersion']))
displayName: 'Create nuget package'
- powershell: >
nuget pack
"$(Build.BinariesDirectory)\layout\python.nuspec"
-OutputDirectory $(Build.ArtifactStagingDirectory)
-NoPackageAnalysis
-NonInteractive
-Version "$(OverrideNugetVersion)"
condition: and(succeeded(), variables['OverrideNugetVersion'])
displayName: 'Create nuget package'
- powershell: |
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/windows-release/stage-publish-nugetorg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
jobs:
- job: Publish_Nuget
displayName: Publish Nuget packages
condition: and(succeeded(), eq(variables['DoNuget'], 'true'))
condition: and(succeeded(), eq(variables['DoNuget'], 'true'), ne(variables['SkipNugetPublish'], 'true'))

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

- task: NuGetCommand@2
displayName: Push packages
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/windows-release/stage-publish-pythonorg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
jobs:
- job: Publish_Python
displayName: Publish python.org packages
condition: and(succeeded(), and(eq(variables['DoMSI'], 'true'), eq(variables['DoEmbed'], 'true')))
condition: and(succeeded(), eq(variables['DoMSI'], 'true'), eq(variables['DoEmbed'], 'true'), ne(variables['SkipPythonOrgPublish'], 'true'))

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


- template: ./gpg-sign.yml
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/windows-release/stage-publish-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
jobs:
- job: Publish_Store
displayName: Publish Store packages
condition: and(succeeded(), eq(variables['DoMSIX'], 'true'))
condition: and(succeeded(), eq(variables['DoMSIX'], 'true'), ne(variables['SkipMSIXPublish'], 'true'))

pool:
vmImage: windows-2022
Expand Down

0 comments on commit d56a237

Please sign in to comment.