Skip to content

Commit

Permalink
feat: add a workflow to generate release APK using input keys and zones
Browse files Browse the repository at this point in the history
  • Loading branch information
MortezaNedaei committed May 5, 2024
1 parent 9cc3c72 commit 2586386
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/change-app.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
#!/bin/bash

PROJECT_DIR=""
if [ -n "${CI_PROJECT_DIR}" ]; then
PROJECT_DIR="${CI_PROJECT_DIR}"
if [ -n "${GITHUB_WORKSPACE}" ]; then
PROJECT_DIR="${GITHUB_WORKSPACE}"
else
PROJECT_DIR=$(dirname "$PWD")
fi

FILE="$PROJECT_DIR/build.gradle.kts"

echo "Project Directory: $PROJECT_DIR"

# shellcheck disable=SC2120
update_app_keys() {
CI_TAPSELL_APP_ID="$1"
CI_ADMOB_APP_ID="$2"
CI_APPLOVIN_APP_ID="$3"

echo "Updating Tapsell App Keys to the new app: TapsellAppId: $CI_TAPSELL_APP_ID - AdmobAppId: $CI_ADMOB_APP_ID - ApplovinAppId: $CI_APPLOVIN_APP_ID"
echo "Updating Tapsell App Keys: TapsellAppId: $CI_TAPSELL_APP_ID - AdmobAppId: $CI_ADMOB_APP_ID - ApplovinAppId: $CI_APPLOVIN_APP_ID"

if [ -n "$CI_TAPSELL_APP_ID" ] && [ -n "$CI_ADMOB_APP_ID" ] && [ -n "$CI_APPLOVIN_APP_ID" ]; then
sed -i '' -e "s/const val TAPSELL_APP_ID.*/const val TAPSELL_APP_ID = \"$CI_TAPSELL_APP_ID\"/" "$FILE"
Expand Down

0 comments on commit 2586386

Please sign in to comment.