Skip to content

Commit 3e0c344

Browse files
Merge pull request #8 from strvcom/mu/chore/secrets
chore: Secrets handling
2 parents cf77889 + 23d35c8 commit 3e0c344

64 files changed

Lines changed: 963 additions & 647 deletions

File tree

Some content is hidden

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

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
#* @strvcom/Android
77
# More info here - https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
88

9-
* @HE-LU @michalurbanek @robha141 @Lonchi78 @HsiaoAi
9+
@michalurbanek @robha141 @Lonchi78 @HsiaoAi

.github/workflows/android_firebase_app_distribution_all.yml

Lines changed: 0 additions & 90 deletions
This file was deleted.

.github/workflows/android_firebase_app_distribution_develop.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ concurrency:
1212
# You need to uncomment [Setup - Flutter Actions with Cache] when you want to use
1313
# different runner then our internal M1 flutter-builds runner.
1414
env:
15-
flutter_version: "3.27.1"
15+
flutter_version: "3.38.5"
1616
java_version: "17"
1717

1818
jobs:
@@ -21,7 +21,7 @@ jobs:
2121

2222
runs-on: ubuntu-latest
2323
# runs-on: [self-hosted, macOS, flutter-builds] # use this for self-hosted runners
24-
timeout-minutes: 15
24+
timeout-minutes: 25
2525

2626
steps:
2727
- name: '[Setup - Checkout]'
@@ -51,22 +51,35 @@ jobs:
5151
- name: '[FVM - Install version]'
5252
run: fvm install ${{ env.flutter_version }}
5353

54+
# Install sops
55+
- name: '[Secrets - Setup SOPS]'
56+
uses: nhedger/setup-sops@v2
57+
58+
# Load secrets
59+
- name: '[Secrets - Generate keystore and properties]'
60+
env:
61+
SECRETS_ENCRYPT_KEY: ${{ secrets.SECRETS_ENCRYPT_KEY }}
62+
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
63+
RELEASE_PROPERTIES: ${{ secrets.RELEASE_PROPERTIES }}
64+
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_DEV_APP_DISTRIBUTION_SERVICE_ACCOUNT }}
65+
run: ./extras/secrets/tools/load-secrets.sh
66+
5467
# Make gen
5568
- name: '[Flutter - Generate code]'
5669
run: make gen
5770

5871
- name: '[Flutter - Build APK]'
5972
run: fvm flutter build apk -t lib/main_develop.dart --flavor develop --obfuscate --split-debug-info=build/app/outputs/symbols
6073

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-
6474
- name: '[Flutter - Upload to Firebase App Distribution]'
6575
run: cd android; ./gradlew appDistributionUploadDevelopRelease; cd ..
6676

67-
# TODO: Add correct AppId from the Firebase Project
6877
- name: '[Flutter - Upload Crashlytics Mapping Files]'
69-
run: firebase crashlytics:symbols:upload --app=XXX build/app/outputs/symbols
78+
run: cd android;
79+
./gradlew uploadCrashlyticsSymbolFileDevelopRelease;
80+
./gradlew uploadCrashlyticsMappingFileDevelopRelease;
81+
cd ..
82+
7083

7184
# Only on self hosted. Cleanup the files after the build
7285
# - name: '[Finish - Cleanup]'

.github/workflows/android_firebase_app_distribution_production.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ concurrency:
1212
# You need to uncomment [Setup - Flutter Actions with Cache] when you want to use
1313
# different runner then our internal M1 flutter-builds runner.
1414
env:
15-
flutter_version: "3.27.1"
15+
flutter_version: "3.38.5"
1616
java_version: "17"
1717

1818
jobs:
@@ -21,7 +21,7 @@ jobs:
2121

2222
runs-on: ubuntu-latest
2323
# runs-on: [self-hosted, macOS, flutter-builds] # use this for self-hosted runners
24-
timeout-minutes: 15
24+
timeout-minutes: 25
2525

