gradio/scripts/upload_to_pypi.sh
aliabid94 59cf32e0f4
Still fixing 3 1 3a (#1932)
* changes

* changes

* changes
2022-08-02 08:23:37 -07:00

35 lines
914 B
Bash
Executable File

#!/bin/bash
cd "$(dirname ${0})/.."
source scripts/helpers.sh
git_required
pnpm_required
aws_required
echo "Uploading to PyPI..."
set -e
git pull origin main
old_version="$(cat gradio/version.txt)"
read -p "Current version is ${old_version}. What is the new version? " new_version
echo "So you want to release version ${new_version}. Updating gradio/version.txt..."
echo "${new_version}" > gradio/version.txt
GRADIO_VERSION=$new_version
rm -rf gradio/templates/frontend
rm -rf gradio/templates/cdn
cd ui
pnpm i
pnpm build
GRADIO_VERSION=$new_version pnpm build:cdn
cd ..
aws s3 cp gradio/templates/cdn "s3://gradio/${new_version}/" --recursive # Contact maintainers for credentials
cp gradio/templates/cdn/index.html gradio/templates/frontend/share.html
rm -r dist/*
rm -r build/*
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
git add -A
git commit -m "Updated version to ${new_version}"