Skip to content

Commit

Permalink
[INJIMOB-1278]: add release/debug build support to android custom bui…
Browse files Browse the repository at this point in the history
…ld (#1597)

Signed-off-by: adityankannan-tw <[email protected]>
Co-authored-by: adityankannan-tw <[email protected]>
  • Loading branch information
adityankannan-tw and Adityankannan authored Sep 9, 2024
1 parent dd1108e commit c29e46b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/android-custom-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ on:
options:
- orange
- purple
type:
description: 'Apk type'
required: true
default: 'release'
type: choice
options:
- release
- debug

jobs:
build-android:
Expand All @@ -45,6 +53,7 @@ jobs:
ESIGNET_HOST: ${{ inputs.esignetBackendServiceUrl }}
APPLICATION_THEME: ${{ inputs.theme }}
ALLOW_ENV_EDIT: ${{ inputs.allow_env_edit }}
APPLICATION_TYPE: ${{ inputs.type }}
KEYSTORE_ALIAS: androidbuildkey
KEYSTORE_PASSWORD: 'password'
SERVICE_LOCATION: '.'
Expand All @@ -53,4 +62,4 @@ jobs:
SCRIPT_NAME: './android-build.sh'
UPLOAD_TO_ACTIONS: 'true'
ANDROID_ARTIFACT_NAME: ${{ inputs.buildName }}
ANDROID_ARTIFACT_PATH: "android/app/build/outputs/apk/residentapp/release/Inji_universal.apk"
ANDROID_ARTIFACT_PATH: "android/app/build/outputs/apk/residentapp/${{ inputs.type }}/Inji_universal.apk"
9 changes: 7 additions & 2 deletions android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ def generate_app_name()
end
end

desc "Verify Build for Android"
lane :android_build do
desc "Verify Release Build for Android"
lane :android_build_release do
gradle(task: "assembleResidentappRelease")
end

desc "Verify Debug Build for Android"
lane :android_build_debug do
gradle(task: "assembleResidentappDebug")
end

desc "Deploy an Internal testing version to the Google Play"
lane :android_build_internal do

Expand Down
9 changes: 8 additions & 1 deletion android/scripts/android-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#As react-native/location npm package is old, We need to run this to map androidX source code

APPLICATION_TYPE=$1

(cd ../../ && npx jetify)

cd ..
Expand All @@ -7,4 +10,8 @@ yes | sudo gem install bundler

yes | sudo fastlane install_plugins

bundle exec fastlane android_build
if [ "$APPLICATION_TYPE" == "debug" ]; then
bundle exec fastlane android_build_debug
else
bundle exec fastlane android_build_release
fi

0 comments on commit c29e46b

Please sign in to comment.