Skip to content

Commit

Permalink
feat: auto release to GitHub (#610)
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnighter committed Oct 13, 2017
1 parent 6f21c0e commit 64b885d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ env:
- secure: "DflyBz+QiyhlhBxn4wN00xu248EJUMjKTxUZQN6wq22qV55xO3ToGJTy9i4D6OBfZGAlSXxjjKCJ2+0sAjsghBSDEK56ud3EEg/08TIo7/T8ex/C58FsGoGFz3yDBATmquClEWN8vAMrLdxwniHmQVCBZCP/phdt5dct0AUuDc8="
- PLAT=x86_64
- UNICODE_WIDTH=32
- GITHUB_REPO=opencobra/cobrapy

matrix:
fast_finish: true
Expand Down Expand Up @@ -94,18 +95,29 @@ script:
fi
- ls ${TRAVIS_BUILD_DIR}/wheelhouse/ || echo "no wheelhouse"

# N.B.: Currently, Travis mangles (escapes) the tag body badly.
#before_deploy:
# - source scripts/prepare_notes.sh

deploy:
- provider: script
skip_cleanup: true
script: scripts/deploy_cobra.sh
on:
tags: true
repo: opencobra/cobrapy
repo: $GITHUB_REPO
- provider: script
script: scripts/deploy_website.sh
on:
tags: true
repo: opencobra/cobrapy
repo: $GITHUB_REPO
condition: $TRAVIS_OS_NAME == "linux" && $MB_PYTHON_VERSION == "3.6"
- provider: releases
api_key: $GITHUB_TOKEN
body: "Please see https://github.com/opencobra/cobrapy/tree/${TRAVIS_TAG}/release-notes/${TRAVIS_TAG}.md for the full release notes."
on:
tags: true
repo: $GITHUB_REPO
condition: $TRAVIS_OS_NAME == "linux" && $MB_PYTHON_VERSION == "3.6"

after_success:
Expand Down
10 changes: 10 additions & 0 deletions scripts/prepare_notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -e

if [[ -n "${TRAVIS_TAG}" && "${TRAVIS_OS_NAME}" == "linux" && "${MB_PYTHON_VERSION}" == "3.6" ]]; then
echo "Parsing ${TRAVIS_BUILD_DIR}/release-notes/${TRAVIS_TAG}.md"
export TAG_NOTES=$(cat "${TRAVIS_BUILD_DIR}/release-notes/${TRAVIS_TAG}.md")
fi

set +e

0 comments on commit 64b885d

Please sign in to comment.