forked from data61/anonlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azurePipeline.yml
232 lines (227 loc) · 7.36 KB
/
azurePipeline.yml
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
trigger:
branches:
include:
- '*'
tags:
include:
- v*
stages:
- stage: wheels
displayName: Build Wheel Packages
variables:
# Need to install development libraries for manylinux container
CIBW_BEFORE_BUILD_LINUX: 'yum install -y libffi-devel atlas-devel'
# Only build for Python36+, and x64 arch
CIBW_BUILD: 'cp39-* cp38-* cp37-* cp36-*'
CIBW_SKIP: '*-win32 *-manylinux_i686'
jobs:
- job: linux_39
displayName: Linux + Python3.9
pool:
vmImage: 'ubuntu-18.04'
variables:
CIBW_BUILD: 'cp39-*'
steps:
- { task: UsePythonVersion@0, inputs: { versionSpec: '3.9', architecture: x64 } }
- template: .azurePipeline/cibuildwheel_steps.yml
- job: linux_38
displayName: Linux + Python3.8
pool:
vmImage: 'ubuntu-18.04'
variables:
CIBW_BUILD: 'cp38-*'
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.8', architecture: x64}}
- template: .azurePipeline/cibuildwheel_steps.yml
- job: linux_37
displayName: Linux + Python3.7
pool:
vmImage: 'ubuntu-18.04'
variables:
CIBW_BUILD: 'cp37-*'
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x64}}
- template: .azurePipeline/cibuildwheel_steps.yml
- job: linux_36
displayName: Linux + Python3.6
pool:
vmImage: 'ubuntu-18.04'
variables:
CIBW_BUILD: 'cp36-*'
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}}
- template: .azurePipeline/cibuildwheel_steps.yml
- job: macos
displayName: MacOS
pool:
vmImage: 'macOS-10.14'
variables:
MACOSX_DEPLOYMENT_TARGET: '10.14'
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.8', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.9', architecture: x64}}
- template: .azurePipeline/cibuildwheel_steps.yml
- job: windows
displayName: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.8', architecture: x64}}
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.9', architecture: x64}}
- template: .azurePipeline/cibuildwheel_steps.yml
- stage: sdist
displayName: Build source distribution
dependsOn: []
jobs:
- job: sdist
displayName: build source distribution
pool:
vmImage: 'ubuntu-18.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
- script: |
python setup.py sdist
displayName: 'Artifact creation'
- task: CopyFiles@2
inputs:
targetFolder: 'sdist'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'sdist/dist'
ArtifactName: 'drop'
- stage: test
displayName: Unit tests
dependsOn: ['wheels']
jobs:
- job:
displayName: Linux
pool:
vmImage: 'ubuntu-18.04'
strategy:
matrix:
Python3.6:
pythonVersion: '3.6'
artifactName: 'wheels.linux36'
Python3.7:
pythonVersion: '3.7'
artifactName: 'wheels.linux37'
Python3.8:
pythonVersion: '3.8'
artifactName: 'wheels.linux38'
Python3.9:
pythonVersion: '3.9'
artifactName: 'wheels.linux39'
steps:
- template: .azurePipeline/unittest_wheel_steps.yml
parameters:
artifactName: $(artifactName)
pythonVersion: $(pythonVersion)
operatingSystem: 'ubuntu-18.04'
- job:
displayName: MacOS
pool:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python3.7:
pythonVersion: '3.7'
artifactName: 'wheels.macos'
artifactPattern: '**/*cp37*.whl'
Python3.8:
pythonVersion: '3.8'
artifactName: 'wheels.macos'
artifactPattern: '**/*cp38*.whl'
Python3.9:
pythonVersion: '3.9'
artifactName: 'wheels.macos'
artifactPattern: '**/*cp39*.whl'
steps:
- template: .azurePipeline/unittest_wheel_steps.yml
parameters:
artifactName: $(artifactName)
artifactPattern: $(artifactPattern)
pythonVersion: $(pythonVersion)
operatingSystem: 'macOS-10.14'
- job:
displayName: Windows
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python3.6:
pythonVersion: '3.6'
artifactName: 'wheels.windows'
artifactPattern: '**/*cp36m*.whl'
Python3.7:
pythonVersion: '3.7'
artifactName: 'wheels.windows'
artifactPattern: '**/*cp37m*.whl'
Python3.8:
pythonVersion: '3.8'
artifactName: 'wheels.windows'
artifactPattern: '**/*cp38*.whl'
Python3.9:
pythonVersion: '3.9'
artifactName: 'wheels.windows'
artifactPattern: '**/*cp39*.whl'
steps:
- template: .azurePipeline/unittest_wheel_steps.yml
parameters:
artifactName: $(artifactName)
artifactPattern: $(artifactPattern)
pythonVersion: $(pythonVersion)
operatingSystem: 'vs2017-win2016'
- stage: static_checks
displayName: Static Checks
dependsOn: []
jobs:
- job:
displayName: Typecheck
pool:
vmImage: 'ubuntu-18.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
- script: pip install -U mypy types-setuptools
- script: mypy anonlink --ignore-missing-imports
displayName: mypy
- job:
displayName: "check for and tag release"
steps:
# In this step, if this build is triggered by a tag, it will add a tag 'doRelease' to the current build.
# This tag in turn is used as a trigger for the release pipeline.
- script: echo "##vso[build.addbuildtag]doRelease"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
- stage: publish
displayName: Publish packages to test feed
dependsOn: ['test']
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
jobs:
- job:
pool:
vmImage: 'ubuntu-latest'
variables:
# the name of an Azure artifacts feed to publish artifacts to
artifactFeed: anonlink
steps:
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x64}}
- script: 'pip install twine'
- task: DownloadPipelineArtifact@2
inputs:
artifactName: 'drop'
patterns: '**/*.@(whl|tar.gz)'
path: $(Pipeline.Workspace)
- task: TwineAuthenticate@1
inputs:
artifactFeed: $(artifactFeed)
- script: 'echo $(Build.Repository.Name)'
- script: 'echo $(Build.SourceBranchName)'
- script: 'twine upload -r $(artifactFeed) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/*.whl --skip-existing'
- script: 'twine upload -r $(artifactFeed) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/*.tar.gz --skip-existing'