diff --git a/Jenkinsfile b/Jenkinsfile index 159e545327785bf5df2a78af17d8d565be9febde..76a2158cc7e651232de2ce3dc819ef5091c3d2d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,29 +10,21 @@ pipeline { } stages { - /* stage('Build') { + // STAGE 1 - Build the application + stage('Build') { steps { - script { - // Your initial build steps here - echo 'Building...' - } - } - } - - stage('upload to drive') { - steps { script { // Use absolute path to Fastlane def fastlanePath = '/home/karthik_shetty_niveussolutions_c/usr/local/bin/fastlane' env.PATH = "${fastlanePath}:${env.PATH}" // Run Fastlane deploy for Firebase App distribution - sh 'sudo fastlane deployToDrive' + sh 'fastlane build' } - } - - } */ - + } + } + + // STAGE 2 - Upload the build to Firebase App Distribution Channel stage('Firebase App Distribution') { steps { script { @@ -46,6 +38,7 @@ pipeline { } } + // STAGE 3 - Upload the build to Google Playstore Alpha Track stage('Playstore Alpha Testing') { steps { script { @@ -61,8 +54,6 @@ pipeline { } - - post { always { // Clean up steps if needed diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a473a66bd8016825df9baf119c5af476c891d6d1..366b428b4495d6756644a88a3eecc2ad1d15793e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -21,8 +21,8 @@ android { applicationId = "com.kp.testapp" minSdk = 25 targetSdk = 34 - versionCode = 2 - versionName = "1.0.1" + versionCode = 3 + versionName = "1.0.3" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 061ce8a20d082e94c94abfcc6e86d93e825e9de1..b41174f09f65c52b785e323c420d94a5650a1758 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -16,18 +16,25 @@ default_platform(:android) platform :android do + # get the required prerequisites like credentials, app ids etc. before_all do ENV["FIREBASE_LOGIN_CREDENTIALS"] = "fastlane/fastlane-admin-app-distribution.json" ENV["FIREBASE_APP_ID"] = "1:771295755070:android:5007592bd3aba1c3ec0a6f" end - ######## FIREBASE DISTRIBUTION ######## - desc "Submit a new Google Test Build to Firebase App Distribution" + ######## Generate the Apk and App bundle ######## + desc "build the apk or bundle" + lane :build do + gradle(task: "clean assembleDebug") # generates debug build + gradle(task: "bundleRelease") # generates signed release bundle + end + + + ######## Upload apk to Firebase Distribution Channel ######## + desc "Upload build to Firebase App Distribution" lane :distributeViaFirebase do |options| - #gradle(task: "bundleRelease") - gradle(task: "clean assembleDebug") + #gradle(task: "clean assembleDebug") - #apk_path = "app/build/outputs/bundle/release/app-release.aab" apk_path = "app/build/outputs/apk/debug/app-debug.apk" firebase_app_distribution( @@ -39,24 +46,19 @@ platform :android do ) end - desc "build the apk" - lane :build do - gradle(task: "bundleRelease") - #gradle(task: "clean assembleDebug") - # gradle(task: "clean assembleRelease") - end + ######## Upload app bundle to Google Playstore Alpha Track ######## + desc "Deploy a new version to the Google Play Store - Alpha Track" + lane :deployToPlaystoreAlpha do + #gradle(task: "bundleRelease") - desc "Deploy a new version to the Google Play - Alpha" - lane :deployToPlaystoreAlpha do - gradle(task: "bundleRelease") - upload_to_play_store( - track: "alpha", + upload_to_play_store( + track: "alpha", # alpha or beta or internal or production json_key: "/home/karthik_shetty_niveussolutions_c/prj-common-services-01-0c9b948542c2.json", package_name: "com.kp.testapp", aab: "app/build/outputs/bundle/release/app-release.aab", skip_upload_metadata: true, # Set to false if you want to upload metadata (e.g., changelog) skip_upload_images: true, # Set to false if you want to upload screenshots, feature graphics, etc. - skip_upload_apk: true + skip_upload_apk: true # Set to true if opting for App Bundle ) end