From ee3917e09119425a19bc2e926ae8458e2a4af0d4 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 21 Jan 2022 17:49:36 +0000 Subject: [PATCH 1/7] Improve parameter setting for release builds --- .azure-pipelines/windows-release.yml | 78 +++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 14 deletions(-) diff --git a/.azure-pipelines/windows-release.yml b/.azure-pipelines/windows-release.yml index 3d072e3b43e17e..a2394ad796ffce 100644 --- a/.azure-pipelines/windows-release.yml +++ b/.azure-pipelines/windows-release.yml @@ -1,22 +1,72 @@ name: Release_$(Build.SourceBranchName)_$(SourceTag)_$(Date:yyyyMMdd)$(Rev:.rr) +parameters: +- name: GitRemote + displayName: "Git remote" + type: string + default: python +- name: SourceTag + displayName: "Git tag" + type: string + default: '' +- name: DoPublish + displayName: "Publish release" + type: boolean + default: false +- name: SigningCertificate + displayName: "Code signing certificate" + type: string + default: 'Python Software Foundation' +- 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 traditional installer" + type: boolean + default: true +- name: BuildToPublish + displayName: "Build number to publish" + type: string + default: '' + variables: __RealSigningCertificate: 'Python Software Foundation' + GitRemote: ${{ parameters.GitRemote }} + SourceTag: ${{ paremeters.SourceTag }} + DoPGO: ${{ parameters.DoPGO }} + SigningCertificate: ${{ parameters.SigningCertificate }} + SigningDescription: ${{ parameters.SigningDescription }} + DoLayout: ${{ parameters.DoLayout }} + DoMSIX: ${{ parameters.DoMSIX }} + DoNuget: ${{ parameters.DoNuget }} + DoEmbed: ${{ parameters.DoEmbed }} + DoMSI: ${{ parameters.DoMSI }} + DoPublish: ${{ parameters.DoPublish }} + BuildToPublish: ${{ parameters.BuildToPublish }} # 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 From 5d627bd26fd49aad50c23ebce30e12bd4c2e33e2 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 21 Jan 2022 19:23:54 +0000 Subject: [PATCH 2/7] Improve defaults --- .azure-pipelines/windows-release.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/windows-release.yml b/.azure-pipelines/windows-release.yml index a2394ad796ffce..27697be6e1f159 100644 --- a/.azure-pipelines/windows-release.yml +++ b/.azure-pipelines/windows-release.yml @@ -5,10 +5,14 @@ parameters: displayName: "Git remote" type: string default: python + values: + - python + - ambv + - pablogsal - name: SourceTag displayName: "Git tag" type: string - default: '' + default: main - name: DoPublish displayName: "Publish release" type: boolean @@ -47,8 +51,8 @@ parameters: default: true - name: BuildToPublish displayName: "Build number to publish" - type: string - default: '' + type: number + default: '0' variables: __RealSigningCertificate: 'Python Software Foundation' @@ -63,7 +67,8 @@ variables: DoEmbed: ${{ parameters.DoEmbed }} DoMSI: ${{ parameters.DoMSI }} DoPublish: ${{ parameters.DoPublish }} - BuildToPublish: ${{ parameters.BuildToPublish }} + ${{ if ne(parameters.BuildToPublish, '0') }}: + BuildToPublish: ${{ parameters.BuildToPublish }} # QUEUE TIME VARIABLES # PyDotOrgUsername: '' # PyDotOrgServer: '' From c511ee5432675f30ac3a117ac642c67687d9bb37 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 21 Jan 2022 19:27:28 +0000 Subject: [PATCH 3/7] Improve defaults --- .azure-pipelines/windows-release.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/windows-release.yml b/.azure-pipelines/windows-release.yml index 27697be6e1f159..d5d34d802789e4 100644 --- a/.azure-pipelines/windows-release.yml +++ b/.azure-pipelines/windows-release.yml @@ -1,7 +1,7 @@ name: Release_$(Build.SourceBranchName)_$(SourceTag)_$(Date:yyyyMMdd)$(Rev:.rr) parameters: -- name: GitRemote +- name: GitReleaseRemote displayName: "Git remote" type: string default: python @@ -9,6 +9,11 @@ parameters: - python - ambv - pablogsal + - Other +- name: GitRemote + displayName: "Other Git remote" + type: string + default: 'n/a' - name: SourceTag displayName: "Git tag" type: string @@ -50,13 +55,16 @@ parameters: type: boolean default: true - name: BuildToPublish - displayName: "Build number to publish" + displayName: "Build number to publish (0 to skip)" type: number default: '0' variables: __RealSigningCertificate: 'Python Software Foundation' - GitRemote: ${{ parameters.GitRemote }} + ${{ if ne(parameters.GitReleaseRemote, 'Other') }}: + GitRemote: ${{ parameters.GitReleaseRemote }} + ${{ else }}: + GitRemote: ${{ parameters.GitRemote }} SourceTag: ${{ paremeters.SourceTag }} DoPGO: ${{ parameters.DoPGO }} SigningCertificate: ${{ parameters.SigningCertificate }} From 54bc9a02fa9bd8ec497958bda0c0914e67658ead Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 21 Jan 2022 19:29:49 +0000 Subject: [PATCH 4/7] Fix typo --- .azure-pipelines/windows-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/windows-release.yml b/.azure-pipelines/windows-release.yml index d5d34d802789e4..9b005927b0b972 100644 --- a/.azure-pipelines/windows-release.yml +++ b/.azure-pipelines/windows-release.yml @@ -65,7 +65,7 @@ variables: GitRemote: ${{ parameters.GitReleaseRemote }} ${{ else }}: GitRemote: ${{ parameters.GitRemote }} - SourceTag: ${{ paremeters.SourceTag }} + SourceTag: ${{ parameters.SourceTag }} DoPGO: ${{ parameters.DoPGO }} SigningCertificate: ${{ parameters.SigningCertificate }} SigningDescription: ${{ parameters.SigningDescription }} From 2af51152a9c0b42bfd4a21965752084d57aca72d Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 21 Jan 2022 19:42:49 +0000 Subject: [PATCH 5/7] Update to Windows 2022 build image --- .azure-pipelines/ci.yml | 2 +- .azure-pipelines/pr.yml | 2 +- .azure-pipelines/windows-release/stage-build.yml | 10 +++++----- .../windows-release/stage-layout-embed.yml | 2 +- .azure-pipelines/windows-release/stage-layout-full.yml | 2 +- .azure-pipelines/windows-release/stage-layout-msix.yml | 2 +- .../windows-release/stage-layout-nuget.yml | 2 +- .azure-pipelines/windows-release/stage-msi.yml | 2 +- .azure-pipelines/windows-release/stage-pack-msix.yml | 2 +- .../windows-release/stage-publish-nugetorg.yml | 2 +- .../windows-release/stage-publish-pythonorg.yml | 2 +- .../windows-release/stage-publish-store.yml | 2 +- .azure-pipelines/windows-release/stage-sign.yml | 2 +- .azure-pipelines/windows-release/stage-test-embed.yml | 2 +- .azure-pipelines/windows-release/stage-test-msi.yml | 2 +- .azure-pipelines/windows-release/stage-test-nuget.yml | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index 25cc726504b376..638625540e44c3 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -98,7 +98,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: - vmImage: windows-2019 + vmImage: windows-2022 strategy: matrix: diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index e2aae324f211be..8b065e6caea538 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -98,7 +98,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: - vmImage: windows-2019 + vmImage: windows-2022 strategy: matrix: diff --git a/.azure-pipelines/windows-release/stage-build.yml b/.azure-pipelines/windows-release/stage-build.yml index 69f3b1e16451ec..f70414ba211452 100644 --- a/.azure-pipelines/windows-release/stage-build.yml +++ b/.azure-pipelines/windows-release/stage-build.yml @@ -2,8 +2,8 @@ jobs: - job: Build_Docs displayName: Docs build pool: - name: 'Windows Release' - #vmImage: windows-2019 + #name: 'Windows Release' + vmImage: windows-2022 workspace: clean: all @@ -45,7 +45,7 @@ jobs: displayName: Python build pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all @@ -91,7 +91,7 @@ jobs: condition: and(succeeded(), ne(variables['DoPGO'], 'true')) pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all @@ -141,7 +141,7 @@ jobs: displayName: Publish Tcl/Tk Library pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all diff --git a/.azure-pipelines/windows-release/stage-layout-embed.yml b/.azure-pipelines/windows-release/stage-layout-embed.yml index dbccdead143b21..c8b23d308d81e9 100644 --- a/.azure-pipelines/windows-release/stage-layout-embed.yml +++ b/.azure-pipelines/windows-release/stage-layout-embed.yml @@ -4,7 +4,7 @@ jobs: condition: and(succeeded(), eq(variables['DoEmbed'], 'true')) pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all diff --git a/.azure-pipelines/windows-release/stage-layout-full.yml b/.azure-pipelines/windows-release/stage-layout-full.yml index 8fc8da3e52fe03..0ba2fc017d987a 100644 --- a/.azure-pipelines/windows-release/stage-layout-full.yml +++ b/.azure-pipelines/windows-release/stage-layout-full.yml @@ -4,7 +4,7 @@ jobs: condition: and(succeeded(), eq(variables['DoLayout'], 'true')) pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all diff --git a/.azure-pipelines/windows-release/stage-layout-msix.yml b/.azure-pipelines/windows-release/stage-layout-msix.yml index def4f7d3c6bee5..6efd327bdb32e5 100644 --- a/.azure-pipelines/windows-release/stage-layout-msix.yml +++ b/.azure-pipelines/windows-release/stage-layout-msix.yml @@ -3,7 +3,7 @@ jobs: displayName: Make MSIX layout pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all diff --git a/.azure-pipelines/windows-release/stage-layout-nuget.yml b/.azure-pipelines/windows-release/stage-layout-nuget.yml index 41cdff850e83be..b60a324dd90e3d 100644 --- a/.azure-pipelines/windows-release/stage-layout-nuget.yml +++ b/.azure-pipelines/windows-release/stage-layout-nuget.yml @@ -4,7 +4,7 @@ jobs: condition: and(succeeded(), eq(variables['DoNuget'], 'true')) pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all diff --git a/.azure-pipelines/windows-release/stage-msi.yml b/.azure-pipelines/windows-release/stage-msi.yml index 9b965b09c14748..f14bc9a45ae381 100644 --- a/.azure-pipelines/windows-release/stage-msi.yml +++ b/.azure-pipelines/windows-release/stage-msi.yml @@ -4,7 +4,7 @@ jobs: condition: and(succeeded(), not(variables['SigningCertificate'])) pool: - vmImage: windows-2019 + vmImage: windows-2022 variables: ReleaseUri: http://www.python.org/{arch} diff --git a/.azure-pipelines/windows-release/stage-pack-msix.yml b/.azure-pipelines/windows-release/stage-pack-msix.yml index 9f7919ee64706b..95988151a03db7 100644 --- a/.azure-pipelines/windows-release/stage-pack-msix.yml +++ b/.azure-pipelines/windows-release/stage-pack-msix.yml @@ -3,7 +3,7 @@ jobs: displayName: Pack MSIX bundles pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all diff --git a/.azure-pipelines/windows-release/stage-publish-nugetorg.yml b/.azure-pipelines/windows-release/stage-publish-nugetorg.yml index d5edf44ef5c2ec..643a48b4c35ff3 100644 --- a/.azure-pipelines/windows-release/stage-publish-nugetorg.yml +++ b/.azure-pipelines/windows-release/stage-publish-nugetorg.yml @@ -4,7 +4,7 @@ jobs: condition: and(succeeded(), eq(variables['DoNuget'], 'true')) pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all diff --git a/.azure-pipelines/windows-release/stage-publish-pythonorg.yml b/.azure-pipelines/windows-release/stage-publish-pythonorg.yml index 4b88bdebf8cc41..59250ad19282c9 100644 --- a/.azure-pipelines/windows-release/stage-publish-pythonorg.yml +++ b/.azure-pipelines/windows-release/stage-publish-pythonorg.yml @@ -4,7 +4,7 @@ jobs: condition: and(succeeded(), and(eq(variables['DoMSI'], 'true'), eq(variables['DoEmbed'], 'true'))) pool: - #vmImage: windows-2019 + #vmImage: windows-2022 name: 'Windows Release' workspace: diff --git a/.azure-pipelines/windows-release/stage-publish-store.yml b/.azure-pipelines/windows-release/stage-publish-store.yml index e0512b95f27da8..bbc5b2e2214620 100644 --- a/.azure-pipelines/windows-release/stage-publish-store.yml +++ b/.azure-pipelines/windows-release/stage-publish-store.yml @@ -4,7 +4,7 @@ jobs: condition: and(succeeded(), eq(variables['DoMSIX'], 'true')) pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all diff --git a/.azure-pipelines/windows-release/stage-sign.yml b/.azure-pipelines/windows-release/stage-sign.yml index d43e077186c42c..4481aa86edc2cc 100644 --- a/.azure-pipelines/windows-release/stage-sign.yml +++ b/.azure-pipelines/windows-release/stage-sign.yml @@ -120,7 +120,7 @@ jobs: condition: and(succeeded(), not(variables['SigningCertificate'])) pool: - vmImage: windows-2019 + vmImage: windows-2022 steps: - checkout: none diff --git a/.azure-pipelines/windows-release/stage-test-embed.yml b/.azure-pipelines/windows-release/stage-test-embed.yml index d99bd74722bacb..252db959930f2f 100644 --- a/.azure-pipelines/windows-release/stage-test-embed.yml +++ b/.azure-pipelines/windows-release/stage-test-embed.yml @@ -4,7 +4,7 @@ jobs: condition: and(succeeded(), eq(variables['DoEmbed'], 'true')) pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all diff --git a/.azure-pipelines/windows-release/stage-test-msi.yml b/.azure-pipelines/windows-release/stage-test-msi.yml index 21e38c39590f70..4b02f478ce0a14 100644 --- a/.azure-pipelines/windows-release/stage-test-msi.yml +++ b/.azure-pipelines/windows-release/stage-test-msi.yml @@ -3,7 +3,7 @@ jobs: displayName: Test MSI pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all diff --git a/.azure-pipelines/windows-release/stage-test-nuget.yml b/.azure-pipelines/windows-release/stage-test-nuget.yml index 94d815e95226ef..c500baf29b4571 100644 --- a/.azure-pipelines/windows-release/stage-test-nuget.yml +++ b/.azure-pipelines/windows-release/stage-test-nuget.yml @@ -4,7 +4,7 @@ jobs: condition: and(succeeded(), eq(variables['DoNuget'], 'true')) pool: - vmImage: windows-2019 + vmImage: windows-2022 workspace: clean: all From 82c236b6a2af17bc43e94991e5cf6f6add74cc46 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 21 Jan 2022 20:13:13 +0000 Subject: [PATCH 6/7] Improve parameter text --- .azure-pipelines/windows-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/windows-release.yml b/.azure-pipelines/windows-release.yml index 9b005927b0b972..03d678d16122c7 100644 --- a/.azure-pipelines/windows-release.yml +++ b/.azure-pipelines/windows-release.yml @@ -51,7 +51,7 @@ parameters: type: boolean default: true - name: DoMSI - displayName: "Produce traditional installer" + displayName: "Produce EXE/MSI installer" type: boolean default: true - name: BuildToPublish From 5c3c55eaec9b4afc9f0e31c5fe9c8199f8ed1385 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 21 Jan 2022 21:05:55 +0000 Subject: [PATCH 7/7] Move build publishing to template --- .azure-pipelines/windows-release.yml | 229 +++++++++--------- .../stage-publish-nugetorg.yml | 38 +-- .../stage-publish-pythonorg.yml | 115 ++++----- .../windows-release/stage-publish-store.yml | 37 +-- 4 files changed, 210 insertions(+), 209 deletions(-) diff --git a/.azure-pipelines/windows-release.yml b/.azure-pipelines/windows-release.yml index 03d678d16122c7..338c305ecdc0a1 100644 --- a/.azure-pipelines/windows-release.yml +++ b/.azure-pipelines/windows-release.yml @@ -1,19 +1,19 @@ name: Release_$(Build.SourceBranchName)_$(SourceTag)_$(Date:yyyyMMdd)$(Rev:.rr) parameters: -- name: GitReleaseRemote +- name: GitRemote displayName: "Git remote" type: string default: python values: - - python - - ambv - - pablogsal - - Other -- name: GitRemote - displayName: "Other Git remote" + - 'python' + - 'pablogsal' + - 'ambv' + - '(Other)' +- name: GitRemote_Other + displayName: "If Other, specify Git remote" type: string - default: 'n/a' + default: 'python' - name: SourceTag displayName: "Git tag" type: string @@ -26,6 +26,10 @@ parameters: displayName: "Code signing certificate" type: string default: 'Python Software Foundation' + values: + - 'Python Software Foundation' + - 'TestSign' + - 'Unsigned' - name: SigningDescription displayName: "Signature description" type: string @@ -61,13 +65,14 @@ parameters: variables: __RealSigningCertificate: 'Python Software Foundation' - ${{ if ne(parameters.GitReleaseRemote, 'Other') }}: - GitRemote: ${{ parameters.GitReleaseRemote }} - ${{ else }}: + ${{ if ne(parameters.GitRemote, '(Other)') }}: GitRemote: ${{ parameters.GitRemote }} + ${{ else }}: + GitRemote: ${{ parameters.GitRemote_Other }} SourceTag: ${{ parameters.SourceTag }} DoPGO: ${{ parameters.DoPGO }} - SigningCertificate: ${{ parameters.SigningCertificate }} + ${{ if ne(parameters.SigningCertificate, 'Unsigned') }}: + SigningCertificate: ${{ parameters.SigningCertificate }} SigningDescription: ${{ parameters.SigningDescription }} DoLayout: ${{ parameters.DoLayout }} DoMSIX: ${{ parameters.DoMSIX }} @@ -75,8 +80,6 @@ variables: DoEmbed: ${{ parameters.DoEmbed }} DoMSI: ${{ parameters.DoMSI }} DoPublish: ${{ parameters.DoPublish }} - ${{ if ne(parameters.BuildToPublish, '0') }}: - BuildToPublish: ${{ parameters.BuildToPublish }} # QUEUE TIME VARIABLES # PyDotOrgUsername: '' # PyDotOrgServer: '' @@ -85,108 +88,96 @@ 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 }} diff --git a/.azure-pipelines/windows-release/stage-publish-nugetorg.yml b/.azure-pipelines/windows-release/stage-publish-nugetorg.yml index 643a48b4c35ff3..38f6772afcde3f 100644 --- a/.azure-pipelines/windows-release/stage-publish-nugetorg.yml +++ b/.azure-pipelines/windows-release/stage-publish-nugetorg.yml @@ -1,3 +1,6 @@ +parameters: + BuildToPublish: '' + jobs: - job: Publish_Nuget displayName: Publish Nuget packages @@ -12,24 +15,25 @@ jobs: steps: - checkout: none - - task: DownloadBuildArtifacts@0 - displayName: 'Download artifact: nuget' - condition: and(succeeded(), not(variables['BuildToPublish'])) - inputs: - artifactName: nuget - downloadPath: $(Build.BinariesDirectory) + - ${{ if parameters.BuildToPublish }}: + - task: DownloadBuildArtifacts@0 + displayName: 'Download artifact from ${{ parameters.BuildToPublish }}' + inputs: + artifactName: nuget + downloadPath: $(Build.BinariesDirectory) + buildType: specific + project: $(System.TeamProject) + pipeline: $(Build.DefinitionName) + buildVersionToDownload: specific + buildId: ${{ parameters.BuildToPublish }} + + - ${{ else }}: + - task: DownloadBuildArtifacts@0 + displayName: 'Download artifact: nuget' + inputs: + artifactName: nuget + downloadPath: $(Build.BinariesDirectory) - - task: DownloadBuildArtifacts@0 - displayName: 'Download artifact: nuget' - condition: and(succeeded(), variables['BuildToPublish']) - inputs: - artifactName: nuget - downloadPath: $(Build.BinariesDirectory) - buildType: specific - project: cpython - pipeline: Windows-Release - buildVersionToDownload: specific - buildId: $(BuildToPublish) - powershell: 'gci pythonarm*.nupkg | %{ Write-Host "Not publishing: $($_.Name)"; gi $_ } | del' displayName: 'Prevent publishing ARM/ARM64 packages' diff --git a/.azure-pipelines/windows-release/stage-publish-pythonorg.yml b/.azure-pipelines/windows-release/stage-publish-pythonorg.yml index 59250ad19282c9..ef95572f7d165f 100644 --- a/.azure-pipelines/windows-release/stage-publish-pythonorg.yml +++ b/.azure-pipelines/windows-release/stage-publish-pythonorg.yml @@ -1,3 +1,6 @@ +parameters: + BuildToPublish: '' + jobs: - job: Publish_Python displayName: Publish python.org packages @@ -18,62 +21,61 @@ jobs: inputs: versionSpec: '>=3.6' - - task: DownloadPipelineArtifact@1 - displayName: 'Download artifact: Doc' - condition: and(succeeded(), not(variables['BuildToPublish'])) - inputs: - artifactName: Doc - targetPath: $(Build.BinariesDirectory)\Doc - - - task: DownloadPipelineArtifact@1 - displayName: 'Download artifact: msi' - condition: and(succeeded(), not(variables['BuildToPublish'])) - inputs: - artifactName: msi - targetPath: $(Build.BinariesDirectory)\msi + - ${{ if parameters.BuildToPublish }}: + - task: DownloadPipelineArtifact@1 + displayName: 'Download artifact from ${{ parameters.BuildToPublish }}: Doc' + inputs: + artifactName: Doc + targetPath: $(Build.BinariesDirectory)\Doc + buildType: specific + project: $(System.TeamProject) + pipeline: $(Build.DefinitionName) + buildVersionToDownload: specific + buildId: ${{ parameters.BuildToPublish }} + + - task: DownloadPipelineArtifact@1 + displayName: 'Download artifact from ${{ parameters.BuildToPublish }}: msi' + inputs: + artifactName: msi + targetPath: $(Build.BinariesDirectory)\msi + buildType: specific + project: $(System.TeamProject) + pipeline: $(Build.DefinitionName) + buildVersionToDownload: specific + buildId: ${{ parameters.BuildToPublish }} + + # Note that embed is a 'build' artifact, not a 'pipeline' artifact + - task: DownloadBuildArtifacts@0 + displayName: 'Download artifact from ${{ parameters.BuildToPublish }}: embed' + inputs: + artifactName: embed + downloadPath: $(Build.BinariesDirectory) + buildType: specific + project: $(System.TeamProject) + pipeline: $(Build.DefinitionName) + buildVersionToDownload: specific + buildId: ${{ parameters.BuildToPublish }} + + - ${{ else }}: + - task: DownloadPipelineArtifact@1 + displayName: 'Download artifact: Doc' + inputs: + artifactName: Doc + targetPath: $(Build.BinariesDirectory)\Doc + + - task: DownloadPipelineArtifact@1 + displayName: 'Download artifact: msi' + inputs: + artifactName: msi + targetPath: $(Build.BinariesDirectory)\msi + + # Note that embed is a 'build' artifact, not a 'pipeline' artifact + - task: DownloadBuildArtifacts@0 + displayName: 'Download artifact: embed' + inputs: + artifactName: embed + downloadPath: $(Build.BinariesDirectory) - - task: DownloadBuildArtifacts@0 - displayName: 'Download artifact: embed' - condition: and(succeeded(), not(variables['BuildToPublish'])) - inputs: - artifactName: embed - downloadPath: $(Build.BinariesDirectory) - - - task: DownloadPipelineArtifact@1 - displayName: 'Download artifact from $(BuildToPublish): Doc' - condition: and(succeeded(), variables['BuildToPublish']) - inputs: - artifactName: Doc - targetPath: $(Build.BinariesDirectory)\Doc - buildType: specific - project: cpython - pipeline: 21 - buildVersionToDownload: specific - buildId: $(BuildToPublish) - - - task: DownloadPipelineArtifact@1 - displayName: 'Download artifact from $(BuildToPublish): msi' - condition: and(succeeded(), variables['BuildToPublish']) - inputs: - artifactName: msi - targetPath: $(Build.BinariesDirectory)\msi - buildType: specific - project: cpython - pipeline: 21 - buildVersionToDownload: specific - buildId: $(BuildToPublish) - - - task: DownloadBuildArtifacts@0 - displayName: 'Download artifact from $(BuildToPublish): embed' - condition: and(succeeded(), variables['BuildToPublish']) - inputs: - artifactName: embed - downloadPath: $(Build.BinariesDirectory) - buildType: specific - project: cpython - pipeline: Windows-Release - buildVersionToDownload: specific - buildId: $(BuildToPublish) - powershell: 'gci *embed-arm*.zip | %{ Write-Host "Not publishing: $($_.Name)"; gi $_ } | del' displayName: 'Prevent publishing ARM/ARM64 packages' @@ -105,6 +107,7 @@ jobs: "$(Build.SourcesDirectory)\Tools\msi\purge.py" (gci msi\*\python-*.exe | %{ $_.Name -replace 'python-(.+?)(-|\.exe).+', '$1' } | select -First 1) workingDirectory: $(Build.BinariesDirectory) + condition: and(succeeded(), eq(variables['SigningCertificate'], variables['__RealSigningCertificate'])) displayName: 'Purge CDN' - powershell: | @@ -124,7 +127,7 @@ jobs: Write-Error "Failed to validate $failures installers" exit 1 } - #condition: and(succeeded(), eq(variables['SigningCertificate'], variables['__RealSigningCertificate'])) + condition: and(succeeded(), eq(variables['SigningCertificate'], variables['__RealSigningCertificate'])) workingDirectory: $(Build.BinariesDirectory) displayName: 'Test layouts' diff --git a/.azure-pipelines/windows-release/stage-publish-store.yml b/.azure-pipelines/windows-release/stage-publish-store.yml index bbc5b2e2214620..f3d4c80be91384 100644 --- a/.azure-pipelines/windows-release/stage-publish-store.yml +++ b/.azure-pipelines/windows-release/stage-publish-store.yml @@ -1,3 +1,6 @@ +parameters: + BuildToPublish: '' + jobs: - job: Publish_Store displayName: Publish Store packages @@ -12,24 +15,24 @@ jobs: steps: - checkout: none - - task: DownloadBuildArtifacts@0 - displayName: 'Download artifact: msixupload' - condition: and(succeeded(), not(variables['BuildToPublish'])) - inputs: - artifactName: msixupload - downloadPath: $(Build.BinariesDirectory) + - ${{ if parameters.BuildToPublish }}: + - task: DownloadBuildArtifacts@0 + displayName: 'Download artifact: msixupload' + inputs: + artifactName: msixupload + downloadPath: $(Build.BinariesDirectory) + buildType: specific + project: cpython + pipeline: Windows-Release + buildVersionToDownload: specific + buildId: ${{ parameters.BuildToPublish }} - - task: DownloadBuildArtifacts@0 - displayName: 'Download artifact: msixupload' - condition: and(succeeded(), variables['BuildToPublish']) - inputs: - artifactName: msixupload - downloadPath: $(Build.BinariesDirectory) - buildType: specific - project: cpython - pipeline: Windows-Release - buildVersionToDownload: specific - buildId: $(BuildToPublish) + - ${{ else }}: + - task: DownloadBuildArtifacts@0 + displayName: 'Download artifact: msixupload' + inputs: + artifactName: msixupload + downloadPath: $(Build.BinariesDirectory) # TODO: eq(variables['SigningCertificate'], variables['__RealSigningCertificate']) # If we are not real-signed, DO NOT PUBLISH