2023-07-22 02:13:21 +08:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "$(dirname ${0})"
|
|
|
|
|
2023-09-16 07:23:52 +08:00
|
|
|
# You should update the version in package.json before running this script
|
|
|
|
FILE="gradio/package.json"
|
|
|
|
new_version=$(python -c "import json; f = open('$FILE', 'r'); data = json.load(f); print(data['version']); f.close();")
|
2023-09-19 12:06:09 +08:00
|
|
|
GRADIO_VERSION=$new_version
|
2023-07-22 02:13:21 +08:00
|
|
|
|
|
|
|
rm -rf gradio/templates/frontend
|
|
|
|
rm -rf gradio/templates/cdn
|
2023-08-25 01:22:28 +08:00
|
|
|
pnpm i --frozen-lockfile --ignore-scripts
|
2023-07-22 02:13:21 +08:00
|
|
|
GRADIO_VERSION=$new_version pnpm build
|
|
|
|
GRADIO_VERSION=$new_version pnpm build:cdn
|
2023-08-25 02:47:17 +08:00
|
|
|
aws s3 cp gradio/templates/cdn "s3://gradio/${new_version}/" --recursive --region us-west-2
|
2023-07-22 02:13:21 +08:00
|
|
|
cp gradio/templates/cdn/index.html gradio/templates/frontend/share.html
|
|
|
|
|
|
|
|
rm -rf dist/*
|
|
|
|
rm -rf build/*
|
|
|
|
python3 -m build
|