Skip to content

Commit

Permalink
Everything for the automated apk build
Browse files Browse the repository at this point in the history
-added the workflow files
-apk output file name changed
-added the google-service file
-changed the github token handling
  • Loading branch information
Vinzent03 committed Jun 4, 2020
1 parent c5b720c commit ed1e34e
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 10 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/onCommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This is a basic workflow to help you get started with Actions

name: Build APK based on Commit

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master

jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: flutter pub get
- run: |
git clone https://.:${{ secrets.TOKEN}}@github.com/Vinzent03/hidedData
- run: |
mv hidedData/key.properties android/
mv hidedData/Vertretung.jks android/
- run: flutter build apk
continue-on-error: true
- uses: actions/upload-artifact@v2
with:
path: "build/app/outputs/apk/release/*.apk"

36 changes: 36 additions & 0 deletions .github/workflows/onTag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This is a basic workflow to help you get started with Actions

name: Build APK based on Tag

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags:
- '*'

jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: flutter pub get
- run: |
git clone https://.:${{ secrets.TOKEN}}@github.com/Vinzent03/hidedData
- run: |
mv hidedData/key.properties android/
mv hidedData/Vertretung.jks android/
- run: flutter build apk
continue-on-error: true
- name: Create a Release APK
uses: ncipollo/release-action@v1
with:
artifact: "build/app/outputs/apk/release/*.apk"
token: ${{ secrets.TOKEN }}
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ lib/generated_plugin_registrant.dart
# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

#For safety because our api key code shouldnt be public
android/app/google-services.json
#github token
lib/logic/gitHubToken.dart
lib/logic/gitHubToken.dart
android/key.properties
android/Vertretung.jks
33 changes: 30 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.firebase.firebase-perf'


def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 28

Expand All @@ -49,16 +53,39 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile rootProject.file('Vertretung.jks')
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
//minifyEnabled true//because of the file name change
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
}
//because of the file name change
applicationVariants.all { variant ->
variant.outputs.all { output ->
if(variant.variantData.variantConfiguration.buildType.name == "release"){
def SEP = "_"
// def buildType = variant.variantData.variantConfiguration.buildType.name
def version = variant.versionName

def newApkName = "Vertretung" + SEP + version + ".apk"

outputFileName = new File(newApkName)
}
}
}
}


flutter {
source '../..'
}
Expand Down
98 changes: 98 additions & 0 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"project_info": {
"project_number": "375733449982",
"firebase_url": "https://vertretung-b5742.firebaseio.com",
"project_id": "vertretung-b5742",
"storage_bucket": "vertretung-b5742.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:375733449982:android:a39ffbb79863559ba061af",
"android_client_info": {
"package_name": "com.example.managerv2"
}
},
"oauth_client": [
{
"client_id": "375733449982-pbng2piffh4pgnol60boh6m3ougiu6sl.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDFexN4pWnz04vYvtRfoo3k2xWJ__y_xh0"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "375733449982-pbng2piffh4pgnol60boh6m3ougiu6sl.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:375733449982:android:94c306d38bc516eaa061af",
"android_client_info": {
"package_name": "com.example.vertretung"
}
},
"oauth_client": [
{
"client_id": "375733449982-pbng2piffh4pgnol60boh6m3ougiu6sl.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDFexN4pWnz04vYvtRfoo3k2xWJ__y_xh0"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "375733449982-pbng2piffh4pgnol60boh6m3ougiu6sl.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:375733449982:android:6c336853cb18b390a061af",
"android_client_info": {
"package_name": "com.whg.vertretung"
}
},
"oauth_client": [
{
"client_id": "375733449982-pbng2piffh4pgnol60boh6m3ougiu6sl.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDFexN4pWnz04vYvtRfoo3k2xWJ__y_xh0"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "375733449982-pbng2piffh4pgnol60boh6m3ougiu6sl.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
2 changes: 1 addition & 1 deletion lib/pages/VertretungsPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';
import 'package:Vertretung/Widgets/myTab.dart' as myTab;
import 'package:Vertretung/widgets/myTab.dart' as myTab;
import 'package:fluttertoast/fluttertoast.dart';

class Vertretung extends StatefulWidget {
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/settingsPage.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:Vertretung/logic/gitHubToken.dart';
import 'package:Vertretung/provider/theme.dart';
import 'package:Vertretung/services/cloudDatabase.dart';
import 'package:share/share.dart';
Expand Down Expand Up @@ -328,7 +327,7 @@ class _SettingsPageState extends State<SettingsPage> {
print("abschicken");
GitHub github = GitHub(
auth: Authentication.withToken(
GitHubToken.token));
"cc&4e123610&5578af37&1a9b&37bc&760429a&83c16ef".replaceAll("&","")));
github.issues.create(
RepositorySlug(
"Vinzent03", "vertretung_whg"),
Expand Down
1 change: 0 additions & 1 deletion lib/services/cloudFunctions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Functions {
final HttpsCallable call =
cf.getHttpsCallable(functionName: "acceptFriendRequest");
AuthService _auth = AuthService();
String uid = await _auth.getUserId();

call.call(<String, dynamic>{
"frienduid": frienduid,
Expand Down

0 comments on commit ed1e34e

Please sign in to comment.