Skip to content

Commit

Permalink
170-Configured-AppDistribution
Browse files Browse the repository at this point in the history
1) I did that triggers the workflow not only for dev branch
2) Did that buildNumber = GITHUB_SHA::7
  • Loading branch information
MajoritySky2496 committed Jun 9, 2024
1 parent 0cdcb8e commit c596267
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/sendAppToQaAfterMergeStageQa.yml
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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
Expand Down
10 changes: 3 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
}

0 comments on commit c596267

Please sign in to comment.