summaryrefslogtreecommitdiffstats
path: root/.azure-pipelines/windows-release.yml
blob: c038ccdb8675a3089fcce4f8a0baef44519b9d4e (plain)
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
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: DoARM64
  displayName: "Publish ARM64 build"
  type: boolean
  default: true
- 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 }}
  PublishARM64: ${{ parameters.DoARM64 }}
# QUEUE TIME VARIABLES
#  PyDotOrgUsername: ''
#  PyDotOrgServer: ''

trigger: none
pr: none

stages:
- ${{ 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 }}