Skip to content

Commit

Permalink
Merge pull request #42 from droidconKE/feature/auth
Browse files Browse the repository at this point in the history
Authentication
  • Loading branch information
MillerAdulu authored Jul 31, 2024
2 parents 47a5821 + e22dc2f commit a67f14c
Show file tree
Hide file tree
Showing 48 changed files with 1,191 additions and 989 deletions.
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
- [ ] ✅ Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore


## Test Changes on Device
You can download your APK from Firebase App Distribution once this PR builds successfully via the following link: https://appdistribution.firebase.dev/i/c796669942f8a811
40 changes: 21 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate production APK
name: Generate Dev APK

on:
push:
Expand Down Expand Up @@ -36,28 +36,30 @@ jobs:
- name: 🕵️ Analyze
run: flutter analyze lib

# - name: ⚙️ Download Android keystore
# id: android_keystore
# uses: timheuer/[email protected]
# with:
# fileName: key.jks
# encodedString: ${{ secrets.RELEASE_KEYSTORE }}
- name: ⚙️ Download Android keystore
id: android_keystore
uses: timheuer/[email protected]
with:
fileName: key.jks
encodedString: ${{ secrets.DEV_KEYSTORE }}

# - name: 🔐 Create key.properties
# run: |
# echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
# echo "storePassword=${{ secrets.RELEASE_KEYSTORE_PASSPHRASE }}" >> android/key.properties
# echo "keyPassword=${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" >> android/key.properties
# echo "keyAlias=${{ secrets.RELEASE_KEYSTORE_ALIAS }}" >> android/key.properties
- name: 🔐 Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
echo "storePassword=${{ secrets.DEV_KEYSTORE_PASSPHRASE }}" >> android/key.properties
echo "keyPassword=${{ secrets.DEV_KEYSTORE_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.DEV_KEYSTORE_ALIAS }}" >> android/key.properties
- name: ⚙️ Build AAB
run: flutter build apk --flavor production --target lib/main_production.dart
- name: ⚙️ Build APK
run: flutter build apk --flavor production --target lib/main_production.dart

- name: 📦 Archive
uses: actions/upload-artifact@v4
- name: 📦 Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
name: production-apk
path: build/app/outputs/flutter-apk/app-production-release.apk
appId: ${{secrets.FIREBASE_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
groups: internal-testing
file: build/app/outputs/flutter-apk/app-production-release.apk

# - name: ⚙️ Setup Ruby
# uses: ruby/setup-ruby@v1
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,28 @@ jobs:
- name: 🕵️ Analyze
run: flutter analyze lib

- name: ⚙️ Download Android keystore
id: android_keystore
uses: timheuer/[email protected]
with:
fileName: key.jks
encodedString: ${{ secrets.DEV_KEYSTORE }}

- name: 🔐 Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
echo "storePassword=${{ secrets.DEV_KEYSTORE_PASSPHRASE }}" >> android/key.properties
echo "keyPassword=${{ secrets.DEV_KEYSTORE_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.DEV_KEYSTORE_ALIAS }}" >> android/key.properties
- name: ⚙️ Build APK
run: flutter build apk --flavor production --target lib/main_production.dart

- name: Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
groups: internal-testing
file: build/app/outputs/flutter-apk/app-production-release.apk

12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ For much smaller fixes like typos, you can skip the create issue step.
Tip: Keep feature contributions small and focused. This makes it easy to review contributions and spot errors if any
## APK Signing
To ensure that the correct SHA1 key is available for signing the APK to enable social auth with Firebase, we need to maintain a single public keystore so that we don't need to add everyone's debug key to the Firebase app.
Create a file `android/key.properties` with values as follows
```jks
storePassword=publicDevKey@2024
keyPassword=publicDevKey@2024
keyAlias=publicDevKey
storeFile=../public-dev-keystore.jks
```
Ensure the `storeFile` path is correct depending on your OS
## App Architecture
### State Management
Expand Down
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ GeneratedPluginRegistrant.java
key.properties
**/*.keystore
**/*.jks
!public-dev-keystore.jks
9 changes: 3 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ android {
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "dev.flutterconke.fluttercon"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
minSdkVersion 23
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down Expand Up @@ -100,12 +97,12 @@ android {

buildTypes {
release {
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
debug {
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
}
}
Expand Down
Binary file added android/public-dev-keystore.jks
Binary file not shown.
44 changes: 35 additions & 9 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
9B9CA4492211BE3FBBB094D3 /* Pods-RunnerTests.profile-staging.xcconfig */,
72B948CA6CD16EA98796ACB5 /* Pods-RunnerTests.profile-development.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -226,7 +225,8 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
14E3FE9DEF97E062EC966A08 /* [CP] Embed Pods Frameworks */,
FBB65C31CB7BD1C328618252 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */,
854873C37B2731981A103088 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */,
E33879E44333D33EE3240A50 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -354,6 +354,24 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
854873C37B2731981A103088 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\"";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=ios --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default\n";
};
918393D15F920ACF475A28B1 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -391,23 +409,22 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
FBB65C31CB7BD1C328618252 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = {
E33879E44333D33EE3240A50 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\"";
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
);
outputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=ios --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -524,6 +541,7 @@
ENABLE_BITCODE = NO;
FLAVOR_APP_NAME = Fluttercon;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -618,6 +636,7 @@
ENABLE_BITCODE = NO;
FLAVOR_APP_NAME = Fluttercon;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -707,6 +726,7 @@
ENABLE_BITCODE = NO;
FLAVOR_APP_NAME = Fluttercon;
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -801,6 +821,7 @@
ENABLE_BITCODE = NO;
FLAVOR_APP_NAME = "[DEV] Fluttercon";
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -893,6 +914,7 @@
ENABLE_BITCODE = NO;
FLAVOR_APP_NAME = "[DEV] Fluttercon";
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -984,6 +1006,7 @@
ENABLE_BITCODE = NO;
FLAVOR_APP_NAME = "[DEV] Fluttercon";
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1078,6 +1101,7 @@
ENABLE_BITCODE = NO;
FLAVOR_APP_NAME = "[STG] Fluttercon";
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1172,6 +1196,7 @@
ENABLE_BITCODE = NO;
FLAVOR_APP_NAME = "[STG] Fluttercon";
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1261,6 +1286,7 @@
ENABLE_BITCODE = NO;
FLAVOR_APP_NAME = "[STG] Fluttercon";
INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Loading

0 comments on commit a67f14c

Please sign in to comment.