Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADDED] Firebase app distribution task for master #117

Merged
merged 1 commit into from Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/firebase_app_dist.yml
@@ -0,0 +1,46 @@
name: Firebase App Distribution
# Job to automatically distribute app for release build when it gets merged into `master`

on:
push:
branches:
# https://help.github.com/en/actions/reference/events-that-trigger-workflows
# Trigger the workflow on push only for the master branch for Firebase App Distribution
- master

jobs:
build:

runs-on: ubuntu-latest
defaults:
run:
working-directory: ./android-app

steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

# Save gradle cache between runs, see https://github.com/actions/cache/blob/master/examples.md#java---gradle
# Include hashFiles so that cache does continue to grow with old dependencies in it.
- name: Copy gradle cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-

# https://firebase.google.com/docs/app-distribution/android/distribute-gradle#step_4_distribute_your_app_to_testers
- name: Firebase App Distribute
env: # https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
run: ./gradlew assembleRelease appDistributionUploadRelease

- name: Archive APK
uses: actions/upload-artifact@v1
with:
name: app-release
path: android-app/app/build/outputs/apk/release/app-release.apk
6 changes: 6 additions & 0 deletions android-app/app/build.gradle
Expand Up @@ -10,6 +10,7 @@ plugins {
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
id 'org.jlleitschuh.gradle.ktlint'
id 'com.google.firebase.appdistribution'
}
def keystoreProperties = KeystoreUtil.buildProperties(rootProject)

Expand Down Expand Up @@ -58,6 +59,11 @@ android {
shrinkResources true // Enables resource shrinking
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config

firebaseAppDistribution {
releaseNotes="Latest release notes at https://github.com/amardeshbd/android-police-brutality-incidents/releases"
groups="lli-devs"
}
}
debug {
signingConfig signingConfigs.config
Expand Down
1 change: 1 addition & 0 deletions android-app/build.gradle
Expand Up @@ -55,6 +55,7 @@ buildscript {
classpath "com.google.firebase:firebase-crashlytics-gradle:$firebaseCrashlyticsGradle"
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.2.1"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hiltVersion"
classpath 'com.google.firebase:firebase-appdistribution-gradle:2.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down