diff options
author | Steve Dower <steve.dower@python.org> | 2022-01-22 01:13:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-22 01:13:16 (GMT) |
commit | 70c16468deee9390e34322d32fda57df6e0f46bb (patch) | |
tree | 6279df71970a069f8e655043271a9e443e889a7c /.azure-pipelines/windows-release.yml | |
parent | cd8de40b3b10311de2db7b90abdf80af9e35535f (diff) | |
download | cpython-70c16468deee9390e34322d32fda57df6e0f46bb.zip cpython-70c16468deee9390e34322d32fda57df6e0f46bb.tar.gz cpython-70c16468deee9390e34322d32fda57df6e0f46bb.tar.bz2 |
Improve the Windows release build scripts (GH-30771)
Update to windows-2022 image
Promote queue variables to parameters for better UI
Structure build steps using parameters instead of conditions for simpler status display
Diffstat (limited to '.azure-pipelines/windows-release.yml')
-rw-r--r-- | .azure-pipelines/windows-release.yml | 292 |
1 files changed, 173 insertions, 119 deletions
diff --git a/.azure-pipelines/windows-release.yml b/.azure-pipelines/windows-release.yml index 3d072e3..338c305 100644 --- a/.azure-pipelines/windows-release.yml +++ b/.azure-pipelines/windows-release.yml @@ -1,129 +1,183 @@ name: Release_$(Build.SourceBranchName)_$(SourceTag)_$(Date:yyyyMMdd)$(Rev:.rr) +parameters: +- name: GitRemote + displayName: "Git remote" + type: string + default: python + values: + - 'python' + - 'pablogsal' + - 'ambv' + - '(Other)' +- name: GitRemote_Other + displayName: "If Other, specify Git remote" + type: string + default: 'python' +- name: SourceTag + displayName: "Git tag" + type: string + default: main +- name: DoPublish + displayName: "Publish release" + type: boolean + default: false +- name: SigningCertificate + displayName: "Code signing certificate" + type: string + default: 'Python Software Foundation' + values: + - 'Python Software Foundation' + - 'TestSign' + - 'Unsigned' +- name: SigningDescription + displayName: "Signature description" + type: string + default: 'Built: $(Build.BuildNumber)' +- name: DoPGO + displayName: "Run PGO" + type: boolean + default: true +- name: DoLayout + displayName: "Produce full layout artifact" + type: boolean + default: true +- name: DoMSIX + displayName: "Produce Store packages" + type: boolean + default: true +- name: DoNuget + displayName: "Produce Nuget packages" + type: boolean + default: true +- name: DoEmbed + displayName: "Produce embeddable package" + type: boolean + default: true +- name: DoMSI + displayName: "Produce EXE/MSI installer" + type: boolean + default: true +- name: BuildToPublish + displayName: "Build number to publish (0 to skip)" + type: number + default: '0' + variables: __RealSigningCertificate: 'Python Software Foundation' + ${{ if ne(parameters.GitRemote, '(Other)') }}: + GitRemote: ${{ parameters.GitRemote }} + ${{ else }}: + GitRemote: ${{ parameters.GitRemote_Other }} + SourceTag: ${{ parameters.SourceTag }} + DoPGO: ${{ parameters.DoPGO }} + ${{ if ne(parameters.SigningCertificate, 'Unsigned') }}: + SigningCertificate: ${{ parameters.SigningCertificate }} + SigningDescription: ${{ parameters.SigningDescription }} + DoLayout: ${{ parameters.DoLayout }} + DoMSIX: ${{ parameters.DoMSIX }} + DoNuget: ${{ parameters.DoNuget }} + DoEmbed: ${{ parameters.DoEmbed }} + DoMSI: ${{ parameters.DoMSI }} + DoPublish: ${{ parameters.DoPublish }} # QUEUE TIME VARIABLES -# GitRemote: python -# SourceTag: -# DoPGO: true -# SigningCertificate: 'Python Software Foundation' -# SigningDescription: 'Built: $(Build.BuildNumber)' -# DoLayout: true -# DoMSIX: true -# DoNuget: true -# DoEmbed: true -# DoMSI: true -# DoPublish: false -# PyDotOrgUsername: '' -# PyDotOrgServer: '' -# BuildToPublish: '' +# PyDotOrgUsername: '' +# PyDotOrgServer: '' trigger: none pr: none stages: -- stage: Build - displayName: Build binaries - condition: and(succeeded(), not(variables['BuildToPublish'])) - jobs: - - template: windows-release/stage-build.yml - -- stage: Sign - displayName: Sign binaries - dependsOn: Build - condition: and(succeeded(), not(variables['BuildToPublish'])) - jobs: - - template: windows-release/stage-sign.yml - -- stage: Layout - displayName: Generate layouts - dependsOn: Sign - condition: and(succeeded(), not(variables['BuildToPublish'])) - jobs: - - template: windows-release/stage-layout-full.yml - - template: windows-release/stage-layout-embed.yml - - template: windows-release/stage-layout-nuget.yml - -- stage: Pack - dependsOn: Layout - condition: and(succeeded(), not(variables['BuildToPublish'])) - jobs: - - template: windows-release/stage-pack-nuget.yml - -- stage: Test - dependsOn: Pack - condition: and(succeeded(), not(variables['BuildToPublish'])) - jobs: - - 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(), and(eq(variables['DoMSIX'], 'true'), not(variables['BuildToPublish']))) - jobs: - - template: windows-release/stage-layout-msix.yml - -- stage: Pack_MSIX - displayName: Package MSIX - dependsOn: Layout_MSIX - condition: and(succeeded(), not(variables['BuildToPublish'])) - jobs: - - template: windows-release/stage-pack-msix.yml - -- stage: Build_MSI - displayName: Build MSI installer - dependsOn: Sign - condition: and(succeeded(), and(eq(variables['DoMSI'], 'true'), not(variables['BuildToPublish']))) - jobs: - - template: windows-release/stage-msi.yml - -- stage: Test_MSI - displayName: Test MSI installer - dependsOn: Build_MSI - condition: and(succeeded(), not(variables['BuildToPublish'])) - jobs: - - template: windows-release/stage-test-msi.yml - -- stage: PublishPyDotOrg - displayName: Publish to python.org - dependsOn: ['Test_MSI', 'Test'] - condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), not(variables['BuildToPublish']))) - jobs: - - template: windows-release/stage-publish-pythonorg.yml - -- stage: PublishNuget - displayName: Publish to nuget.org - dependsOn: Test - condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), not(variables['BuildToPublish']))) - jobs: - - template: windows-release/stage-publish-nugetorg.yml - -- stage: PublishStore - displayName: Publish to Store - dependsOn: Pack_MSIX - condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), not(variables['BuildToPublish']))) - jobs: - - template: windows-release/stage-publish-store.yml - - -- stage: PublishExistingPyDotOrg - displayName: Publish existing build to python.org - dependsOn: [] - condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), variables['BuildToPublish'])) - jobs: - - template: windows-release/stage-publish-pythonorg.yml - -- stage: PublishExistingNuget - displayName: Publish existing build to nuget.org - dependsOn: [] - condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), variables['BuildToPublish'])) - jobs: - - template: windows-release/stage-publish-nugetorg.yml - -- stage: PublishExistingStore - displayName: Publish existing build to Store - dependsOn: [] - condition: and(succeeded(), and(eq(variables['DoPublish'], 'true'), variables['BuildToPublish'])) - jobs: - - template: windows-release/stage-publish-store.yml +- ${{ if eq(parameters.BuildToPublish, '0') }}: + - stage: Build + displayName: Build binaries + jobs: + - template: windows-release/stage-build.yml + + - stage: Sign + displayName: Sign binaries + dependsOn: Build + jobs: + - template: windows-release/stage-sign.yml + + - stage: Layout + displayName: Generate layouts + dependsOn: Sign + jobs: + - template: windows-release/stage-layout-full.yml + - template: windows-release/stage-layout-embed.yml + - template: windows-release/stage-layout-nuget.yml + + - stage: Pack + dependsOn: Layout + jobs: + - template: windows-release/stage-pack-nuget.yml + + - stage: Test + dependsOn: Pack + jobs: + - 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 + + - 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 + + - stage: Test_MSI + displayName: Test MSI installer + dependsOn: Build_MSI + jobs: + - template: windows-release/stage-test-msi.yml + + - ${{ if eq(parameters.DoPublish, 'true') }}: + - stage: PublishPyDotOrg + displayName: Publish to python.org + dependsOn: ['Test_MSI', 'Test'] + jobs: + - template: windows-release/stage-publish-pythonorg.yml + + - stage: PublishNuget + displayName: Publish to nuget.org + dependsOn: Test + jobs: + - template: windows-release/stage-publish-nugetorg.yml + + - stage: PublishStore + displayName: Publish to Store + 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 }} + + - template: windows-release/stage-publish-nugetorg.yml + parameters: + BuildToPublish: ${{ parameters.BuildToPublish }} + + - template: windows-release/stage-publish-store.yml + parameters: + BuildToPublish: ${{ parameters.BuildToPublish }} |