gradio/upload_to_pypi.sh

27 lines
636 B
Bash
Raw Normal View History

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-12-24 16:18:09 +08:00
read -p "frontend updates? " -r
2021-05-30 08:09:01 +08:00
if [[ $REPLY =~ ^[Yy]$ ]]
then
2021-12-24 16:18:09 +08:00
echo -n $new_version > gradio/version.txt
2021-05-30 08:09:01 +08:00
cd frontend
npm run build
cd ..
aws s3 cp gradio/templates/frontend s3://gradio/$new_version/ --recursive
2021-06-25 04:04:38 +08:00
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