-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically deploy linux wheels to pypi via TravisCI (#20)
Add pypi deployment to TravisCI
- Loading branch information
Showing
5 changed files
with
101 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,52 @@ | ||
sudo: false | ||
language: cpp | ||
dist: xenial | ||
compiler: | ||
- clang | ||
- gcc | ||
os: | ||
- osx | ||
- linux | ||
env: | ||
- PYTHON=2.7 | ||
- PYTHON=3.7 | ||
matrix: | ||
exclude: | ||
- os: linux | ||
os: linux | ||
dist: focal | ||
|
||
jobs: | ||
include: | ||
- name: Ubuntu-python2-make | ||
stage: make | ||
services: docker | ||
script: docker run --rm -v ${TRAVIS_BUILD_DIR}:/io:rw -w="/io" quay.io/pypa/manylinux1_x86_64 /io/build-wheels.sh 2 | ||
workspaces: | ||
create: | ||
name: wheels2 | ||
paths: | ||
- wheelhouse | ||
- name: Ubuntu-python3-make | ||
stage: make | ||
services: docker | ||
script: docker run --rm -v ${TRAVIS_BUILD_DIR}:/io:rw -w="/io" quay.io/pypa/manylinux1_x86_64 /io/build-wheels.sh 3 | ||
workspaces: | ||
create: | ||
name: wheels3 | ||
paths: | ||
- wheelhouse | ||
- dist | ||
- name: macOS-python2-make | ||
stage: make | ||
os: osx | ||
env: PYTHON=2.7 | ||
compiler: clang | ||
- os: osx | ||
compiler: gcc | ||
addons: | ||
apt: | ||
packages: | ||
- csh | ||
- python-numpy | ||
- libboost-dev | ||
- libeigen3-dev | ||
- g++ | ||
- clang | ||
homebrew: | ||
packages: | ||
- md5sha1sum | ||
update: true | ||
install: pyenv install -s 3.7-dev | ||
script: ./make_osx.sh | ||
- name: macOS-python3 | ||
stage: make | ||
os: osx | ||
env: PYTHON=3.7 | ||
compiler: clang | ||
install: pyenv install -s 3.7-dev | ||
script: ./make_osx.sh | ||
- name: deploy pypi | ||
stage: deploy | ||
services: docker | ||
workspaces: | ||
use: | ||
- wheels3 | ||
- wheels2 | ||
script: docker run --rm -e PYPI_USER -e PYPI_PASS -v ${TRAVIS_BUILD_DIR}:/io:rw -w="/io" quay.io/pypa/manylinux1_x86_64 /io/pypi-upload.sh | ||
|
||
addons: | ||
install: | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pyenv install -s 3.7-dev; fi | ||
script: | ||
- pyenv global `pyenv versions | grep "^ *$PYTHON" | head -n1` | ||
- mkdir build && cd build | ||
- cmake -DPYTHON_EXECUTABLE:FILEPATH=`pyenv which python$PYTHON` .. | ||
- make | ||
stages: | ||
- make | ||
- name: deploy | ||
if: tag IS present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
cmake_minimum_required(VERSION 3.0.2) | ||
project("LabelLib") | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
if(MSVC) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
pyenv global `pyenv versions | grep "^ *$PYTHON" | head -n1` | ||
mkdir build && cd build | ||
cmake -DPYTHON_EXECUTABLE:FILEPATH=`pyenv which python$PYTHON` .. | ||
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# This script builds python/manylinux wheels | ||
|
||
#Usage: | ||
#git clone --recursive https://github.com/Fluorescence-Tools/LabelLib.git | ||
#docker run -e PYPI_USER=***** -e PYPI_PASS=***** --rm -v `pwd`/LabelLib:/io:rw -w="/io" quay.io/pypa/manylinux1_x86_64 /io/pypi-upload.sh | ||
|
||
set -e | ||
DEFAULT_BIN=/opt/python/cp37-cp37m/bin | ||
|
||
if [ -z "${PYPI_USER}" ] || [ -z "${PYPI_PASS}" ]; then | ||
echo "ERROR PYPI credintials are not set!" | ||
exit 1 | ||
fi | ||
|
||
cat << EOF > ~/.pypirc | ||
[distutils] | ||
index-servers = | ||
pypi | ||
[pypi] | ||
repository: https://upload.pypi.org/legacy/ | ||
username = $PYPI_USER | ||
password = $PYPI_PASS | ||
EOF | ||
|
||
"${DEFAULT_BIN}/pip" install twine | ||
"${DEFAULT_BIN}/twine" upload ./wheelhouse/LabelLib-*.whl ./dist/LabelLib-*.tar.gz |