Created
June 2, 2023 19:14
-
-
Save hrishikesh-kadam/4623770aa644fac3caf3a927fbcd1c80 to your computer and use it in GitHub Desktop.
Install Bundletool Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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