Skip to content

Commit

Permalink
Merge pull request #14 from open-space-collective/dev@lucas
Browse files Browse the repository at this point in the history
[feature] Setup CI deploy script
  • Loading branch information
lucas-bremond authored Sep 11, 2018
2 parents bee31c3 + 48a239e commit c3d793e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 9 deletions.
24 changes: 15 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

################################################################################################################################################################
32 changes: 32 additions & 0 deletions tools/ci/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

################################################################################################################################################################

# @project Library/Mathematics
# @file tools/ci/deploy.sh
# @author Lucas Brémond <[email protected]>
# @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"

################################################################################################################################################################

0 comments on commit c3d793e

Please sign in to comment.