-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·29 lines (21 loc) · 615 Bytes
/
publish.sh
File metadata and controls
executable file
·29 lines (21 loc) · 615 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
#!/bin/bash
set -e
ENVIRONMENT=$1
if [ -z "$ENVIRONMENT" ]; then
ENVIRONMENT="test"
fi
if [ "$ENVIRONMENT" == "prod" ]; then
REPOSITORY=pypi
elif [ "$ENVIRONMENT" == "test" ]; then
REPOSITORY=testpypi
else
echo "First argument which is the environment has to be either 'prod' or 'test' not ${ENVIRONMENT}"
exit 1
fi
[ -e dist ] && rm -rf dist
[ -e build ] && rm -rf build
[ -e river_admin.egg-info ] && rm -rf river_admin.egg-info
python setup.py sdist bdist_wheel
twine check dist/*
echo "Publishing to ${REPOSITORY}"
twine upload --repository "$REPOSITORY" --config-file="${PWD}/.pypirc" dist/*