-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
70 lines (61 loc) · 3.02 KB
/
.travis.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
sudo: required
dist: bionic
language: cpp
matrix:
include:
# OSX, xcode 8
- os: osx
osx_image: xcode8
env: CMAKE_OPTIONS="-DBUILD_PYTHON_BINDINGS=ON" PYPI=true
# Linux, GCC 6
- os: linux
env: COMPILER_C=gcc-6 COMPILER_CXX=g++-6 CMAKE_OPTIONS="-DBUILD_PYTHON_BINDINGS=ON" PYPI=true
compiler: gcc
before_install:
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
export CC=${COMPILER_C} CXX=${COMPILER_CXX}
sudo apt-get update -q
sudo apt-get install -y g++-6 python3.6-dev python3-pip cmake
fi
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# Install a recent CMake and Python3 (unless already installed on OS X)
brew update
if ! brew ls --version cmake &>/dev/null; then brew install cmake; fi
brew upgrade python
fi
- sudo python3 -m pip install --upgrade six
- sudo python3 -m pip install numpy wheel twine
install:
- echo "Python package build"
- if [ "$TRAVIS_BRANCH" != "master" ]; then export VFRENDERING_ADD_VERSION_EXTENSION=true; else export VFRENDERING_ADD_VERSION_EXTENSION=false; fi
- echo "Add suffix to VFRendering version tag for python package $VFRENDERING_ADD_VERSION_EXTENSION"
# Build the python package
- cd ${TRAVIS_BUILD_DIR}
- python3 setup.py bdist_wheel;
script:
# Specify account details for PyPI
- echo "[distutils]" > ~/.pypirc
- echo "index-servers =" >> ~/.pypirc
- echo " testpypi" >> ~/.pypirc
- echo " pypi" >> ~/.pypirc
- echo "[pypi]" >> ~/.pypirc
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
- echo "username=$PYPIUSER" >> ~/.pypirc
- echo "password=$PYPIPASSWORD" >> ~/.pypirc
- echo "[testpypi]" >> ~/.pypirc
- echo "repository=https://test.pypi.org/legacy/" >> ~/.pypirc
- echo "username=$PYPIUSER" >> ~/.pypirc
- echo "password=$PYPIPASSWORD" >> ~/.pypirc
# Publish python package
- echo "PYPI deployment:"
- if [ "$PYPI" != "true" ]; then echo "Not going to deploy because not configured to."; fi
# Do not build pull requests
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then echo "Not going to deploy because pull request."; fi
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then PYPI=false; fi
# Upload to pypi on master commits (if PYPI == true)
- if [ "$PYPI" == "true" ] && [ "$TRAVIS_BRANCH" == "master" ]; then echo "Deploying to pypi because on master branch."; else echo "Not deploying to pypi."; fi
- if [ "$PYPI" == "true" ] && [ "$TRAVIS_BRANCH" == "master" ]; then twine upload --skip-existing -r pypi dist/*; fi
# Upload to testpypi on all commits (if PYPI == true)
- if [ "$PYPI" == "true" ]; then echo "Deploying to testpypi."; else echo "Not deploying to testpypi."; fi
- if [ "$PYPI" == "true" ]; then twine upload --skip-existing -r testpypi dist/*; fi