gradio/upload_to_pypi.sh

32 lines
691 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-05-30 08:09:01 +08:00
read -p "npm build? " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
cd frontend
npm run build
cd ..
fi
2021-06-25 04:04:38 +08:00
read -p "frontend updates? " -n 1 -r
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/*
2020-07-07 06:18:33 +08:00
python setup.py sdist bdist_wheel
python -m twine upload dist/*
git add -A
git commit -m "updated PyPi version"
git push origin master