forked from cuda-networks/django-eb-sqs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-pypi.sh
executable file
·57 lines (46 loc) · 944 Bytes
/
publish-pypi.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
52
53
54
55
56
57
#!/bin/bash
set -e
function log()
{
echo "$(date): $1"
}
function usage()
{
echo "Helper to publish the package to PyPI.
Usage: $0 -p <GITHUB_TAG>
-p <GITHUB_TAG> : Github Tag value, semantic realease format eg: v1.36 or v2.0.7
-h : help
"
exit
}
function publish()
{
log "Installing required dependencies"
pip install -r requirements-pypi.txt
# checkout specific tag version
git checkout tags/"$TAG_PARAM"
# creating the distribution package
rm -rf dist/
python setup.py sdist
python setup.py bdist_wheel
log "Publishing package version/tag: $TAG_PARAM"
twine upload dist/* # add --repository-url https://test.pypi.org/legacy/ to push to TestPyPI
exit
}
# Parse and handle command line options
while getopts ":p:h" OPTION; do
case $OPTION in
p)
TAG_PARAM=$OPTARG
publish
;;
*)
usage
;;
esac
done
# if no args specified
if [ "$#" -ne 1 ]
then
usage
fi