diff --git a/.travis.yml b/.travis.yml index 4b4eafe9c..78dfc09ea 100755 --- a/.travis.yml +++ b/.travis.yml @@ -79,30 +79,36 @@ matrix: script: - | - chmod +x "${TRAVIS_BUILD_DIR}/CMake/build_${OS_NAME}.sh" + DEPLOY_GITHUB=0 + if [[ "${TRAVIS_TAG}" != "" ]]; then + echo "Doing deploy to github..." + DEPLOY_GITHUB=1 + DEPLOY_GITHUB_SUFFIX=${PYTHON_VERSION}-${OS_NAME}_${OS_VERSION}.tar.gz + fi + DEPLOY_PYPI=0 + if [[ "${DEPLOY_PYPI_ENABLED}" == "1" && "${TRAVIS_TAG}" != "" ]] ; then + DEPLOY_PYPI=1 + fi + cd "${TRAVIS_BUILD_DIR}" + chmod +x "./CMake/build_${OS_NAME}.sh" if [[ ${DOCKER_IMAGE} != "" ]]; then - docker run --name mydocker -v ${TRAVIS_BUILD_DIR}:/home/OpenVisus -td ${DOCKER_IMAGE} /bin/bash - docker exec -ti mydocker /bin/bash -c "cd /home/OpenVisus && ./CMake/build_${OS_NAME}.sh" - docker stop mydocker + opt="" + opt+-" -e PYTHON_VERSION=${PYTHON_VERSION}" + opt+-" -e CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" + opt+-" -e DEPLOY_GITHUB=${DEPLOY_GITHUB}" + opt+-" -e DEPLOY_PYPI=${DEPLOY_PYPI}" + opt+-" -e PYPI_USERNAME=${PYPI_USERNAME}" + opt+-" -e PYPI_PASSWORD=${PYPI_PASSWORD}" + docker run --name mydocker -v $(pwd):/home/OpenVisus ${opt} -td ${DOCKER_IMAGE} /bin/bash + docker exec -ti mydocker /bin/bash -c "cd /home/OpenVisus && ./CMake/build_${OS_NAME}.sh" else - cd "${TRAVIS_BUILD_DIR}" ./CMake/build_${OS_NAME}.sh fi - cd "${TRAVIS_BUILD_DIR}/build/${OS_NAME}" - if [[ "${TRAVIS_TAG}" != "" ]]; then - echo "Doing deploy to github..." - cmake --build ./ --target sdist --config ${CMAKE_BUILD_TYPE} - __file__=$(find ./install/dist -iname "*.tar.gz") - mv ${__file__} ${__file__/.tar.gz/-${PYTHON_VERSION}-${OS_NAME}_${OS_VERSION}.tar.gz} - fi - if [[ "${DEPLOY_PYPI_ENABLED}" == "1" && "${TRAVIS_TAG}" != "" ]] ; then - echo "Doing deploy to pypi..." - cmake --build ./ --target bdist_wheel --config ${CMAKE_BUILD_TYPE} - cmake --build ./ --target pypi --config ${CMAKE_BUILD_TYPE} - fi before_deploy: - export SDIST_FILE=$(find ${TRAVIS_BUILD_DIR}/build/${OS_NAME}/install/dist -iname "*.tar.gz") + - mv ${SDIST_FILE} ${SDIST_FILE/.tar.gz/-${PYTHON_VERSION}-${OS_NAME}_${OS_VERSION}.tar.gz} + - export SDIST_FILE=$(find ${TRAVIS_BUILD_DIR}/build/${OS_NAME}/install/dist -iname "*.tar.gz") deploy: provider: releases diff --git a/CMake/build_manylinux.sh b/CMake/build_manylinux.sh index 97f663077..cbc758efb 100644 --- a/CMake/build_manylinux.sh +++ b/CMake/build_manylinux.sh @@ -43,8 +43,6 @@ function InstallOpenSSL { export LD_LIBRARY_PATH=${OPENSSL_LIB_DIR}:$LD_LIBRARY_PATH } - - # ////////////////////////////////////////////////////// function InstallPython { @@ -134,7 +132,6 @@ PushCMakeOption OPENSSL_ROOT_DIR ${OPENSSL_ROOT_DIR} PushCMakeOption PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} PushCMakeOption PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR} PushCMakeOption PYTHON_LIBRARY ${PYTHON_LIBRARY} - PushCMakeOption PYTHON_PLAT_NAME manylinux1_x86_64 PushCMakeOption PYPI_USERNAME ${PYPI_USERNAME} PushCMakeOption PYPI_PASSWORD ${PYPI_PASSWORD} @@ -156,10 +153,19 @@ else cp $(pyenv prefix)/lib/libpython* install/bin/ fi -cd install +pushd install LD_LIBRARY_PATH=$(pwd)/bin:$(dirname ${PYTHON_LIBRARY}) PYTHONPATH=$(pwd) bin/visus && echo "Embedding working" LD_LIBRARY_PATH=$(pwd)/bin PYTHONPATH=$(pwd) ${PYTHON_EXECUTABLE} -c "import OpenVisus" && echo "Extending working" -cd .. +popd + +if (( DEPLOY_GITHUB == 1 )); then + cmake --build ./ --target sdist --config ${CMAKE_BUILD_TYPE} +fi + +if (( DEPLOY_PYPI == 1 )); then + cmake --build ./ --target bdist_wheel --config ${CMAKE_BUILD_TYPE} + cmake --build ./ --target pypi --config ${CMAKE_BUILD_TYPE} +fi diff --git a/CMake/build_opensuse.sh b/CMake/build_opensuse.sh index 1e5eb0344..214804297 100644 --- a/CMake/build_opensuse.sh +++ b/CMake/build_opensuse.sh @@ -103,13 +103,17 @@ cmake --build . --target test cmake --build . --target install cmake --build . --target deploy -cd install +pushd install LD_LIBRARY_PATH=$(pwd):$(dirname ${PYTHON_LIBRARY}) PYTHONPATH=$(pwd) bin/visus && echo "Embedding working" LD_LIBRARY_PATH=$(pwd) PYTHONPATH=$(pwd) ${PYTHON_EXECUTABLE} -c "import OpenVisus" && echo "Extending working" -cd .. - - - +popd +if (( DEPLOY_GITHUB == 1 )); then + cmake --build ./ --target sdist --config ${CMAKE_BUILD_TYPE} +fi +if (( DEPLOY_PYPI == 1 )); then + cmake --build ./ --target bdist_wheel --config ${CMAKE_BUILD_TYPE} + cmake --build ./ --target pypi --config ${CMAKE_BUILD_TYPE} +fi diff --git a/CMake/build_osx.sh b/CMake/build_osx.sh index 6b326fad8..34c49db30 100644 --- a/CMake/build_osx.sh +++ b/CMake/build_osx.sh @@ -119,12 +119,19 @@ cmake --build ./ --target RUN_TESTS --config ${CMAKE_BUILD_TYPE} cmake --build ./ --target install --config ${CMAKE_BUILD_TYPE} cmake --build ./ --target deploy --config ${CMAKE_BUILD_TYPE} -cd install +pushd install PYTHONPATH=$(pwd) bin/visus.app/Contents/MacOS/visus && echo "Embedding working" PYTHONPATH=$(pwd) python -c "import OpenVisus" && echo "Extending working" -cd .. +popd +if (( DEPLOY_GITHUB == 1 )); then + cmake --build ./ --target sdist --config ${CMAKE_BUILD_TYPE} +fi +if (( DEPLOY_PYPI == 1 )); then + cmake --build ./ --target bdist_wheel --config ${CMAKE_BUILD_TYPE} + cmake --build ./ --target pypi --config ${CMAKE_BUILD_TYPE} +fi diff --git a/CMake/build_ubuntu.sh b/CMake/build_ubuntu.sh index 9930cf8e3..385fbc4a1 100644 --- a/CMake/build_ubuntu.sh +++ b/CMake/build_ubuntu.sh @@ -195,11 +195,19 @@ cmake --build . --target test cmake --build . --target install cmake --build . --target deploy -cd install +pushd install LD_LIBRARY_PATH=$(pwd):$(dirname ${PYTHON_LIBRARY}) PYTHONPATH=$(pwd) bin/visus && echo "Embedding working" LD_LIBRARY_PATH=$(pwd) PYTHONPATH=$(pwd) ${PYTHON_EXECUTABLE} -c "import OpenVisus" && echo "Extending working" -cd .. +popd +if (( DEPLOY_GITHUB == 1 )); then + cmake --build ./ --target sdist --config ${CMAKE_BUILD_TYPE} +fi + +if (( DEPLOY_PYPI == 1 )); then + cmake --build ./ --target bdist_wheel --config ${CMAKE_BUILD_TYPE} + cmake --build ./ --target pypi --config ${CMAKE_BUILD_TYPE} +fi diff --git a/CMakeLists.txt b/CMakeLists.txt index c0f029fd1..a49ebce30 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -425,7 +425,6 @@ if (True) endif() - endif()