Skip to content

Commit 823371e

Browse files
authored
Merge pull request #5 from Wycliffe-USA/Add-Initial-Firebase-and-Fastlane-configuration-for-publishing
Add initial firebase and fastlane configuration for publishing
2 parents 91845f7 + b366843 commit 823371e

File tree

5 files changed

+118
-3
lines changed

5 files changed

+118
-3
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ updates:
55
schedule:
66
interval: daily
77
reviewers:
8-
- gyasistory
8+
- kyle-edwards
99
assignees:
10-
- gyasistory
10+
- kyle-edwards
1111
ignore:
1212
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-*
1313
versions:

.github/workflows/build.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,67 @@ jobs:
128128
with:
129129
name: unit-test-results
130130
path: "**/build/reports/tests/"
131+
132+
test_build:
133+
name: Deploy QA Build
134+
runs-on: ubuntu-latest
135+
if: github.event_name == 'push' && github.ref == 'refs/heads/test'
136+
needs: [ build, checkstyle, ktlint, lint, tests ]
137+
env:
138+
ORG_GRADLE_PROJECT_firebaseAppDistributionKeystoreStorePassword: ${{ secrets.BETA_KEYSTORE_PASSWORD }}
139+
ORG_GRADLE_PROJECT_firebaseAppDistributionKeystoreKeyPassword: ${{ secrets.BETA_KEYSTORE_PASSWORD }}
140+
steps:
141+
- name: Checkout code
142+
uses: actions/checkout@v4
143+
with:
144+
fetch-depth: 0
145+
- name: Setup Java JDK
146+
uses: actions/setup-java@v4
147+
with:
148+
distribution: "temurin"
149+
java-version-file: ".java-version"
150+
- name: Build App
151+
uses: gradle/gradle-build-action@v2
152+
with:
153+
arguments: clean :app:packageProductionQaUniversalApk -PfirebaseAppDistributionBuild --continue --stacktrace
154+
- name: Import Firebase API Key
155+
env:
156+
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
157+
run: echo $FIREBASE_API_KEY > firebase/firebase_api_key.json
158+
- name: Upload Build to Firebase
159+
uses: gradle/gradle-build-action@v2
160+
with:
161+
arguments: appDistributionUploadProductionQa -PfirebaseAppDistributionBuild
162+
163+
beta_build:
164+
name: Deploy Beta Build
165+
runs-on: ubuntu-latest
166+
if: github.event_name == 'push' && github.ref == 'refs/heads/prod'
167+
needs: [ build, checkstyle, ktlint, lint, tests, no_snapshots ]
168+
steps:
169+
- name: Checkout code
170+
uses: actions/checkout@v4
171+
with:
172+
fetch-depth: 0
173+
- name: Setup Java JDK
174+
uses: actions/setup-java@v4
175+
with:
176+
distribution: "temurin"
177+
java-version-file: ".java-version"
178+
- name: Cache Gradle
179+
uses: actions/cache@v3
180+
with:
181+
path: |
182+
~/.gradle/caches
183+
~/.gradle/wrapper
184+
key: ${{ runner.os }}-gradle-${{ github.sha }}
185+
restore-keys: |
186+
${{ runner.os }}-gradle-
187+
- name: Import GooglePlayAPI.json
188+
env:
189+
GOOGLE_PLAY_API_KEY: ${{ secrets.GOOGLE_PLAY_API_KEY }}
190+
run: echo $GOOGLE_PLAY_API_KEY > ./fastlane/GooglePlayAPI.json
191+
- name: Fastlane Beta
192+
env:
193+
GOOGLE_PLAY_UPLOAD_KEY_PASSWORD: ${{ secrets.GOOGLE_PLAY_UPLOAD_KEY_PASSWORD }}
194+
run: fastlane android beta

app/build.gradle.kts

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,51 @@ android {
4747
dataBinding = true
4848
buildConfig = true
4949
}
50-
50+
buildTypes {
51+
named("debug") {
52+
versionNameSuffix = "-dev"
53+
applicationIdSuffix = ".dev"
54+
}
55+
register("qa") {
56+
initWith(getByName("debug"))
57+
matchingFallbacks += listOf("debug")
58+
versionNameSuffix = "-qa"
59+
applicationIdSuffix = ".qa"
60+
61+
if (project.hasProperty("firebaseAppDistributionBuild")) {
62+
signingConfig = signingConfigs.create("firebaseAppDistribution") {
63+
storeFile = project.properties["firebaseAppDistributionKeystorePath"]?.let { rootProject.file(it) }
64+
storePassword = project.properties["firebaseAppDistributionKeystoreStorePassword"].toString()
65+
keyAlias = project.properties["firebaseAppDistributionKeystoreKeyAlias"].toString()
66+
keyPassword = project.properties["firebaseAppDistributionKeystoreKeyPassword"].toString()
67+
}
68+
// TODO: Add when firebase is implemented
69+
// firebaseAppDistribution {
70+
// appId = "1:1053463711496:android:c195e3579737ad79bca6bd"
71+
// releaseNotes = generateFirebaseAppDistributionReleaseNotes()
72+
// serviceCredentialsFile = rootProject.file("firebase/firebase_api_key.json").toString()
73+
// groups = "android-testers"
74+
// }
75+
}
76+
isMinifyEnabled = true
77+
isShrinkResources = true
78+
}
79+
release {
80+
isMinifyEnabled = true
81+
isShrinkResources = true
82+
}
83+
}
84+
sourceSets {
85+
named("qa") {
86+
java.srcDir("src/debug/java")
87+
kotlin.srcDir("src/debug/kotlin")
88+
res.srcDir("src/debug/res/values")
89+
manifest.srcFile("src/debug/AndroidManifest.xml")
90+
}
91+
}
92+
configurations {
93+
named("testImplementation") { extendsFrom(getByName("debugImplementation")) }
94+
}
5195
kapt {
5296
javacOptions {
5397
// Increase the max count of errors from annotation processors.

fastlane/Appfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
2+
package_name("org.wycliffe.mypd") # e.g. com.krausefx.app

fastlane/Fastfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import_from_git(
2+
url: 'https://github.com/CruGlobal/cru-fastlane-files.git',
3+
branch: 'master',
4+
path: 'android/Fastfile'
5+
)

0 commit comments

Comments
 (0)