2626
steps:
2727
- name: '[Setup - Checkout]'
@@ -50,23 +50,35 @@ jobs:
5050
# Install correct fvm version
5151
- name: '[FVM - Install version]'
5252
run: fvm install ${{ env.flutter_version }}
53-
53+
54+
# Install sops
55+
- name: '[Secrets - Setup SOPS]'
56+
uses: nhedger/setup-sops@v2
57+
58+
# Load secrets
59+
- name: '[Secrets - Generate keystore and properties]'
60+
env:
61+
SECRETS_ENCRYPT_KEY: ${{ secrets.SECRETS_ENCRYPT_KEY }}
62+
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
63+
RELEASE_PROPERTIES: ${{ secrets.RELEASE_PROPERTIES }}
64+
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_PROD_APP_DISTRIBUTION_SERVICE_ACCOUNT }}
65+
run: ./extras/secrets/tools/load-secrets.sh
66+
5467
# Make gen
5568
- name: '[Flutter - Generate code]'
5669
run: make gen
5770

5871
- name: '[Flutter - Build APK]'
5972
run: fvm flutter build apk -t lib/main_production.dart --flavor production --obfuscate --split-debug-info=build/app/outputs/symbols
6073

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-
6474
- name: '[Flutter - Upload to Firebase App Distribution]'
6575
run: cd android; ./gradlew appDistributionUploadProductionRelease; cd ..
6676

67-
# TODO: Add correct AppId from the Firebase Project
6877
- name: '[Flutter - Upload Crashlytics Mapping Files]'
69-
run: firebase crashlytics:symbols:upload --app=XXX build/app/outputs/symbols
78+
run: cd android;
79+
./gradlew uploadCrashlyticsSymbolFileProductionRelease;
80+
./gradlew uploadCrashlyticsMappingFileProductionRelease;
81+
cd ..
7082

7183
# Only on self hosted. Cleanup the files after the build
7284
# - name: '[Finish - Cleanup]'
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: "[Release] Android - FirebaseAppDistribution - Staging"
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*-staging'
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.38.5"
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: 25
25+
26+
steps:
27+
- name: '[Setup - Checkout]'
28+
uses: actions/checkout@v4.2.1
29+
30+
- name: '[Setup - Java]'
31+
uses: actions/setup-java@v4.4.0
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+
architecture: x64
42+
43+
# Make sure we have latest FVM
44+
- name: '[FVM - Install]'
45+
run: dart pub global activate fvm
46+
47+
# Install correct fvm version
48+
- name: '[FVM - Install version]'
49+
run: fvm install ${{ env.flutter_version }}
50+
51+
# Install sops
52+
- name: '[Secrets - Setup SOPS]'
53+
uses: nhedger/setup-sops@v2
54+
55+
# Load secrets
56+
- name: '[Secrets - Generate keystore and properties]'
57+
env:
58+
SECRETS_ENCRYPT_KEY: ${{ secrets.SECRETS_ENCRYPT_KEY }}
59+
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
60+
RELEASE_PROPERTIES: ${{ secrets.RELEASE_PROPERTIES }}
61+
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_STG_APP_DISTRIBUTION_SERVICE_ACCOUNT }}
62+
run: ./extras/secrets/tools/load-secrets.sh
63+
64+
# Make gen
65+
- name: '[Flutter - Generate code]'
66+
run: make gen
67+
68+
- name: '[Flutter - Build APK]'
69+
run: fvm flutter build apk -t lib/main_staging.dart --flavor staging --obfuscate --split-debug-info=build/app/outputs/symbols
70+
71+
- name: '[Flutter - Upload to Firebase App Distribution]'
72+
run: cd android; ./gradlew appDistributionUploadStagingRelease; cd ..
73+
74+
- name: '[Flutter - Upload Crashlytics Mapping Files]'
75+
run: cd android;
76+
./gradlew uploadCrashlyticsSymbolFileStagingRelease;
77+
./gradlew uploadCrashlyticsMappingFileStagingRelease;
78+
cd ..

.github/workflows/android_play_store_distribution.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ concurrency:
1212
# You need to uncomment [Setup - Flutter Actions with Cache] when you want to use
1313
# different runner then our internal M1 flutter-builds runner.
1414
env:
15-
flutter_version: "3.27.1"
15+
flutter_version: "3.38.5"
1616
java_version: "17"
1717

1818
jobs:
@@ -21,7 +21,7 @@ jobs:
2121

