From 5fe4384f1a6127873dc41562d04fefd6aae2b76e Mon Sep 17 00:00:00 2001 From: mdrlzy Date: Mon, 14 Oct 2024 13:12:32 +0600 Subject: [PATCH] Google Play flavor, remove unused ACRA environment variables --- .github/workflows/build.yml | 22 ++++++++++++++-------- .github/workflows/release.yml | 5 +---- app/build.gradle | 31 +++++++++++++++++++------------ 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4dae67dfb..7f898d649 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,9 +7,6 @@ on: branches: [ main ] env: - ACRA_LOGIN: ${{ secrets.ACRARIUM_BASIC_AUTH_LOGIN }} - ACRA_PASS: ${{ secrets.ACRARIUM_BASIC_AUTH_PASSWORD }} - ACRA_URI: ${{ secrets.ACRARIUM_URI }} BRANCH_NAME: ${{ github.ref_name }} @@ -77,14 +74,23 @@ jobs: echo "${{ secrets.GOOGLE_ENCRYPTED }}" > google-services.asc gpg -d --passphrase "${{ secrets.GOOGLE_PASSWORD }}" --batch google-services.asc > app/google-services.json - - name: Build release APK - run: ./gradlew assembleRelease + - name: Build release Github APK + run: ./gradlew assembleGithub - - name: Upload release APK + - name: Build release GooglePlay APK + run: ./gradlew assembleGoogleplay + + - name: Upload Github APK + uses: actions/upload-artifact@v4 + with: + name: ark-rate-github + path: ./app/build/outputs/apk/github/release/ark-rate-github-release.apk + + - name: Upload GooglePlay APK uses: actions/upload-artifact@v4 with: - name: ark-rate - path: ./app/build/outputs/apk/release/ark-rate-release.apk + name: ark-rate-googleplay + path: ./app/build/outputs/apk/googleplay/release/ark-rate-googleplay-release.apk lint: needs: build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f34a487c5..6a72e7e3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,9 +10,6 @@ jobs: runs-on: ubuntu-latest environment: Development env: - ACRA_LOGIN: ${{ secrets.ACRARIUM_BASIC_AUTH_LOGIN }} - ACRA_PASS: ${{ secrets.ACRARIUM_BASIC_AUTH_PASSWORD }} - ACRA_URI: ${{ secrets.ACRARIUM_URI }} BRANCH_NAME: ${{ github.ref_name }} steps: - uses: actions/checkout@v4 @@ -42,5 +39,5 @@ jobs: - name: Release uses: ncipollo/release-action@v1 with: - artifacts: "./app/build/outputs/apk/release/*.apk" + artifacts: "./app/build/outputs/apk/*/release/*.apk" token: ${{ secrets.GITHUB_TOKEN }} diff --git a/app/build.gradle b/app/build.gradle index c3b04a84f..5352219e8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,14 +19,6 @@ android { versionName "1.2.0" setProperty("archivesBaseName", "ark-rate") - def login = System.getenv("ACRA_LOGIN") ?: "" - def password = System.getenv("ACRA_PASS") ?: "" - def uri = System.getenv("ACRA_URI") ?: "" - buildConfigField "String", "ACRA_LOGIN", "\"$login\"" - buildConfigField "String", "ACRA_PASS", "\"$password\"" - buildConfigField "String", "ACRA_URI", "\"$uri\"" - buildConfigField "boolean", "GOOGLE_PLAY_BUILD", "false" - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { useSupportLibrary true @@ -39,10 +31,10 @@ android { signingConfigs { testRelease { - storeFile project.rootProject.file('keystore.jks') - storePassword "sw0rdf1sh" - keyAlias "ark-builders-test" - keyPassword "rybamech" + storeFile project.rootProject.file('testtest.jks') + storePassword "testtest" + keyAlias "key0" + keyPassword "testtest" v1SigningEnabled true v2SigningEnabled true } @@ -67,6 +59,21 @@ android { ] } } + flavorDimensions = ["publishTarget"] + productFlavors { + github { + dimension "publishTarget" + buildConfigField "boolean", "GOOGLE_PLAY_BUILD", "false" + } + + googleplay { + dimension "publishTarget" + buildConfigField "boolean", "GOOGLE_PLAY_BUILD", "true" + } + } + + + compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17