Skip to content

Commit

Permalink
Update generate-apk.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashwat12-egov authored Nov 21, 2024
1 parent 208676f commit 93b090a
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions tools/generate-apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,14 @@ build_apk() {
fi
}

# Ask user for environment to build for
echo "Please select an environment to build for (UAT, DEV, QA or ALL):"
read env
env="${env:-ALL}"

# Ask user for build config
echo "Please select a build config (release or profile):"
read build_config
build_config="${build_config:-release}"

# Build APK for specified environment(s) and build config
if [ "$env" == "ALL" ]; then
env_list=("UAT" "DEV" "QA")
else
env_list=("$env")
fi
# Get environment and build config from GitHub Actions environment variables
build_config="${BUILD_CONFIG:-release}"

./tools/install_bricks.sh

for env_option in "${env_list[@]}"; do
cd "$APP_DIR" || exit

case $env_option in
"UAT")
cp ".env.uat" ".env"
;;
"QA")
cp ".env.qa" ".env"
;;
"DEV")
cp ".env.dev" ".env"
;;
esac

build_apk
cd ../../ || exit

mkdir -p outputs
mv "$APP_DIR/build/app/outputs/flutter-apk/app-$build_config.apk" "outputs/app-$env_option-$build_config.apk"
done

open outputs
echo "APK generation complete."

0 comments on commit 93b090a

Please sign in to comment.