forked from tinyobjloader/tinyobjloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
159 lines (142 loc) · 4.86 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
variables:
# https://cibuildwheel.readthedocs.io/en/stable/cpp_standards/
# python2.7 + C++11(pybind11) is not available.
CIBW_SKIP: "cp27-win* pp27-win32 pp36-win32"
CIBW_BEFORE_BUILD: "pip install pybind11"
#CIBW_BEFORE_BUILD_MACOS: "pip install -U pip setuptools"
#CIBW_BEFORE_BUILD_LINUX: "pip install -U pip setuptools"
#CIBW_TEST_COMMAND: TODO "python -c \"import tinyobjloader; tinyobjloader.test()\""
CIBW_BUILD_VERBOSITY: "2"
#CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
#CIBW_MANYLINUX_I686_IMAGE: manylinux2014
jobs:
- job: unit_linux
pool: { vmImage: "ubuntu-latest" }
steps:
- script: |
cd tests
make && ./tester
displayName: Run unit tests
- job: python_format
pool: { vmImage: "ubuntu-latest" }
steps:
- task: UsePythonVersion@0
- script: |
pip install black==19.10b0
black --check python/
displayName: Check Python code format
- job: linux
pool: {vmImage: "Ubuntu-16.04"}
steps:
- task: UsePythonVersion@0
- bash: |
python3 -m pip install --upgrade pip
pip3 install cibuildwheel twine
# Make the header files available to the build.
cp *.h python
cd python
# Source dist
python3 setup.py sdist
ls -la dist/*
# build binary wheels
cibuildwheel --output-dir wheelhouse .
- task: CopyFiles@2
inputs:
contents: 'python/wheelhouse/**'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: CopyFiles@2
inputs:
contents: 'python/dist/**'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
path: $(Build.ArtifactStagingDirectory)
artifactName: tinyobjDeployLinux
- job: macos
pool: {vmImage: 'macOS-10.15'}
variables:
# Support C++11: https://github.com/joerick/cibuildwheel/pull/156
MACOSX_DEPLOYMENT_TARGET: 10.9
steps:
- task: UsePythonVersion@0
- bash: |
python3 -m pip install --upgrade pip
pip3 install cibuildwheel
# Make the header files available to the build.
cp *.h python
cd python
cibuildwheel --output-dir wheelhouse .
- task: CopyFiles@2
inputs:
contents: 'python/wheelhouse/*.whl'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
path: $(Build.ArtifactStagingDirectory)
artifactName: tinyobjDeployMacOS
- job: windows
pool: {vmImage: 'vs2017-win2016'}
steps:
- task: UsePythonVersion@0
- script: choco install vcpython27 -f -y
displayName: Install Visual C++ for Python 2.7
- bash: |
python -m pip install --upgrade pip
pip install cibuildwheel
# Make the header files available to the build.
cp *.h python
cd python
cibuildwheel --output-dir wheelhouse .
- task: CopyFiles@2
inputs:
contents: 'python/wheelhouse/*.whl'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
path: $(Build.ArtifactStagingDirectory)
artifactName: tinyobjDeployWindows
- job: deployPyPI
# Based on vispy: https://github.com/vispy/vispy/blob/master/azure-pipelines.yml
pool: {vmImage: 'Ubuntu-16.04'}
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
dependsOn:
- linux
- macos
- windows
steps:
- task: UsePythonVersion@0
# TODO(syoyo): Use buildType: specific to download multiple artifacts at once?
- task: DownloadBuildArtifacts@0
inputs:
artifactName: 'tinyobjDeployLinux'
downloadPath: $(Pipeline.Workspace)
- task: DownloadBuildArtifacts@0
inputs:
artifactName: 'tinyobjDeployMacOS'
downloadPath: $(Pipeline.Workspace)
- task: DownloadBuildArtifacts@0
inputs:
artifactName: 'tinyobjDeployWindows'
downloadPath: $(Pipeline.Workspace)
# Publish to PyPI through twine
- bash: |
cd $(Pipeline.Workspace)
find .
python -m pip install --upgrade pip
pip install twine
echo tinyobjDeployLinux/python/dist/*
echo tinyobjDeployLinux/python/wheelhouse/* tinyobjDeployMacOS/python/wheelhouse/* tinyobjDeployWindows/python/wheelhouse/*
twine upload -u "__token__" --skip-existing tinyobjDeployLinux/python/dist/* tinyobjDeployLinux/python/wheelhouse/* tinyobjDeployMacOS/python/wheelhouse/* tinyobjDeployWindows/python/wheelhouse/*
env:
TWINE_PASSWORD: $(pypiToken2)
trigger:
branches:
include:
- '*'
tags:
include:
- 'v*'
pr:
branches:
include:
- "*"