-
Notifications
You must be signed in to change notification settings - Fork 210
/
azure-pipelines.yml
246 lines (234 loc) · 8.44 KB
/
azure-pipelines.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
233
234
235
236
237
238
239
240
241
242
243
244
245
# https://aka.ms/yaml
trigger:
branches:
include:
- master
- staging
tags:
include:
- 'v*'
jobs:
- job: Build
pool:
vmImage: 'windows-2019' # other options: 'macOS-10.13', 'ubuntu-16.04'
strategy:
matrix:
cp36-cp36m-win_amd64.whl:
python.version: '3.6'
python.architecture: 'x64'
cp37-cp37m-win_amd64.whl:
python.version: '3.7'
python.architecture: 'x64'
cp38-cp38-win_amd64.whl:
python.version: '3.8'
python.architecture: 'x64'
cp39-cp39-win_amd64.whl:
python.version: '3.9'
python.architecture: 'x64'
cp310-cp310-win_amd64.whl:
python.version: '3.10'
python.architecture: 'x64'
cp311-cp311-win_amd64.whl:
python.version: '3.11'
python.architecture: 'x64'
cp312-cp312-win_amd64.whl:
python.version: '3.12'
python.architecture: 'x64'
cp313-cp313-win_amd64.whl:
python.version: '3.13'
python.architecture: 'x64'
cp36-cp36m-win32.whl:
python.version: '3.6'
python.architecture: 'x86'
cp37-cp37m-win32.whl:
python.version: '3.7'
python.architecture: 'x86'
cp38-cp38-win32.whl:
python.version: '3.8'
python.architecture: 'x86'
cp39-cp39-win32.whl:
python.version: '3.9'
python.architecture: 'x86'
cp310-cp310-win32.whl:
python.version: '3.10'
python.architecture: 'x86'
cp311-cp311-win32.whl:
python.version: '3.11'
python.architecture: 'x86'
cp312-cp312-win32.whl:
python.version: '3.12'
python.architecture: 'x86'
cp313-cp313-win32.whl:
python.version: '3.13'
python.architecture: 'x86'
maxParallel: 6
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'
# Add additional tasks to run using each Python version in the matrix above
# PowerShell
# Run a PowerShell script on Windows, macOS, or Linux.
- task: PowerShell@2
inputs:
targetType: 'inline' # Optional. Options: filePath, inline
#arguments: # Optional
script: | # Required when targetType == Inline
pwd
Invoke-WebRequest -Uri "https://www.klayout.org/downloads/klayout-microbits-4.0.zip" -OutFile klayout-microbits-4.0.zip
dir
Expand-Archive klayout-microbits-4.0.zip -DestinationPath klayout-microbits
dir klayout-microbits
#errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue
#failOnStderr: false # Optional
#ignoreLASTEXITCODE: false # Optional
#pwsh: false # Optional
#workingDirectory: # Optional
displayName: 'Download and Extract KLayout bits'
- script: |
python -m pip install --upgrade pip setuptools wheel
displayName: 'Update pip, setuptools and wheel'
- script: |
python -V
set "KLAYOUT_BITS=%cd%\klayout-microbits\klayout-microbits-4.0\msvc2017\%PYTHON_ARCHITECTURE%"
echo KLAYOUT_BITS=%KLAYOUT_BITS%
python setup.py bdist_wheel
displayName: 'Build KLayout'
- bash: |
bash `pwd`/ci-scripts/windows/fix_wheel.sh `pwd`/dist/*.whl "`pwd`/klayout-microbits/klayout-microbits-4.0/msvc2017/$PYTHON_ARCHITECTURE"
displayName: 'Copy klayout bits dlls into wheel'
- task: Bash@3
inputs:
targetType: 'inline'
script: |
set -e
echo $PATH
export TESTSRC=.
pip install klayout --no-index -f dist
python testdata/pymod/import_db.py
python testdata/pymod/import_rdb.py
python testdata/pymod/import_tl.py
python testdata/pymod/import_lib.py
python testdata/pymod/import_lay.py
python testdata/pymod/pya_tests.py
displayName: 'Test KLayout pymod'
- task: CopyFiles@2
condition: always()
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
targetFolder: '$(Build.ArtifactStagingDirectory)'
contents: '**/?(*.whl)'
- task: PublishBuildArtifacts@1
condition: always()
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'wheel-$(python.version).$(python.architecture)'
- job: 'Deploy'
displayName: 'Combine Windows wheels and deploy to PyPI'
dependsOn: Build
pool:
vmImage: 'windows-2019' # other options: 'macOS-10.13', 'ubuntu-16.04'
steps:
- checkout: none #skip checking out the default repository resource
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.13.x64'
inputs:
artifactName: 'wheel-3.13.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.12.x64'
inputs:
artifactName: 'wheel-3.12.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.11.x64'
inputs:
artifactName: 'wheel-3.11.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.10.x64'
inputs:
artifactName: 'wheel-3.10.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.9.x64'
inputs:
artifactName: 'wheel-3.9.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.8.x64'
inputs:
artifactName: 'wheel-3.8.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.7.x64'
inputs:
artifactName: 'wheel-3.7.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.6.x64'
inputs:
artifactName: 'wheel-3.6.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.13.x86'
inputs:
artifactName: 'wheel-3.13.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.12.x86'
inputs:
artifactName: 'wheel-3.12.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.11.x86'
inputs:
artifactName: 'wheel-3.11.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.10.x86'
inputs:
artifactName: 'wheel-3.10.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.9.x86'
inputs:
artifactName: 'wheel-3.9.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.8.x86'
inputs:
artifactName: 'wheel-3.8.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.7.x86'
inputs:
artifactName: 'wheel-3.7.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.6.x86'
inputs:
artifactName: 'wheel-3.6.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: CopyFiles@2
condition: always()
inputs:
sourceFolder: '$(System.DefaultWorkingDirectory)'
targetFolder: '$(Build.ArtifactStagingDirectory)'
contents: '**/?(*.whl)'
flattenFolders: true
- task: PublishBuildArtifacts@1
condition: always()
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'windows_wheels'
- bash: |
pip install -U twine
twine upload --skip-existing $BUILD_ARTIFACTSTAGINGDIRECTORY/*
env:
TWINE_USERNAME: $(TWINE_USERNAME)
TWINE_PASSWORD: $(TWINE_PASSWORD)
TWINE_REPOSITORY_URL: $(TWINE_REPOSITORY_URL)
displayName: 'Uploading to PyPI'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')