Skip to content

Commit

Permalink
ci(docs): build docs in seperate step to PyPi deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineDao committed Aug 17, 2019
1 parent f4a7afe commit 78087b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ jobs:
- git config --global user.email "[email protected]"
- git config --global user.name "ladybugbot"
- npx semantic-release
- stage: docs
if: branch = master AND (NOT type IN (pull_request))
script:
- sphinx-apidoc -f -e -d 4 -o ./docs ./ladybug ./ladybug/euclid.py
- sphinx-build -b html ./docs ./docs/_build/docs
deploy:
provider: pages
skip_cleanup: true
Expand Down
28 changes: 4 additions & 24 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
#!/bin/sh

deploy_to_pypi() {
echo "Building distribution"
python setup.py sdist bdist_wheel
echo "Pushing new version to PyPi"
twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD
}

build_docs() {
echo "Building documentation files"
sphinx-apidoc -f -e -d 4 -o ./docs ./ladybug ./ladybug/euclid.py
sphinx-build -b html ./docs ./docs/_build/docs -D release=$1 -D version=$1
}


if [ -n "$1" ]
then
NEXT_RELEASE_VERSION=$1
else
echo "A release version must be supplied"
exit 1
fi

deploy_to_pypi
build_docs $NEXT_RELEASE_VERSION
echo "Building distribution"
python setup.py sdist bdist_wheel
echo "Pushing new version to PyPi"
twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD

0 comments on commit 78087b5

Please sign in to comment.