forked from onnx/wheel-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
109 lines (92 loc) · 2.66 KB
/
appveyor.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
# reference: https://www.appveyor.com/docs/appveyor-yml/
version: 0.3.{build}
# build all branches by default
image: Visual Studio 2017
platform: x64
configuration: Release
clone_folder: c:\projects\wheel-builder
clone_depth: 10
# pick as per https://www.appveyor.com/docs/build-environment/#python
environment:
PYPI_PASSWORD:
secure: yARz+ghryFiIZJSwJqFL3BUzWecf8cR54+aKTJApNIM=
PYPI_USERNAME:
secure: Qb6DerVCR79/zeJZrCl1wA==
matrix:
# onnx_ml enabled by default
- ONNX_ML: 1
ONNXPY_DIR: C:\Python36
CONDA_PREFIX: C:\Miniconda36
- ONNX_ML: 1
ONNXPY_DIR: C:\Python36-x64
CONDA_PREFIX: C:\Miniconda36-x64
- ONNX_ML: 1
ONNXPY_DIR: C:\Python35
CONDA_PREFIX: C:\Miniconda35
- ONNX_ML: 1
ONNXPY_DIR: C:\Python35-x64
CONDA_PREFIX: C:\Miniconda35-x64
- ONNX_ML: 1
ONNXPY_DIR: C:\Python37
CONDA_PREFIX: C:\Miniconda37
- ONNX_ML: 1
ONNXPY_DIR: C:\Python37-x64
CONDA_PREFIX: C:\Miniconda37-x64
install:
- cmd: set repo_dir=onnx
- cmd: set build_commit=94d238d96e3fb3a7ba34f03c284b9ad3516163be
- cmd: git submodule update --init --recursive
- cmd: cd %repo_dir%
- cmd: git fetch origin
- cmd: git checkout %build_commit%
- cmd: git clean -fxd
- cmd: git reset --hard
before_build:
- cmd: SET PATH=%CONDA_PREFIX%;%CONDA_PREFIX%\Scripts;%PATH%
- cmd: SET _prefix=%CONDA_PREFIX:~0,14%
- >
IF "%_prefix%"=="C:\Miniconda37"
(
conda install -y -c conda-forge libprotobuf=3.5.2 numpy &&
set "PATH=%PATH%;%CONDA_PREFIX%\Library\bin"
)
ELSE
(
conda install -y -c conda-forge libprotobuf=3.5.2 numpy
)
- cmd: pip install --quiet pytest nbval numpy
build_script:
# Build and test onnx.
- cmd: cd c:\projects\wheel-builder\onnx
- cmd: python setup.py bdist_wheel --universal --dist-dir .
- cmd: pip uninstall -y onnx || ver>nul
- cmd: dir /b /a-d "*.whl" >WheelFile.txt & set /p _wheel= < WheelFile.txt
- cmd: pip install %_wheel%
- cmd: pytest
artifacts:
- path: 'onnx\*.whl'
name: ONNXWheel
# publish artifacts
after_test:
- cmd: set REPO=https://upload.pypi.org/legacy/
- cmd: set TESTREPO=https://test.pypi.org/legacy/
- cmd: set USERNAME=%PYPI_USERNAME%
# Ensure only master branch can trigger build
- >
IF "%APPVEYOR_REPO_BRANCH%" == "master"
(
IF "%APPVEYOR_REPO_TAG%" == "true"
(
python -m pip install twine &&
set HOME=%USERPROFILE% &&
python -m twine upload --skip-existing %_wheel% --repository-url %REPO% -u %USERNAME% -p %PYPI_PASSWORD%
)
)
- >
IF "%APPVEYOR_REPO_BRANCH%" == "pypi_test"
(
python -m pip install twine &&
set HOME=%USERPROFILE% &&
python -m twine upload --skip-existing %_wheel% --repository-url %TESTREPO% -u %USERNAME% -p %PYPI_PASSWORD%
)
- cmd: echo TASK COMPLETED