From 67fb356a0917274f2a4deb150c44fc8111971638 Mon Sep 17 00:00:00 2001 From: Andre Weber Date: Tue, 5 Dec 2023 12:19:02 +0100 Subject: [PATCH] chore: Archive APK in Pipeline --- .github/workflows/build-main.yaml | 2 +- .github/workflows/build-pull-request.yaml | 31 ++++++++++++++++++- .../workflows/reusable-build-validation.yaml | 2 +- app/build.gradle.kts | 6 ++-- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-main.yaml b/.github/workflows/build-main.yaml index 2162963..0b1afd0 100644 --- a/.github/workflows/build-main.yaml +++ b/.github/workflows/build-main.yaml @@ -28,7 +28,7 @@ jobs: - uses: ./.github/actions/create-release-apk with: - keystore: ${{ secrets.KEYSTORE_RELEASE }} + keystore: ${{ secrets.KEYSTORE_DEBUG }} key_alias: ${{ secrets.SIGNING_KEY_ALIAS }} key_password: ${{ secrets.SIGNING_KEY_PASSWORD }} store_password: ${{ secrets.SIGNING_STORE_PASSWORD }} diff --git a/.github/workflows/build-pull-request.yaml b/.github/workflows/build-pull-request.yaml index 9e6138f..b570b32 100755 --- a/.github/workflows/build-pull-request.yaml +++ b/.github/workflows/build-pull-request.yaml @@ -3,6 +3,35 @@ name: Validate pull request on: pull_request +env: + GPR_USERNAME: ${{ github.actor }} + GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }} + jobs: - build-project: + validate-build: uses: ./.github/workflows/reusable-build-validation.yaml + + build-project: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/setup-project + + - name: Set Snapshot Version + run: ./gradlew setSnapshotVersion # Do not chain this command because it writes into a file which needs to be re-read inside the next gradle command + + - uses: ./.github/actions/create-release-apk + with: + keystore: ${{ secrets.KEYSTORE_DEBUG }} + key_alias: ${{ secrets.SIGNING_KEY_ALIAS }} + key_password: ${{ secrets.SIGNING_KEY_PASSWORD }} + store_password: ${{ secrets.SIGNING_STORE_PASSWORD }} + + - name: Archive .apk file + uses: actions/upload-artifact@v3 + with: + name: "kuksa_companion_app.pr.apk" + path: app/build/outputs/apk/release/app-release.apk + if-no-files-found: error + retention-days: 14 diff --git a/.github/workflows/reusable-build-validation.yaml b/.github/workflows/reusable-build-validation.yaml index 966de1d..e067368 100755 --- a/.github/workflows/reusable-build-validation.yaml +++ b/.github/workflows/reusable-build-validation.yaml @@ -4,7 +4,7 @@ on: workflow_call: jobs: - build-project: + validate-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index fe2d109..43320d7 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -24,7 +24,7 @@ plugins { id("com.google.devtools.ksp") alias(libs.plugins.kotlin.serialization) kotlin("kapt") - id("com.google.dagger.hilt.android") + alias(libs.plugins.hilt.android) kotlin("android") } @@ -36,8 +36,8 @@ android { applicationId = "org.eclipse.kuksa.companion" minSdk = 27 targetSdk = 33 - versionCode = 1 - versionName = "1.0" + versionCode = rootProject.extra["projectVersionCode"].toString().toInt() + versionName = rootProject.extra["projectVersion"].toString() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables {