2020-07-07 06:18:33 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-08-12 23:34:20 +08:00
|
|
|
git pull origin master
|
2021-05-30 08:09:01 +08:00
|
|
|
|
|
|
|
old_version=$(grep -Po "(?<=version=')[^']+(?=')" setup.py)
|
|
|
|
echo "Current version is $old_version. New version?"
|
|
|
|
read new_version
|
|
|
|
sed -i "s/version='$old_version'/version='$new_version'/g" setup.py
|
2021-06-25 04:04:38 +08:00
|
|
|
|
2021-07-06 04:33:42 +08:00
|
|
|
read -p "npm build? " -r
|
2021-05-30 08:09:01 +08:00
|
|
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
|
|
|
then
|
|
|
|
cd frontend
|
|
|
|
npm run build
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
2021-07-06 04:33:42 +08:00
|
|
|
read -p "frontend updates? " -r
|
2021-06-25 04:04:38 +08:00
|
|
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
|
|
|
then
|
|
|
|
aws s3 cp gradio/frontend s3://gradio/$new_version/ --recursive
|
|
|
|
echo $new_version > gradio/version.txt
|
|
|
|
fi
|
|
|
|
|
2020-08-11 11:26:49 +08:00
|
|
|
rm -r dist/*
|
|
|
|
rm -r build/*
|
2021-07-09 06:19:42 +08:00
|
|
|
python3 setup.py sdist bdist_wheel
|
|
|
|
python3 -m twine upload dist/*
|
2020-07-07 06:18:33 +08:00
|
|
|
git add -A
|
|
|
|
git commit -m "updated PyPi version"
|
|
|
|
git push origin master
|