Skip to content

Commit

Permalink
Google Play flavor, remove unused ACRA environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrlzy committed Oct 14, 2024
1 parent 6400e4f commit 5fe4384
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 24 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}


Expand Down Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
31 changes: 19 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit 5fe4384

Please sign in to comment.