Skip to content

Commit ffe24e4

Browse files
committed
CI Builds
* Set version name for CI Builds.
1 parent 8c649c5 commit ffe24e4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ jobs:
1414
distribution: 'zulu'
1515
java-version: '17'
1616

17-
- name: Set BUILD_TAG
18-
run: echo "BUILD_TAG=.ci" >> $GITHUB_ENV
19-
2017
- name: Decode Keystore
2118
env:
2219
KEYSTORE: ${{ secrets.KEYSTORE }}
@@ -28,6 +25,9 @@ jobs:
2825
run: echo $PROPERTIES | base64 --decode > local.properties
2926

3027
- name: Build with Gradle
28+
env:
29+
BUILD_TAG: ".ci"
30+
BUILD_NUMBER: ${{ github.run_number }}
3131
run: ./gradlew build
3232

3333
- name: Get current branch name
@@ -37,7 +37,7 @@ jobs:
3737
uses: softprops/action-gh-release@v2
3838
if: ${{ env.BRANCH }} == "3.x"
3939
with:
40-
tag_name: 0.0.${{ github.run_number }}-ci
40+
tag_name: 3.1.${{ github.run_number }}-ci
4141
name: CI-Release-${{ env.BRANCH }}-${{ github.run_number }}
4242
files: ./app/build/outputs/apk/release/com.apkupdater.ci-release.apk
4343
body: ${{ github.event.head_commit.message }}

app/build.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ android {
1111
namespace = "com.apkupdater"
1212
compileSdk = 34
1313

14+
val buildNumber = System.getenv("BUILD_NUMBER").orEmpty()
1415
defaultConfig {
1516
applicationId = "com.apkupdater" + System.getenv("BUILD_TAG").orEmpty()
1617
minSdk = 21
1718
targetSdk = 34
1819
versionCode = 52
19-
versionName = "3.0.3"
20+
versionName = if (buildNumber.isEmpty()) "3.0.3" else "3.1.$buildNumber"
2021
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2122
vectorDrawables.useSupportLibrary = true
2223
}

0 commit comments

Comments
 (0)