diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 296e3ba5e27600d994965ab50b7a98c0de3aa6dd..e9d270097c7b7c5c66808a2c005293e4b95a0254 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,27 @@ -image: quay.io/pypa/manylinux2014_x86_64 +stages: + - test + - build + - deploy -manylinux2014: + +wheel/manylinux2014: + stage: build + image: quay.io/pypa/manylinux2014_x86_64 script: - bash --login tools/pylib/_boutcore_build/build-wheels.sh manylinux2014_x86_64 artifacts: paths: - - /io/wheelhouse/*whl + - wheelhouse/*whl + - dist/*.tar.* + +deploy/pypi: + stage: deploy + image: python:slim + script: + # TWINE_USERNAME and TWINE_PASSWORD are provided by CI secret variables + - pip install twine + - ls -l + - twine upload --repository testpypi wheelhouse/*.whl + needs: + - wheel/manylinux2014 diff --git a/tools/pylib/_boutcore_build/build-wheels.sh b/tools/pylib/_boutcore_build/build-wheels.sh index e85ac1f5587ad0e8f6e80ed7b6f8ef0171ae79a7..b81864e9d93b738165ce7f703eb5a96c5fce0d76 100644 --- a/tools/pylib/_boutcore_build/build-wheels.sh +++ b/tools/pylib/_boutcore_build/build-wheels.sh @@ -1,5 +1,6 @@ set -ex -yum -y install mpich-devel fftw-devel netcdf-cxx-devel +yum -y install fftw-devel netcdf-cxx-devel +yum -y install openmpi3-devel || yum -y install openmpi-1.10-devel if ! module load mpi ; then . /etc/profile module load mpi @@ -21,7 +22,7 @@ function repair_wheel { fi } -for PYBIN in /opt/python/*/bin; +for PYBIN in /opt/python/cp3*/bin; do make clean $PYBIN/pip install numpy cython @@ -29,13 +30,16 @@ do "${PYBIN}/pip" wheel . --no-deps -w wheelhouse/ done +# Build sdist +$PYBIN/python setup.py sdist || : + for whl in wheelhouse/*.whl; do - LD_LIBRARY_PATH=$(pwd)/../../../lib/ repair_wheel "$whl" + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/../../../lib/ repair_wheel "$whl" done ls -l /io/wheelhouse -for PYBIN in /opt/python/*/bin/; do +for PYBIN in /opt/python/cp3*/bin/; do "${PYBIN}/pip" install $NAME --no-index -f /io/wheelhouse if test -e "${PYBIN}/nosetests" then @@ -45,3 +49,11 @@ for PYBIN in /opt/python/*/bin/; do ) fi done + +ls -l wheelhouse || : +mkdir -p wheelhouse +rm -f wheelhouse/*whl +ls -l wheelhouse +cp /io/wheelhouse/*whl wheelhouse/ +ls -l wheelhouse +ls -l