From 48a239e65815ede0c12d217b302d18d6d4654166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Br=C3=A9mond?= Date: Mon, 10 Sep 2018 19:13:21 -0700 Subject: [PATCH] [feature] Setup CI deploy script --- .travis.yml | 24 +++++++++++++++--------- tools/ci/deploy.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 9 deletions(-) create mode 100755 tools/ci/deploy.sh diff --git a/.travis.yml b/.travis.yml index 82d4a97d..afbd89e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,14 +90,20 @@ jobs: deploy: - provider: releases - api_key: ${GITHUB_API_KEY} - file_glob: true - file: - - ./package/* - skip_cleanup: true - on: - branch: master - tags: true + - provider: releases + api_key: ${GITHUB_API_KEY} + file_glob: true + file: + - ./package/* + skip_cleanup: true + on: + branch: master + tags: true + + after_deploy: + + - echo "Deploying Python package to PyPI..." + + - ./tools/ci/deploy.sh ################################################################################################################################################################ \ No newline at end of file diff --git a/tools/ci/deploy.sh b/tools/ci/deploy.sh new file mode 100755 index 00000000..1f371b4b --- /dev/null +++ b/tools/ci/deploy.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +################################################################################################################################################################ + +# @project Library/Mathematics +# @file tools/ci/deploy.sh +# @author Lucas Brémond +# @license TBD + +################################################################################################################################################################ + +script_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +project_directory="${script_directory}/../.." +development_directory="${project_directory}/tools/development" + +source "${project_directory}/tools/.env" + +# Deploy Python bindings + +docker run \ +--rm \ +--volume="${project_directory}:/app:rw" \ +--volume="${development_directory}/helpers/build.sh:/app/build/build.sh:ro" \ +--volume="${development_directory}/helpers/test.sh:/app/build/test.sh:ro" \ +--workdir="/app/build" \ +--env="TWINE_USERNAME=${PYPI_USERNAME}" \ +--env="TWINE_PASSWORD=${PYPI_PASSWORD}" \ +${image_name} \ +/bin/bash -c "make publish" + +################################################################################################################################################################ \ No newline at end of file