From c59626724f20386d3ed345a51d024b291185f64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D1=80=D0=BC=D0=B0=D0=BD=20=D0=97=D0=B0=D0=B3?= =?UTF-8?q?=D0=BE=D0=B2=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Sun, 9 Jun 2024 14:38:19 +0500 Subject: [PATCH] 170-Configured-AppDistribution 1) I did that triggers the workflow not only for dev branch 2) Did that buildNumber = GITHUB_SHA::7 --- .github/workflows/sendAppToQaAfterMergeStageQa.yml | 6 +++--- app/build.gradle.kts | 10 +++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/sendAppToQaAfterMergeStageQa.yml b/.github/workflows/sendAppToQaAfterMergeStageQa.yml index 84225e30..853d8f9c 100644 --- a/.github/workflows/sendAppToQaAfterMergeStageQa.yml +++ b/.github/workflows/sendAppToQaAfterMergeStageQa.yml @@ -1,11 +1,11 @@ name: Build and sent to QA stageQa on: - # Triggers the workflow when pull request closed events but only for the "dev" branch + # Triggers the workflow when pull request closed pull_request: types: - closed - branches: [ "dev" ] + workflow_dispatch: @@ -29,7 +29,7 @@ jobs: run: | echo "$CREDENTIAL_FILE_CONTENT" > ./app/serviceCredentialsFile.json echo "App type: stageQa" >> ./app/src/releaseNotes.txt - echo "buildNumber=${GITHUB_RUN_NUMBER}" >> ./app/src/releaseNotes.txt + echo "buildNumber==${GITHUB_SHA::7}">> ./app/src/releaseNotes.txt ./gradlew appDistributionToQaStageQa - name: Check status diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7e135d21..90d06e54 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -23,8 +23,8 @@ android { applicationId = "app.cashadvisor" minSdk = 23 targetSdk = 34 - versionCode = getReleaseVersionCode() - versionName = "$versionCode" + versionCode = 1 + versionName = "1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" initVKID() @@ -223,8 +223,4 @@ fun ApplicationDefaultConfig.initVKID() { ) ) } -fun getReleaseVersionCode(): Int { - val process = Runtime.getRuntime().exec("git rev-list --count HEAD") - val commitCount = process.inputStream.bufferedReader().use { it.readLine()?.toInt() ?: 0 } - return commitCount + 1 -} +