Skip to content

Commit 841e123

Browse files
committed
feat: Initial code
1 parent 5bb285d commit 841e123

File tree

542 files changed

+23106
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

542 files changed

+23106
-0
lines changed

.firebaserc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.fvmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"flutter": "3.27.1",
3+
"flavors": {}
4+
}

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.g.dart linguist-generated=true
2+
*.gen.dart linguist-generated=true
3+
*.gr.dart linguist-generated=true
4+
*.freezed.dart linguist-generated=true
5+
*.graphql.dart linguist-generated=true
6+
7+
*.g.dart -diff -merge
8+
*.gen.dart -diff -merge
9+
*.gr.dart -diff -merge
10+
*.freezed.dart -diff -merge
11+
*.graphql.dart -diff -merge

.github/CODEOWNERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
# This file defines code owners
3+
# Code owners are automatically requested for review when someone opens a pull request that modifies code that they own.
4+
# You can set specific user as code owner by @user or whole team by @organization/team
5+
# Line bellow would automatically set all members of Android department as reviewers for each PR
6+
#* @strvcom/Android
7+
# More info here - https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
8+
9+
* @HE-LU @michalurbanek @robha141 @Lonchi78 @HsiaoAi

.github/workflows/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Google Play Store Distribution Setup
2+
====================================
3+
4+
To upload to Google Play, we are using [this](https://github.com/r0adkll/upload-google-play) script. Here are quick setup steps you should take to make everything work buttery smooth:
5+
6+
1. Change the package name inside the script, to match your app.
7+
2. Check that you have `whatsnew` folder in your root dir. You can change the name of this folder in the script under the value `whatsNewDirectory`.
8+
3. Create or update changelog files inside the folder. The name of the file should match the pattern `whatsnew-en-US`, where you can specify the language and region. Text placed inside the file will be used as a changelog for the version once it is uploaded to Play Store.
9+
4. You will need to create a new Service Account and put it as a Secret to your Github settings. To do this, follow the [Setup Service Account](#setup_service_account_anchor) section.
10+
5. As a last step, you need to [Setup Google Play Store](#setup_google_play_store_anchor) API Access.
11+
12+
Before you can use this Github Action to automatically build the app and upload it to Play Store, you still need to bundle the first version yourself and upload the first version to the store manually.
13+
14+
Now, you should be able to make your first automatic release to the play store. To do this, you just need to create and push the correct tag on commit. By default, the script uses the following format to start the action: **"vX.X.X-release"**, where the **X.X.X** is the app version.
15+
16+
<a name="setup_service_account_anchor"></a>
17+
## Setup Service Account
18+
First access the Google Cloud Console service account section. Here is a quick [link](https://console.cloud.google.com/iam-admin/serviceaccounts). You will need to create a new Service Account here. I would recommend naming it something like "Google Play Distribution".
19+
20+
![Setup Service Account 1](docs/setup_service_account_1.jpg)
21+
22+
After hitting **"Create and continue"**, you want to give this Service Account **"Editor"** access. So do not forget to set it.
23+
24+
Once the Service Account is created, you want to generate a new key. You can do so under the **"Key"** section when you are inside the service account detail. Here, just hit the **"Add Key"** button, select **"Create new Key"**, and make sure that you have JSON selected before clicking **"Create"**. JSON file with the key should be downloaded automatically. We now need to copy the content of this file and set it as a new Github Secret under Github **Settings -> Secrets -> New Secret**. As a name, we want to use **"GOOGLE_PLAY_DISTRIBUTION_SERVICE_ACCOUNT_JSON"**. In case we want to put a different name, we need to change it inside the Github Action config file. It should look like the following. Once done, hit the **"Add secret"** button.
25+
26+
![Setup Service Account 2](./docs/setup_service_account_2.jpg)
27+
28+
29+
<a name="setup_google_play_store_anchor"></a>
30+
## Setup Google Play Store
31+
32+
### Enable Google Play Android developer API
33+
First, you want to enable **Google Play Android Developer API**. You can also find it inside the Google Cloud Platform, under APIs & Services, or by simply clicking [here](https://console.cloud.google.com/apis/library/androidpublisher.googleapis.com). Make sure you have the correct project selected at the top of the page.
34+
35+
![Setup Google Play Store 1](./docs/setup_google_play_store_1.jpg)
36+
37+
### Invite Service account
38+
Go to [Google Play Console](https://play.google.com/console), select your account and a correct project, and visit tab **"Users and permissions"**. Here you need to click on "Invite new users".
39+
40+
As an email address, use the copied Service Account email. Fill in correct permissions under the **"Account permissions"** Tab. The last step is to hit the **"Invite user"** button at the bottom right corner.
41+
42+
![Setup Google Play Store 2](./docs/setup_google_play_store_2.jpg)
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: "[Release] Android - FirebaseAppDistribution - All"
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*-firebase-all'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
# You need to uncomment [Setup - Flutter Actions with Cache] when you want to use
13+
# different runner then our internal M1 flutter-builds runner.
14+
env:
15+
flutter_version: "3.27.1"
16+
java_version: "17"
17+
18+
jobs:
19+
firebase-app-distribution-build:
20+
name: Firebase App Distribution Build
21+
22+
runs-on: ubuntu-latest
23+
# runs-on: [self-hosted, macOS, flutter-builds] # use this for self-hosted runners
24+
timeout-minutes: 15
25+
26+
steps:
27+
- name: '[Setup - Checkout]'
28+
uses: actions/[email protected]
29+
30+
- name: '[Setup - Java]'
31+
uses: actions/[email protected]
32+
with:
33+
distribution: 'zulu'
34+
java-version: ${{ env.java_version }}
35+
36+
- name: '[Setup - Flutter Actions with Cache]'
37+
uses: subosito/flutter-action@v2
38+
with:
39+
channel: 'stable'
40+
flutter-version: ${{ env.flutter_version }}
41+
cache: true
42+
architecture: x64
43+
cache-key: 'flutter-:os:-:channel:-:version:-:arch:'
44+
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:'
45+
46+
# Make sure we have latest FVM
47+
- name: '[FVM - Install]'
48+
run: dart pub global activate fvm
49+
50+
# Install correct fvm version
51+
- name: '[FVM - Install version]'
52+
run: fvm install ${{ env.flutter_version }}
53+
54+
# Make gen
55+
- name: '[Flutter - Generate code]'
56+
run: make gen
57+
58+
# Develop
59+
- name: '[Flutter - Build Develop APK]'
60+
run: fvm flutter build apk -t lib/main_develop.dart --flavor develop --obfuscate --split-debug-info=build/app/outputs/symbols
61+
62+
- name: '[Create Firebase App Distribution service account file]'
63+
run: echo "${{ secrets.FIREBASE_DEV_CREDENTIAL_FILE_CONTENT }}" | base64 -d > ./android/firebase_app_distribution_service_account.json
64+
65+
- name: '[Flutter - Upload to Develop Firebase App Distribution]'
66+
run: cd android; ./gradlew appDistributionUploadDevelopRelease; cd ..
67+
68+
# TODO: Add correct AppId from the Firebase Project
69+
- name: '[Flutter - Upload Crashlytics Mapping Files]'
70+
run: firebase crashlytics:symbols:upload --app=XXX build/app/outputs/symbols
71+
72+
# Production
73+
- name: '[Flutter - Build Production APK]'
74+
run: fvm flutter build apk -t lib/main_production.dart --flavor production --obfuscate --split-debug-info=build/app/outputs/symbols
75+
76+
- name: '[Create Firebase App Distribution service account file]'
77+
run: echo "${{ secrets.FIREBASE_PROD_CREDENTIAL_FILE_CONTENT }}" | base64 -d > ./android/firebase_app_distribution_service_account.json
78+
79+
- name: '[Flutter - Upload to Production Firebase App Distribution]'
80+
run: cd android; ./gradlew appDistributionUploadProductionRelease; cd ..
81+
82+
# TODO: Add correct AppId from the Firebase Project
83+
- name: '[Flutter - Upload Crashlytics Mapping Files]'
84+
run: firebase crashlytics:symbols:upload --app=XXX build/app/outputs/symbols
85+
86+
# Only on self hosted. Cleanup the files after the build
87+
# - name: '[Finish - Cleanup]'
88+
# run: |
89+
# rm -rf ./* || true
90+
# rm -rf ./.??* || true
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: "[Release] Android - FirebaseAppDistribution - Develop"
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*-develop'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
# You need to uncomment [Setup - Flutter Actions with Cache] when you want to use
13+
# different runner then our internal M1 flutter-builds runner.
14+
env:
15+
flutter_version: "3.27.1"
16+
java_version: "17"
17+
18+
jobs:
19+
firebase-app-distribution-build:
20+
name: Firebase App Distribution Build
21+
22+
runs-on: ubuntu-latest
23+
# runs-on: [self-hosted, macOS, flutter-builds] # use this for self-hosted runners
24+
timeout-minutes: 15
25+
26+
steps:
27+
- name: '[Setup - Checkout]'
28+
uses: actions/[email protected]
29+
30+
- name: '[Setup - Java]'
31+
uses: actions/[email protected]
32+
with:
33+
distribution: 'zulu'
34+
java-version: ${{ env.java_version }}
35+
36+
- name: '[Setup - Flutter Actions with Cache]'
37+
uses: subosito/flutter-action@v2
38+
with:
39+
channel: 'stable'
40+
flutter-version: ${{ env.flutter_version }}
41+
cache: true
42+
architecture: x64
43+
cache-key: 'flutter-:os:-:channel:-:version:-:arch:'
44+
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:'
45+
46+
# Make sure we have latest FVM
47+
- name: '[FVM - Install]'
48+
run: dart pub global activate fvm
49+
50+
# Install correct fvm version
51+
- name: '[FVM - Install version]'
52+
run: fvm install ${{ env.flutter_version }}
53+
54+
# Make gen
55+
- name: '[Flutter - Generate code]'
56+
run: make gen
57+
58+
- name: '[Flutter - Build APK]'
59+
run: fvm flutter build apk -t lib/main_develop.dart --flavor develop --obfuscate --split-debug-info=build/app/outputs/symbols
60+
61+
- name: '[Create Firebase App Distribution service account file]'
62+
run: echo "${{ secrets.FIREBASE_DEV_CREDENTIAL_FILE_CONTENT }}" | base64 -d > ./android/firebase_app_distribution_service_account.json
63+
64+
- name: '[Flutter - Upload to Firebase App Distribution]'
65+
run: cd android; ./gradlew appDistributionUploadDevelopRelease; cd ..
66+
67+
# TODO: Add correct AppId from the Firebase Project
68+
- name: '[Flutter - Upload Crashlytics Mapping Files]'
69+
run: firebase crashlytics:symbols:upload --app=XXX build/app/outputs/symbols
70+
71+
# Only on self hosted. Cleanup the files after the build
72+
# - name: '[Finish - Cleanup]'
73+
# run: |
74+
# rm -rf ./* || true
75+
# rm -rf ./.??* || true
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: "[Release] Android - FirebaseAppDistribution - Production"
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*-production'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
# You need to uncomment [Setup - Flutter Actions with Cache] when you want to use
13+
# different runner then our internal M1 flutter-builds runner.
14+
env:
15+
flutter_version: "3.27.1"
16+
java_version: "17"
17+
18+
jobs:
19+
firebase-app-distribution-build:
20+
name: Firebase App Distribution Build
21+
22+
runs-on: ubuntu-latest
23+
# runs-on: [self-hosted, macOS, flutter-builds] # use this for self-hosted runners
24+
timeout-minutes: 15
25+
26+
steps:
27+
- name: '[Setup - Checkout]'
28+
uses: actions/[email protected]
29+
30+
- name: '[Setup - Java]'
31+
uses: actions/[email protected]
32+
with:
33+
distribution: 'zulu'
34+
java-version: ${{ env.java_version }}
35+
36+
- name: '[Setup - Flutter Actions with Cache]'
37+
uses: subosito/flutter-action@v2
38+
with:
39+
channel: 'stable'
40+
flutter-version: ${{ env.flutter_version }}
41+
cache: true
42+
architecture: x64
43+
cache-key: 'flutter-:os:-:channel:-:version:-:arch:'
44+
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:'
45+
46+
# Make sure we have latest FVM
47+
- name: '[FVM - Install]'
48+
run: dart pub global activate fvm
49+
50+
# Install correct fvm version
51+
- name: '[FVM - Install version]'
52+
run: fvm install ${{ env.flutter_version }}
53+
54+
# Make gen
55+
- name: '[Flutter - Generate code]'
56+
run: make gen
57+
58+
- name: '[Flutter - Build APK]'
59+
run: fvm flutter build apk -t lib/main_production.dart --flavor production --obfuscate --split-debug-info=build/app/outputs/symbols
60+
61+
- name: '[Create Firebase App Distribution service account file]'
62+
run: echo "${{ secrets.FIREBASE_PROD_CREDENTIAL_FILE_CONTENT }}" | base64 -d > ./android/firebase_app_distribution_service_account.json
63+
64+
- name: '[Flutter - Upload to Firebase App Distribution]'
65+
run: cd android; ./gradlew appDistributionUploadProductionRelease; cd ..
66+
67+
# TODO: Add correct AppId from the Firebase Project
68+
- name: '[Flutter - Upload Crashlytics Mapping Files]'
69+
run: firebase crashlytics:symbols:upload --app=XXX build/app/outputs/symbols
70+
71+
# Only on self hosted. Cleanup the files after the build
72+
# - name: '[Finish - Cleanup]'
73+
# run: |
74+
# rm -rf ./* || true
75+
# rm -rf ./.??* || true

0 commit comments

Comments
 (0)