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

Release to dev #200

Merged
merged 14 commits into from
Sep 27, 2023
87 changes: 81 additions & 6 deletions .github/workflows/release_to_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ on:
- release_to_dev

jobs:
build:
runs-on: macOS-latest
release-android-to-dev-firebase:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Firebase CLI
run: npm install -g firebase-tools

- name: Read Flutter SDK version
run: echo "FLUTTER_VERSION=$(jq -r '.flutterSdkVersion' .fvm/fvm_config.json)" >> $GITHUB_ENV
shell: bash
Expand All @@ -32,9 +35,81 @@ jobs:
run: cd packages/mottai_flutter_app && flutter pub get

- name: Create dev-dart-define.json from GitHub secret
run: echo '${{ secrets.DEV_DART_DEFINE_JSON_STRING }}' > packages/mottai_flutter_app/dev-dart-define.json

- name: Create secret.properties
run: |
echo "googleMap.apiKey=${{ secrets.DEV_GOOGLE_MAP_API_KEY }}" > packages/mottai_flutter_app/android/secret.properties

- name: Create keystore.properties
run: |
echo '${{ secrets.KEYSTORE_PROPERTIES }}' > packages/mottai_flutter_app/android/keystore.properties

- name: Decode release.jks from GitHub secrets
run: echo "${{ secrets.RELEASE_JKS_BASE64_STRING }}" | base64 --decode > packages/mottai_flutter_app/android/app/release.jks

- name: flutter build appbundle
run: |
cd packages/mottai_flutter_app
echo '${{ secrets.DEV_DART_DEFINE_JSON_STRING }}' > dev-dart-define.json
flutter build appbundle --release \
--dart-define-from-file="dev-dart-define.json" \
-t "lib/main.dart" \
--build-name=$(grep 'version:' pubspec.yaml | cut -d ' ' -f 2 | cut -d '+' -f 1) \
--build-number=$GITHUB_RUN_NUMBER

- name: Get latest 10 commit messages
run: echo "LATEST_COMMIT_MESSAGES=$(git log -n 10 --pretty=format:'%s' | tr '\n' '; ')" >> $GITHUB_ENV

- name: Deploy to Firebase
env:
DEV_FIREBASE_SERVICE_ACCOUNT_KEY_BASE64: ${{ secrets.DEV_FIREBASE_SERVICE_ACCOUNT_KEY_BASE64 }}
run: |
echo $DEV_FIREBASE_SERVICE_ACCOUNT_KEY_BASE64 | base64 -d > /tmp/dev_firebase_service_account_key.json
export GOOGLE_APPLICATION_CREDENTIALS=/tmp/dev_firebase_service_account_key.json
firebase use dev
firebase appdistribution:distribute packages/mottai_flutter_app/build/app/outputs/bundle/release/app-release.aab \
--app ${{ secrets.DEV_FIREBASE_ANDROID_APP_ID }} \
--groups internal-testers \
--release-notes "${LATEST_COMMIT_MESSAGES}"

- name: Create service_account.json
run: echo "${{ secrets.GPC_API_KEY_BASE64 }}" | base64 --decode > service_account.json

- name: Upload to GPC
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service_account.json
packageName: com.kosukesaigusa.mottai_flutter_app.dev2
releaseFiles: packages/mottai_flutter_app/build/app/outputs/bundle/release/app-release.aab
track: internal

release-ios-to-dev-testflight:
runs-on: macOS-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Read Flutter SDK version
run: echo "FLUTTER_VERSION=$(jq -r '.flutterSdkVersion' .fvm/fvm_config.json)" >> $GITHUB_ENV
shell: bash

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}

- name: flutter pub get (dart_flutter_common)
run: cd packages/dart_flutter_common && flutter pub get

- name: flutter pub get (firebase_common)
run: cd packages/firebase_common && flutter pub get

- name: flutter pub get (mottai_flutter_app)
run: cd packages/mottai_flutter_app && flutter pub get

- name: Create dev-dart-define.json from GitHub secret
run: echo '${{ secrets.DEV_DART_DEFINE_JSON_STRING }}' > packages/mottai_flutter_app/dev-dart-define.json

- name: Prepare Xcode build settings
run: |
Expand All @@ -53,7 +128,7 @@ jobs:
mv DartDefines.xcconfig ios/

# ios/Flutter/Release.xcconfig ファイルに追記する
echo "#include "DartDefines.xcconfig"" >> ios/Flutter/Release.xcconfig
echo '#include "DartDefines.xcconfig"' >> ios/Flutter/Release.xcconfig

