diff options
Diffstat (limited to 'scripts/bundleUpdate.sh')
-rw-r--r-- | scripts/bundleUpdate.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/bundleUpdate.sh b/scripts/bundleUpdate.sh new file mode 100644 index 000000000..5927a36c8 --- /dev/null +++ b/scripts/bundleUpdate.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -o errexit +set -o pipefail +set -o nounset + +rm -rf bundleTempDir +rm -rf bundle.tar.gz + +echo "Creating tarball..." +node scripts/bundleUpdate.js + +if [ -z "$RUNTIME_VERSION" ]; then + RUNTIME_VERSION=$(cat package.json | jq '.version' -r) +fi + +cd bundleTempDir || exit +BUNDLE_VERSION=$(date +%s) +DEPLOYMENT_URL="https://updates.bsky.app/v1/upload?runtime-version=$RUNTIME_VERSION&bundle-version=$BUNDLE_VERSION&channel=$CHANNEL_NAME&ios-build-number=$BSKY_IOS_BUILD_NUMBER&android-build-number=$BSKY_ANDROID_VERSION_CODE" + +tar czvf bundle.tar.gz ./* + +echo "Deploying to $DEPLOYMENT_URL..." + +curl -o - --form "bundle=@./bundle.tar.gz" --user "bsky:$DENIS_API_KEY" --basic "$DEPLOYMENT_URL" + +cd .. + +rm -rf bundleTempDir +rm -rf bundle.tar.gz |