-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·34 lines (26 loc) · 793 Bytes
/
release.sh
File metadata and controls
executable file
·34 lines (26 loc) · 793 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
#!/bin/bash
PROD_STRING="production"
ENV="$1"
if [ "$1" != "$PROD_STRING" ]; then
ENV="test"
fi
if [ -z "$PYTHON_BIN" ]; then
if [ -z "$VIRTUAL_ENV" ]; then
PYTHON_BIN="/usr/bin/python"
else
PYTHON_BIN="python"
fi
fi
SB_VERSION=$(python -c "from solidbyte import __version__ as version; print(version)" | grep '^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+[a-b]\{0,1\}[0-9]*$')
echo "Building $ENV release $SB_VERSION..."
echo "Cleaning dist directory..."
rm -rf dist/*
echo "Building wheel distribution..."
$PYTHON_BIN setup.py sdist bdist_wheel
if [ $ENV == "$PROD_STRING" ]; then
echo "Uploading to PyPi..."
twine upload dist/*
else
echo "Uploading to TestPyPi..."
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
fi