2222
runs-on: ubuntu-latest
2323
# runs-on: [self-hosted, macOS, flutter-builds] # use this for self-hosted runners
24-
timeout-minutes: 15
24+
timeout-minutes: 25
2525

2626
steps:
2727
- name: '[Setup - Checkout]'
@@ -50,7 +50,20 @@ jobs:
5050
# Install correct fvm version
5151
- name: '[FVM - Install version]'
5252
run: fvm install ${{ env.flutter_version }}
53+
54+
# Install sops
55+
- name: '[Secrets - Setup SOPS]'
56+
uses: nhedger/setup-sops@v2
5357

58+
# Load secrets
59+
- name: '[Secrets - Generate keystore and properties]'
60+
env:
61+
SECRETS_ENCRYPT_KEY: ${{ secrets.SECRETS_ENCRYPT_KEY }}
62+
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
63+
RELEASE_PROPERTIES: ${{ secrets.RELEASE_PROPERTIES }}
64+
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_PROD_APP_DISTRIBUTION_SERVICE_ACCOUNT }}
65+
run: ./extras/secrets/tools/load-secrets.sh
66+
5467
# Make gen
5568
- name: '[Flutter - Generate code]'
5669
run: make gen
@@ -74,9 +87,11 @@ jobs:
7487
#status: draft # Upload it as draft release if you want to manually publish the release from GooglePlay console
7588
#userFraction: 0.1 # Rollout of the release <0;1>
7689

77-
# TODO: Add correct AppId from the Firebase Project
7890
- name: '[Flutter - Upload Crashlytics Mapping Files]'
79-
run: firebase crashlytics:symbols:upload --app=XXX build/app/outputs/symbols
91+
run: cd android;
92+
./gradlew uploadCrashlyticsSymbolFileProductionRelease;
93+
./gradlew uploadCrashlyticsMappingFileProductionRelease;
94+
cd ..
8095

8196
# Only on self hosted. Cleanup the files after the build
8297
# - name: '[Finish - Cleanup]'

.github/workflows/flutter_project_codecheck_android.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111
# You need to uncomment [Setup - Flutter Actions with Cache] when you want to use
1212
# different runner then our internal M1 flutter-builds runner.
1313
env:
14-
flutter_version: "3.27.1"
14+
flutter_version: "3.38.5"
1515
java_version: "17"
1616

1717
jobs:
@@ -20,7 +20,7 @@ jobs:
2020

2121
runs-on: ubuntu-latest
2222
# runs-on: [self-hosted, macOS, flutter-builds] # use this for self-hosted runners
23-
timeout-minutes: 15
23+
timeout-minutes: 25
2424

2525
steps:
2626
- name: '[Setup - Checkout]'
@@ -50,6 +50,19 @@ jobs:
5050
- name: '[FVM - Install version]'
5151
run: fvm install ${{ env.flutter_version }}
5252

53+
# Install sops
54+
- name: '[Secrets - Setup SOPS]'
55+
uses: nhedger/setup-sops@v2
56+
57+
# Load secrets
58+
- name: '[Secrets - Generate keystore and properties]'
59+
env:
60+
SECRETS_ENCRYPT_KEY: ${{ secrets.SECRETS_ENCRYPT_KEY }}
61+
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
62+
RELEASE_PROPERTIES: ${{ secrets.RELEASE_PROPERTIES }}
63+
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_STG_APP_DISTRIBUTION_SERVICE_ACCOUNT }}
64+
run: ./extras/secrets/tools/load-secrets.sh
65+
5366
# Make gen
5467
- name: '[Flutter - Generate code]'
5568
run: make gen
@@ -60,7 +73,7 @@ jobs:
6073

6174
# Build is slightly faster when targeting single platform, debug version and only apk instead of appbundle
6275
- name: '[Flutter - Build APK]'
63-
run: fvm flutter build apk -t lib/main_develop.dart --flavor develop --target-platform android-arm64 --debug
76+
run: fvm flutter build apk -t lib/main_staging.dart --flavor staging --target-platform android-arm64 --obfuscate --split-debug-info=build/app/outputs/symbols --debug
6477

6578
# Only on self hosted. Cleanup the files after the build
6679
# - name: '[Finish - Cleanup]'

0 commit comments

Comments
 (0)