This repository has been archived by the owner on Mar 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
58 lines (54 loc) · 1.69 KB
/
build.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
58
#!/usr/bin/env bash
set -e
# set -x
if [ "$1" == "docs" ]; then
if [ ! -d "env-docs" ]; then
virtualenv -p $(which python3) env-docs
source env-docs/bin/activate
pip install sphinx sphinx_rtd_theme -U
else
source env-docs/bin/activate
fi
mkdir -p /tmp/docs
sphinx-build -b html docs/ /tmp/docs/
fi
if [ "$1" == "publish-prod" ]; then
rm -rf dist
rm -rf .eggs
rm -rf *.egg-info
rm -rf build
if [ ! -d "env-twine" ]; then
virtualenv -p $(which python3) env-twine
source env-twine/bin/activate
pip install twine
else
source env-twine/bin/activate
fi
python setup.py sdist bdist_wheel --universal
python -m twine upload --verbose dist/*
echo 'Test with the following command, '
echo ' $ pip install bert-etl -U'
fi
if [ "$1" == "publish-test" ]; then
rm -rf dist
rm -rf .eggs
rm -rf *.egg-info
rm -rf build
if [ ! -d "env-twine" ]; then
virtualenv -p $(which python3) env-twine
source env-twine/bin/activate
pip install twine
else
source env-twine/bin/activate
fi
python setup.py sdist bdist_wheel --universal
python -m twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*
echo 'Test with the following command, '
echo ' $ pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple bert-etl -U'
fi
if [ "$1" == "setup-test" ]; then
rm -rf env-test
virtualenv -p $(which python3) env-test
source env-test/bin/activate
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple bert-etl=$(cat VERSION)
fi