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

Set up firebase app distribution for android app #111

Merged
merged 10 commits into from
Jan 15, 2024
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ jobs:
steps:

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v1
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
java-version: '17'

- name: Make gradle executable
run: chmod +x ./gradlew
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/deployAndroidDebug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy Android Debug
on:
workflow_dispatch:
inputs:
versionCode:
description: Version Code (eg. 123)
required: true
versionName:
description: Version Name (eg 1.2.3)
required: true

env:
VERSION_CODE: ${{ github.event.inputs.versionCode }}
VERSION_NAME: ${{ github.event.inputs.versionName }}

jobs:
setup:
name: ⚙️Setup Environment
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: "17"

build:
name: 🔨 Build
needs:
- setup
runs-on: ubuntu-latest
steps:
- name: Make gradle executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build --stacktrace

deploy:
name: 🚀 Deploy to Firebase App Distribution
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Make gradle executable
run: chmod +x ./gradlew

- name: Build Debug APK
run: ./gradlew assembleDebug --stacktrace

- name: Firebase App Distribution
uses: wzieba/[email protected]
with:
appId: ${{secrets.FIREBASE_APP_ID}}
serviceCredentialsFileContent: ${{secrets.CREDENTIAL_FILE_CONTENT}}
groups: production
file: appAndroid/build/outputs/apk/debug/appAndroid-debug.apk
53 changes: 0 additions & 53 deletions .github/workflows/deployDebug.yml

This file was deleted.

12 changes: 10 additions & 2 deletions appAndroid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ android {

minSdk = 24
targetSdk = compileSdk
versionCode = 1
versionName = "1.0.0"
versionCode = if (System.getenv("VERSION_CODE").isNullOrEmpty()) {
1
} else {
System.getenv("VERSION_CODE").toInt()
}
versionName = if (System.getenv("VERSION_NAME").isNullOrEmpty()) {
"1.0.0"
} else {
System.getenv("VERSION_NAME")?.toString()
}

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
24 changes: 7 additions & 17 deletions appAndroid/google-services.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
{
"project_info": {
"project_number": "393812441846",
"project_id": "notflix-e6c20",
"storage_bucket": "notflix-e6c20.appspot.com"
"project_number": "107303594937",
"project_id": "notflix-411314",
"storage_bucket": "notflix-411314.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:393812441846:android:88af4c42582e9416204ad7",
"mobilesdk_app_id": "1:107303594937:android:0220df24880eae00cbe468",
"android_client_info": {
"package_name": "com.vickbt.notflix"
}
},
"oauth_client": [
{
"client_id": "393812441846-59nbigdpat8poe70p4tcncpguehsv8ud.apps.googleusercontent.com",
"client_type": 3
}
],
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDjY2tKIDwy6iNmlUj7z9js0sjtJVdufVc"
"current_key": "AIzaSyDGXoQCnf2wd8lZjey16miNnzylMapGJk8"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "393812441846-59nbigdpat8poe70p4tcncpguehsv8ud.apps.googleusercontent.com",
"client_type": 3
}
]
"other_platform_oauth_client": []
}
}
}
Expand Down