forked from rethinkdb/rethinkdb-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload-pypi.sh
More file actions
41 lines (30 loc) · 1015 Bytes
/
upload-pypi.sh
File metadata and controls
41 lines (30 loc) · 1015 Bytes
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
#!/bin/bash
set -e
set -u
export UPLOAD_STAGING=
if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then
echo 'Using staging pypi upload for PR'
export UPLOAD_STAGING='yes'
fi
if [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then
echo 'Using staging pypi upload for cron job'
export UPLOAD_STAGING='yes'
fi
set -ex
python3 -m pip install --upgrade setuptools wheel
if [ "${UPLOAD_STAGING}" = "yes" ]; then
export RETHINKDB_VERSION_DESCRIBE=$(git describe --tags --abbrev=0)
else
export RETHINKDB_VERSION_DESCRIBE=$(git describe --tags --abbrev=8)
fi
python3 setup.py sdist bdist_wheel
python3 -m pip install --upgrade twine
if [ "${UPLOAD_STAGING}" = "yes" ]; then
export TWINE_PASSWORD="${TWINE_STAGEING_PASSWORD}"
export TWINE_USERNAME="${TWINE_STAGEING_USERNAME}"
twine upload --repository-url 'https://test.pypi.org/legacy/' dist/*
python3 -m pip install --index-url 'https://test.pypi.org/simple/' rethinkdb
else
twine upload dist/*
python3 -m pip install rethinkdb
fi