forked from hamcrest/PyHamcrest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·51 lines (42 loc) · 1.05 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
HERE=$(unset CDPATH; cd `dirname $0`; pwd)
cd $HERE
function do_release() {
local rc
local ver=$1; shift
local python=${1:-python}; shift
rm -rf $HERE/build
$HERE/.tox/$ver/bin/$python $HERE/setup.py build bdist_egg upload
rc=$?
return $rc
}
function do_test() {
local rc
local ver=$1; shift
local python=${1:-python}; shift
rm -rf $HERE/build
tox -e $ver
rc=$?
return $rc
}
function do_all_vers() {
for python_version in py35 py36 py37 py38; do
$1 $python_version || failed="$failed $python_version"
done
$1 pypy pypy || failed="$failed pypy"
# $1 jython jython || failed="$failed jython"
rc=0
for f in $failed; do
rc=1
echo "$1 failed for $f"
done
if [ $rc -ne 0 ]; then
echo "Skipping $1 due to failures"
return $rc
fi
}
do_all_vers do_test || exit 1
do_all_vers do_release || exit 1
echo "All releases uploaded; uploading source release as well"
$HERE/.tox/py37/bin/python $HERE/setup.py sdist upload
exit $rc