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

Add workflow for Firebase App Distribution #107

Merged
merged 1 commit into from
Dec 30, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: App Distribution
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: App Distribution
name: App Distribution via Firebase for Internal Testing

on:
push:
paths:
- elaichi/**
branches:
- development
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v2
with:
flutter-version: "1.22.5"
channel: "stable"
- name: Get packages
working-directory: ./elaichi
run: flutter pub get
- name: Build APK
working-directory: ./elaichi
run: flutter build apk --release
- name: Decode Service Account
run: echo ${{secrets.SERVICE_ACCOUNT}} | base64 --decode > sa.json
- name: Firebase App Distribution
uses: wzieba/[email protected]
with:
appId: ${{secrets.APP_ID}}
serviceCredentialsFile: sa.json
token: ${{secrets.FIREBASE_TOKEN}}
groups: alpha-testers
file: elaichi/app/build/outputs/flutter-apk/app-release.apk

1 change: 1 addition & 0 deletions elaichi/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ gradle-wrapper.jar
/gradlew
/gradlew.bat
/local.properties
/key.properties
GeneratedPluginRegistrant.java
39 changes: 35 additions & 4 deletions elaichi/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keyStoreProperties = new Properties()
def keyStorePropertiesFile = rootProject.file('key.properties')
if(keyStorePropertiesFile.exists()){
keyStoreProperties.load(new FileInputStream(keyStorePropertiesFile))
}

def dartEnvironmentVariables = [
ENV: null
];
if(project.hasProperty('dart-defines')) {
dartEnvironmentVariables = dartEnvironmentVariables + project.property('dart-defines')
.split(',')
.collectEntries { entry ->
def pair = URLDecoder.decode(entry).split('=')
[(pair.first()): pair.last()]
}
}

android {
compileSdkVersion 28

Expand All @@ -37,19 +55,32 @@ android {
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "tech.dscnitr.elaichi"
applicationId "org.dscnitrourkela.elaichi"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs{
release {
keyAlias keyStoreProperties['keyAlias']
keyPassword keyStoreProperties['keyPassword']
storeFile keyStoreProperties['storeFile'] ? file(keyStoreProperties['storeFile']) : null
storePassword keyStoreProperties['storePassword']
}
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
if(dartEnvironmentVariables.ENV == null){
signingConfig signingConfigs.debug
} else{
signingConfig signingConfigs.release
}
}
debug {
signingConfig signingConfigs.debug
}
}
Expand Down
2 changes: 1 addition & 1 deletion elaichi/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tech.dscnitr.elaichi">
package="org.dscnitrourkela.elaichi">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
2 changes: 1 addition & 1 deletion elaichi/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tech.dscnitr.elaichi">
package="org.dscnitrourkela.elaichi">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.dscnitr.elaichi
package org.dscnitrourkela.elaichi

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
Expand Down
2 changes: 1 addition & 1 deletion elaichi/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tech.dscnitr.elaichi">
package="org.dscnitrourkela.elaichi">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down