- name: Decode and install provisioning profile
run: |
Expand Down Expand Up @@ -116,7 +191,7 @@ jobs:
run: |
cd packages/mottai_flutter_app
xcrun altool --validate-app \
-f "./build/ios/ipa/mottai_dev.ipa" \
-f $IPA_PATH \
-t ios \
--apiKey ${{ secrets.DEV_IOS_API_KEY }} \
--apiIssuer ${{ secrets.DEV_IOS_API_ISSUER }} \
Expand All @@ -126,7 +201,7 @@ jobs:
run: |
cd packages/mottai_flutter_app
xcrun altool --upload-app \
-f "./build/ios/ipa/mottai_dev.ipa" \
-f $IPA_PATH \
-t ios \
--apiKey ${{ secrets.DEV_IOS_API_KEY }} \
--apiIssuer ${{ secrets.DEV_IOS_API_ISSUER }} \
Expand Down
3 changes: 2 additions & 1 deletion packages/mottai_flutter_app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationIdSuffix appIdSuffix
// .dev の開発版 Android アプリを削除することにした都合による特別対応
applicationIdSuffix appIdSuffix == '.dev' ? '.dev2' : appIdSuffix
resValue "string", "app_name", appName
// 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,75 @@
}
},
"oauth_client": [
{
"client_id": "709197089170-1ag90aipfrq9hsdobogbtfci0efmgaea.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.kosukesaigusa.mottai_flutter_app.dev",
"certificate_hash": "e40a3161ff6c8155a5461bb2f6012713653035a6"
}
},
{
"client_id": "709197089170-7r1q09vr5g5ipeh5n5p1qdndig47bet5.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.kosukesaigusa.mottai_flutter_app.dev",
"certificate_hash": "43737e207d9b07c8f3435b6add912af5ad7c5236"
}
},
{
"client_id": "709197089170-vr0qlak6fl65rn3e8rcbesko660eh5u7.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.kosukesaigusa.mottai_flutter_app.dev",
"certificate_hash": "968f3fb49f0d6f8bf0f930d8188522f588728d73"
}
},
{
"client_id": "709197089170-so0p0jb6k3hatq065fpgmij2v8e4a2s4.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAR_-jpRLOtS59zlNI1KCufmI4OOwBERkM"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "709197089170-so0p0jb6k3hatq065fpgmij2v8e4a2s4.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "709197089170-1lr8vaboc73s41u7l2vijfqs2c7udu0n.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.kosukesaigusa.mottaiFlutterApp.dev",
"app_store_id": "1611315150"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:709197089170:android:34a5db658be064737ed94b",
"android_client_info": {
"package_name": "com.kosukesaigusa.mottai_flutter_app.dev2"
}
},
"oauth_client": [
{
"client_id": "709197089170-uq4nh0sucgsseko6d55qgt20t2im54sl.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.kosukesaigusa.mottai_flutter_app.dev2",
"certificate_hash": "43737e207d9b07c8f3435b6add912af5ad7c5236"
}
},
{
"client_id": "709197089170-so0p0jb6k3hatq065fpgmij2v8e4a2s4.apps.googleusercontent.com",
"client_type": 3
Expand Down Expand Up @@ -44,4 +113,4 @@
}
],
"configuration_version": "1"
}
}
2 changes: 1 addition & 1 deletion packages/mottai_flutter_app/ios/firebase_app_id_file.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"GOOGLE_APP_ID": "1:709197089170:ios:7617a4349b5968e77ed94b",
"FIREBASE_PROJECT_ID": "mottai-app-dev-2",
"GCM_SENDER_ID": "709197089170"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DefaultFirebaseOptions {

static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyAR_-jpRLOtS59zlNI1KCufmI4OOwBERkM',
appId: '1:709197089170:android:ea115cc56387c6c37ed94b',
appId: '1:709197089170:android:34a5db658be064737ed94b',
messagingSenderId: '709197089170',
projectId: 'mottai-app-dev-2',
storageBucket: 'mottai-app-dev-2.appspot.com',
Expand All @@ -64,7 +64,7 @@ class DefaultFirebaseOptions {
projectId: 'mottai-app-dev-2',
storageBucket: 'mottai-app-dev-2.appspot.com',
androidClientId:
'709197089170-eoscur7kmv2s45ikpgkvdjtim6b6sbgb.apps.googleusercontent.com',
'709197089170-1ag90aipfrq9hsdobogbtfci0efmgaea.apps.googleusercontent.com',
iosClientId:
'709197089170-1lr8vaboc73s41u7l2vijfqs2c7udu0n.apps.googleusercontent.com',
iosBundleId: 'com.kosukesaigusa.mottaiFlutterApp.dev',
Expand Down
Loading