Skip to content

Instantly share code, notes, and snippets.

@hrishikesh-kadam
Created June 2, 2023 19:14
Show Gist options
  • Save hrishikesh-kadam/4623770aa644fac3caf3a927fbcd1c80 to your computer and use it in GitHub Desktop.
Save hrishikesh-kadam/4623770aa644fac3caf3a927fbcd1c80 to your computer and use it in GitHub Desktop.
Install Bundletool Script
#!/usr/bin/env bash
set -e -o pipefail
if [[ $GITHUB_ACTIONS == "true" ]]; then
# To avoid GitHub API rate limiting
VERSION=$( \
curl --silent --show-error --location --fail \
--output /dev/null \
--write-out "%{url_effective}" \
https://github.com/google/bundletool/releases/latest \
| xargs basename
)
else
VERSION=$( \
curl --silent --show-error --location --fail \
"https://api.github.com/repos/google/bundletool/releases/latest" \
| jq -r .name
)
fi
BUNDLETOOL_PATH="$ANDROID_HOME/bundletool-all.jar"
curl --silent --show-error --location --fail \
--output "$BUNDLETOOL_PATH" \
"https://github.com/google/bundletool/releases/download/$VERSION/bundletool-all-$VERSION.jar"
printf "bundletool "
java -jar "$BUNDLETOOL_PATH" version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment