Skip to content

Commit

Permalink
Automatically Upload to PyPI
Browse files Browse the repository at this point in the history
This commit automatically uploads releases to PyPI under the same
conditions that would trigger an upload of a tarball/checksum to
GitHub releases (docs are uploaded too).
  • Loading branch information
DirectXMan12 committed Apr 25, 2015
1 parent 4052a46 commit bd0a9ab
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 18 deletions.
20 changes: 16 additions & 4 deletions .travis.before-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
#!/bin/sh

# build the docs
# the first run is for the docs build, so don't clean up
pip install -r docs-requirements.txt

# install dependencies so that sphinx doesn't have issues
# (this actually just installs the whole package in dev mode)
pip install -e .

# place in a non-standard location so that they don't get cleaned up
python setup.py build_sphinx --build-dir travis_docs_build

# for the tarball upload
# clean up
git clean -Xdf

# until this gets fixed in dpl
rm setuptools-*.zip

# make the dir
mkdir ./tag_build

Expand All @@ -17,8 +32,5 @@ fi

PKG_NAME_VER="python-gssapi-${PYTHON_GSSAPI_VERSION}"

tar -czvf ./tag_build/${PKG_NAME_VER}.tar.gz --exclude='tag_build' --exclude='.git' --transform "s,^\.,${PKG_NAME_VER}," .
tar -czvf ./tag_build/${PKG_NAME_VER}.tar.gz --exclude='tag_build' --exclude='.git' --exclude='travis_docs_build' --exclude='.git' --transform "s,^\.,${PKG_NAME_VER}," .
sha512sum --binary ./tag_build/${PKG_NAME_VER}.tar.gz > ./tag_build/${PKG_NAME_VER}.sha512sum

# for the docs deploy
pip install -r test-requirements.txt
13 changes: 11 additions & 2 deletions .travis.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
#!/bin/sh -x

# always build in-place so that Sphinx can find the modules
python setup.py build_ext --inplace
BUILD_RES=$?

if [ x"$KRB5_VER" = "xheimdal" ]; then
python setup.py build_ext --inplace
exit $?
# heimdal can't run the tests yet, so just exit
exit $BUILD_RES
fi

if [ $BUILD_RES -ne 0 ]; then
# if the build failed, don't run the tests
exit $BUILD_RES
fi

flake8 setup.py
Expand Down
37 changes: 25 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,29 @@ install: sh -ex .travis.install.sh

script: sh -x .travis.sh

before_deploy: sh .travis.before-deploy.sh
before_deploy: sh -x .travis.before-deploy.sh
deploy:
provider: releases
api_key:
secure: U8RPR6liglI4J8MOSEyK9uxvSFRMcCkKLflpIFKcpUFg+PUuK85YtRdOOL/L/pifat9/KvoF7OJEMNTQjoYAhziMu8GGsiPZlkFzXNiy54FxTTtgprkhllRK7nw/jK/hopKM01goKVaUL860aU+KdpfStRTaAy8ZGEj13jwOMYU=
file:
- tag_build/${TRAVIS_TAG}.md5sum
- tag_build/${TRAVIS_TAG}.tar.gz
on:
repo: pythongssapi/python-gssapi
tags: true
python: "3.4"
condition: "$KRB5_VER = '1.13'"
- provider: releases
api_key:
secure: U8RPR6liglI4J8MOSEyK9uxvSFRMcCkKLflpIFKcpUFg+PUuK85YtRdOOL/L/pifat9/KvoF7OJEMNTQjoYAhziMu8GGsiPZlkFzXNiy54FxTTtgprkhllRK7nw/jK/hopKM01goKVaUL860aU+KdpfStRTaAy8ZGEj13jwOMYU=
file_glob: true
file:
- tag_build/*
on:
repo: pythongssapi/python-gssapi
tags: true
python: "3.4"
condition: "$KRB5_VER = '1.13'"
skip_cleanup: true
- provider: pypi
user:
secure: gMwGf6Zt2BuPHN6Qy4feaJaZQBIYZ1lZIdFcpugyhnWtxytzwApx2LTXqHgdaVK7Ik6Xk97RmWS5SyciKmC2V1nyaHCX/f31QZAD3TrLqhScPtvE6j9j/srJhDBjp5yAT8NENMykeSvoIhiidw1tPzWYRW9c93roaOUv6Kqd3zc=
password:
secure: D0lX+DRVac2GN3bZuKxd45DluBrcvwMfV+cciannEJ39kjbHTQEdpi0Uv92rDLNicjqyjy9rAEP7UAQQ1GDOvZcN5OG1+uWU1tSV84uKPgT92YbbQQdHRs/Rh3KSHKeaiJ+3TTDSeBuXYgWRs2gCeVAb18LBYjtIHLZxCFB8ln0=
on:
repo: pythongssapi/python-gssapi
tags: true
python: "3.4"
condition: "$KRB5_VER = '1.13'"
skip_cleanup: true
docs_dir: travis_docs_build/html

0 comments on commit bd0a9ab

Please sign in to comment.