Skip to content

Commit bd0a9ab

Browse files
committed
Automatically Upload to PyPI
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).
1 parent 4052a46 commit bd0a9ab

File tree

3 files changed

+52
-18
lines changed

3 files changed

+52
-18
lines changed

.travis.before-deploy.sh

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
#!/bin/sh
22

3+
# build the docs
4+
# the first run is for the docs build, so don't clean up
5+
pip install -r docs-requirements.txt
6+
7+
# install dependencies so that sphinx doesn't have issues
8+
# (this actually just installs the whole package in dev mode)
9+
pip install -e .
10+
11+
# place in a non-standard location so that they don't get cleaned up
12+
python setup.py build_sphinx --build-dir travis_docs_build
13+
14+
# for the tarball upload
315
# clean up
416
git clean -Xdf
517

18+
# until this gets fixed in dpl
19+
rm setuptools-*.zip
20+
621
# make the dir
722
mkdir ./tag_build
823

@@ -17,8 +32,5 @@ fi
1732

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

20-
tar -czvf ./tag_build/${PKG_NAME_VER}.tar.gz --exclude='tag_build' --exclude='.git' --transform "s,^\.,${PKG_NAME_VER}," .
35+
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}," .
2136
sha512sum --binary ./tag_build/${PKG_NAME_VER}.tar.gz > ./tag_build/${PKG_NAME_VER}.sha512sum
22-
23-
# for the docs deploy
24-
pip install -r test-requirements.txt

.travis.sh

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
#!/bin/sh -x
22

3+
# always build in-place so that Sphinx can find the modules
4+
python setup.py build_ext --inplace
5+
BUILD_RES=$?
6+
37
if [ x"$KRB5_VER" = "xheimdal" ]; then
4-
python setup.py build_ext --inplace
5-
exit $?
8+
# heimdal can't run the tests yet, so just exit
9+
exit $BUILD_RES
10+
fi
11+
12+
if [ $BUILD_RES -ne 0 ]; then
13+
# if the build failed, don't run the tests
14+
exit $BUILD_RES
615
fi
716

817
flake8 setup.py

.travis.yml

+25-12
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,29 @@ install: sh -ex .travis.install.sh
2323

2424
script: sh -x .travis.sh
2525

26-
before_deploy: sh .travis.before-deploy.sh
26+
before_deploy: sh -x .travis.before-deploy.sh
2727
deploy:
28-
provider: releases
29-
api_key:
30-
secure: U8RPR6liglI4J8MOSEyK9uxvSFRMcCkKLflpIFKcpUFg+PUuK85YtRdOOL/L/pifat9/KvoF7OJEMNTQjoYAhziMu8GGsiPZlkFzXNiy54FxTTtgprkhllRK7nw/jK/hopKM01goKVaUL860aU+KdpfStRTaAy8ZGEj13jwOMYU=
31-
file:
32-
- tag_build/${TRAVIS_TAG}.md5sum
33-
- tag_build/${TRAVIS_TAG}.tar.gz
34-
on:
35-
repo: pythongssapi/python-gssapi
36-
tags: true
37-
python: "3.4"
38-
condition: "$KRB5_VER = '1.13'"
28+
- provider: releases
29+
api_key:
30+
secure: U8RPR6liglI4J8MOSEyK9uxvSFRMcCkKLflpIFKcpUFg+PUuK85YtRdOOL/L/pifat9/KvoF7OJEMNTQjoYAhziMu8GGsiPZlkFzXNiy54FxTTtgprkhllRK7nw/jK/hopKM01goKVaUL860aU+KdpfStRTaAy8ZGEj13jwOMYU=
31+
file_glob: true
32+
file:
33+
- tag_build/*
34+
on:
35+
repo: pythongssapi/python-gssapi
36+
tags: true
37+
python: "3.4"
38+
condition: "$KRB5_VER = '1.13'"
39+
skip_cleanup: true
40+
- provider: pypi
41+
user:
42+
secure: gMwGf6Zt2BuPHN6Qy4feaJaZQBIYZ1lZIdFcpugyhnWtxytzwApx2LTXqHgdaVK7Ik6Xk97RmWS5SyciKmC2V1nyaHCX/f31QZAD3TrLqhScPtvE6j9j/srJhDBjp5yAT8NENMykeSvoIhiidw1tPzWYRW9c93roaOUv6Kqd3zc=
43+
password:
44+
secure: D0lX+DRVac2GN3bZuKxd45DluBrcvwMfV+cciannEJ39kjbHTQEdpi0Uv92rDLNicjqyjy9rAEP7UAQQ1GDOvZcN5OG1+uWU1tSV84uKPgT92YbbQQdHRs/Rh3KSHKeaiJ+3TTDSeBuXYgWRs2gCeVAb18LBYjtIHLZxCFB8ln0=
45+
on:
46+
repo: pythongssapi/python-gssapi
47+
tags: true
48+
python: "3.4"
49+
condition: "$KRB5_VER = '1.13'"
50+
skip_cleanup: true
51+
docs_dir: travis_docs_build/html

0 commit comments

Comments
 (0)