Skip to content

Commit

Permalink
Add PyPI deployment configuration to Travis-CI
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Apr 27, 2020
1 parent ac848db commit 8926025
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ before_deploy:
- python setup.py sdist bdist_wheel
- twine check dist/*

deploy:
provider: script
script: ci/travis/deploy.sh
skip_cleanup: true
on:
python: 3.8
tags: true
branch: master
repo: althonos/pyrodigal

notifications:
email:
- [email protected]
19 changes: 19 additions & 0 deletions ci/functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

log() {
tput bold
tput setaf 2
printf "%12s " $1
tput sgr0
shift 1
echo $@
}

error() {
tput bold
tput setaf 1
printf "%12s " $1
tput sgr0
shift 1
echo $@
}
19 changes: 19 additions & 0 deletions ci/travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

. $(dirname $0)/functions.sh

# --- Update GitHub release notes --------------------------------------------

export GEM_PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')"
export PATH="${GEM_PATH}/bin:$PATH"

log Installing chandler gem
gem install --user-install chandler

log Updating GitHub release notes
chandler push --github="$TRAVIS_REPO_SLUG" --changelog="CHANGELOG.md"

# --- Deploy to PyPI ---------------------------------------------------------

log Deploying to PyPI
python3 -m twine upload --skip-existing dist/*.whl dist/*.tar.gz

0 comments on commit 8926025

Please sign in to comment.