From e9873d8b7b03a65120f36081bd22c8fa6788b3c9 Mon Sep 17 00:00:00 2001 From: Luong Vo Date: Wed, 1 Mar 2023 14:20:58 +0700 Subject: [PATCH 1/9] [#61] Add CD workflow to build & deploy Android Production release app bundle to Play Store --- ...android_deploy_production_to_playstore.yml | 59 +++++++++++++++++++ ...android_deploy_production_to_playstore.yml | 50 ++++++++++++++++ .../.github/workflows/whatsnew/whatsnew-en-US | 3 + 3 files changed, 112 insertions(+) create mode 100644 .github/workflows/android_deploy_production_to_playstore.yml create mode 100644 template/.github/workflows/android_deploy_production_to_playstore.yml create mode 100644 template/.github/workflows/whatsnew/whatsnew-en-US diff --git a/.github/workflows/android_deploy_production_to_playstore.yml b/.github/workflows/android_deploy_production_to_playstore.yml new file mode 100644 index 00000000..6be7ed6e --- /dev/null +++ b/.github/workflows/android_deploy_production_to_playstore.yml @@ -0,0 +1,59 @@ +name: Android - Deploy Production build to Play Store + +on: + push: + branches: + - main + - feature/61-setup-cd-to-build-and-deploy-android-app-to-playstore + +jobs: + build_and_deploy_android: + name: Build & Deploy Android + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + + - name: Generate new project + run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates" + + - name: Setup Java JDK + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '11' + + - name: Setup Flutter environment + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version: '3.3.10' + + - name: Get flutter dependencies + run: flutter pub get + + - name: Run code generator. + run: flutter packages pub run build_runner build --delete-conflicting-outputs + + - name: Setup .env + env: + ENV_PRODUCTION: ${{ secrets.ENV_PRODUCTION }} + run: | + echo $ENV_PRODUCTION > .env + + - name: Build Production App Bundle + run: flutter build appbundle --flavor production --release --build-number $GITHUB_RUN_NUMBER + + - name: Upload Android Production Release bundle to Play Store + uses: r0adkll/upload-google-play@v1 + with: + serviceAccountJson: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} + packageName: co.nimblehq.flutter.template + releaseFile: build/app/outputs/bundle/productionRelease/app-production-release.aab + track: internal + userFraction: 0.0 + whatsNewDirectory: .github/workflows/whatsnew diff --git a/template/.github/workflows/android_deploy_production_to_playstore.yml b/template/.github/workflows/android_deploy_production_to_playstore.yml new file mode 100644 index 00000000..8623bd14 --- /dev/null +++ b/template/.github/workflows/android_deploy_production_to_playstore.yml @@ -0,0 +1,50 @@ +name: Android - Deploy Production build to Play Store + +on: + push: + branches: + - main + +jobs: + build_and_deploy_android: + name: Build & Deploy Android + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Java JDK + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '11' + + - name: Setup Flutter environment + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version: '3.3.10' + + - name: Get flutter dependencies + run: flutter pub get + + - name: Run code generator. + run: flutter packages pub run build_runner build --delete-conflicting-outputs + + - name: Setup .env + env: + ENV_PRODUCTION: ${{ secrets.ENV_PRODUCTION }} + run: | + echo $ENV_PRODUCTION > .env + + - name: Build Production App Bundle + run: flutter build appbundle --flavor production --release --build-number $GITHUB_RUN_NUMBER + + - name: Upload Android Production Release bundle to Play Store + uses: r0adkll/upload-google-play@v1 + with: + serviceAccountJson: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} + packageName: co.nimblehq.flutter.template + releaseFile: build/app/outputs/bundle/productionRelease/app-production-release.aab + track: internal + userFraction: 0.0 + whatsNewDirectory: .github/workflows/whatsnew diff --git a/template/.github/workflows/whatsnew/whatsnew-en-US b/template/.github/workflows/whatsnew/whatsnew-en-US new file mode 100644 index 00000000..6230febe --- /dev/null +++ b/template/.github/workflows/whatsnew/whatsnew-en-US @@ -0,0 +1,3 @@ + +Enter or paste your release notes for en-US here + From 8c7cc9bdc9e4d600d98090ba14cfbb652ff47829 Mon Sep 17 00:00:00 2001 From: Luong Vo Date: Tue, 7 Mar 2023 13:53:27 +0700 Subject: [PATCH 2/9] [#61] Fix: 'userFraction' must be between 0 and 1! Got 0 --- .github/workflows/android_deploy_production_to_playstore.yml | 2 +- .../workflows/android_deploy_production_to_playstore.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android_deploy_production_to_playstore.yml b/.github/workflows/android_deploy_production_to_playstore.yml index 6be7ed6e..9aeb728e 100644 --- a/.github/workflows/android_deploy_production_to_playstore.yml +++ b/.github/workflows/android_deploy_production_to_playstore.yml @@ -55,5 +55,5 @@ jobs: packageName: co.nimblehq.flutter.template releaseFile: build/app/outputs/bundle/productionRelease/app-production-release.aab track: internal - userFraction: 0.0 + userFraction: 1.0 whatsNewDirectory: .github/workflows/whatsnew diff --git a/template/.github/workflows/android_deploy_production_to_playstore.yml b/template/.github/workflows/android_deploy_production_to_playstore.yml index 8623bd14..7c261c21 100644 --- a/template/.github/workflows/android_deploy_production_to_playstore.yml +++ b/template/.github/workflows/android_deploy_production_to_playstore.yml @@ -46,5 +46,5 @@ jobs: packageName: co.nimblehq.flutter.template releaseFile: build/app/outputs/bundle/productionRelease/app-production-release.aab track: internal - userFraction: 0.0 + userFraction: 1.0 whatsNewDirectory: .github/workflows/whatsnew From 5d927b06903155cbfe6238e7c1987192c3325916 Mon Sep 17 00:00:00 2001 From: Luong Vo Date: Tue, 7 Mar 2023 13:55:55 +0700 Subject: [PATCH 3/9] [#61] Disable Upload bundle to Play Store step while waiting for a shared Service Account for Play Store publishing --- ...android_deploy_production_to_playstore.yml | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/android_deploy_production_to_playstore.yml b/.github/workflows/android_deploy_production_to_playstore.yml index 9aeb728e..3e638d4a 100644 --- a/.github/workflows/android_deploy_production_to_playstore.yml +++ b/.github/workflows/android_deploy_production_to_playstore.yml @@ -48,12 +48,14 @@ jobs: - name: Build Production App Bundle run: flutter build appbundle --flavor production --release --build-number $GITHUB_RUN_NUMBER - - name: Upload Android Production Release bundle to Play Store - uses: r0adkll/upload-google-play@v1 - with: - serviceAccountJson: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} - packageName: co.nimblehq.flutter.template - releaseFile: build/app/outputs/bundle/productionRelease/app-production-release.aab - track: internal - userFraction: 1.0 - whatsNewDirectory: .github/workflows/whatsnew + # TODO We will enable this step later when having a shared Service Account on our organization + # Basically, this step will work properly after providing a valid Service Account. + # - name: Upload Android Production Release bundle to Play Store + # uses: r0adkll/upload-google-play@v1 + # with: + # serviceAccountJson: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} + # packageName: co.nimblehq.flutter.template + # releaseFile: build/app/outputs/bundle/productionRelease/app-production-release.aab + # track: internal + # userFraction: 1.0 + # whatsNewDirectory: .github/workflows/whatsnew From 1eeb28eb2a2e38e85c2011c8e3cf5ebe69cb2e5a Mon Sep 17 00:00:00 2001 From: Luong Vo Date: Tue, 7 Mar 2023 14:26:14 +0700 Subject: [PATCH 4/9] [#61] Add Android app publishing wiki --- .github/wiki/Deployment.md | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/wiki/Deployment.md b/.github/wiki/Deployment.md index 7465ba72..e34bcbd0 100644 --- a/.github/wiki/Deployment.md +++ b/.github/wiki/Deployment.md @@ -1,19 +1,37 @@ # Deployment Process +## For Android + +### Guide + +- Before publishing the Android application, we have to prepare the necessary credentials and information: + - A Play Store developer account. + - Your application's app id. This could be multiple bundle ids according to the number of application’s flavors. + - A new app on Play Store. + +- Add these variables as the secrets of CI: + - **ENV_PRODUCTION**: the production .env configuration file content. + - **GOOGLE_PLAY_SERVICE_ACCOUNT_JSON**: the json file content of the Play Store's Service Account for app publishing. Please check out [how to create the Service Account](https://support.staffbase.com/hc/en-us/articles/360018569579-Preparing-Automated-Publishing-for-Google-Play-Store). + +### Resources + +- [Build and release an Android app](https://docs.flutter.dev/deployment/android#build-an-apk). +- [Preparing Automated Publishing for Google Play Store](https://support.staffbase.com/hc/en-us/articles/360018569579-Preparing-Automated-Publishing-for-Google-Play-Store). + ## For iOS ### Guide -- Before deploying the iOS application, we have to prepare the necessary credentials and information: +- Before publishing the iOS application, we have to prepare the necessary credentials and information: - An Apple developer account. - Your application’s bundle id. This could be multiple bundle ids according to the number of application’s flavors. - - A new app's on Apple Store Connect that links to the bundle id. + - A new app on Apple Store Connect that links to the bundle id. - The access to Git’s [Match repository](https://codesigning.guide/). -- Create certificates for distribution and [code signing](https://codesigning.guide/) so we are able to fetch the certificates through [Match](https://docs.fastlane.tools/actions/match/). +- Create certificates for distribution and [code signing](https://codesigning.guide/) so we are able to fetch the certificates through the [Match](https://docs.fastlane.tools/actions/match/) repository. - Setup [Fastlane](https://docs.fastlane.tools/getting-started/ios/setup/) and [Match](https://docs.fastlane.tools/actions/match/). -- Adding these variables as the environment variable of CI: +- Add these variables as the secrets of CI: - **FASTLANE_USER**: This will be referred to in `Appfile` and `Fastfile`. Set your Apple ID to this variable. - **FASTLANE_PASSWORD**: This variable will be referred to internally in Fastlane. Set the password of your Apple ID to this variable. @@ -23,10 +41,10 @@ - **KEYCHAIN_PASSWORD**: We can create a keychain password for ourself and it could be anything. - **SSH_PRIVATE_KEY**: In order to fetch the distribution files from Git’s [Match repository](https://codesigning.guide/), we have to generate an SSH key and save it as the environment variable in CI. -- Run the corresponding workflows CI or `fastlane` commands and enjoy the result! +- Run the corresponding workflows or `fastlane` commands and enjoy the result! -### Resource +### Resources - [https://medium.com/flutter-community/deploying-flutter-ios-apps-with-fastlane-and-github-actions-2e87465e056e](https://medium.com/flutter-community/deploying-flutter-ios-apps-with-fastlane-and-github-actions-2e87465e056e) - [https://docs.flutter.dev/deployment/cd](https://docs.flutter.dev/deployment/cd) -- [https://jaysavsani07.medium.com/flutter-ci-cd-with-github-actions-fastlane-part-2-ios-a4b281921d39](https://jaysavsani07.medium.com/flutter-ci-cd-with-github-actions-fastlane-part-2-ios-a4b281921d39) \ No newline at end of file +- [https://jaysavsani07.medium.com/flutter-ci-cd-with-github-actions-fastlane-part-2-ios-a4b281921d39](https://jaysavsani07.medium.com/flutter-ci-cd-with-github-actions-fastlane-part-2-ios-a4b281921d39) From 5d11dbd87498b315ef53a12c9269350922e0993b Mon Sep 17 00:00:00 2001 From: Luong Vo Date: Wed, 8 Mar 2023 14:15:26 +0700 Subject: [PATCH 5/9] [#61] Remove test branch config --- .github/workflows/android_deploy_production_to_playstore.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/android_deploy_production_to_playstore.yml b/.github/workflows/android_deploy_production_to_playstore.yml index 3e638d4a..a8c8f937 100644 --- a/.github/workflows/android_deploy_production_to_playstore.yml +++ b/.github/workflows/android_deploy_production_to_playstore.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - feature/61-setup-cd-to-build-and-deploy-android-app-to-playstore jobs: build_and_deploy_android: From f863a88ab487f8e40db08fa698a245029c73d346 Mon Sep 17 00:00:00 2001 From: Luong Vo Date: Wed, 22 Mar 2023 10:43:33 +0700 Subject: [PATCH 6/9] [#61] Add missing "timeout-minutes" config to avoid the workflow hanging --- .github/workflows/android_deploy_production.yml | 1 + .github/workflows/android_deploy_production_to_playstore.yml | 1 + .github/workflows/android_deploy_staging.yml | 1 + .github/workflows/bump_version.yml | 1 + .github/workflows/test.yml | 1 + template/.github/workflows/android_deploy_production.yml | 1 + .../.github/workflows/android_deploy_production_to_playstore.yml | 1 + template/.github/workflows/android_deploy_staging.yml | 1 + template/.github/workflows/bump_version.yml | 1 + template/.github/workflows/ios_deploy_to_app_store.yml | 1 + template/.github/workflows/ios_deploy_to_testflight.yml | 1 + template/.github/workflows/test.yml | 1 + 12 files changed, 12 insertions(+) diff --git a/.github/workflows/android_deploy_production.yml b/.github/workflows/android_deploy_production.yml index 297e95a4..98b74a4c 100644 --- a/.github/workflows/android_deploy_production.yml +++ b/.github/workflows/android_deploy_production.yml @@ -9,6 +9,7 @@ jobs: build_and_deploy_android: name: Build & Deploy Android runs-on: ubuntu-latest + timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/android_deploy_production_to_playstore.yml b/.github/workflows/android_deploy_production_to_playstore.yml index a8c8f937..b84fb776 100644 --- a/.github/workflows/android_deploy_production_to_playstore.yml +++ b/.github/workflows/android_deploy_production_to_playstore.yml @@ -9,6 +9,7 @@ jobs: build_and_deploy_android: name: Build & Deploy Android runs-on: ubuntu-latest + timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/android_deploy_staging.yml b/.github/workflows/android_deploy_staging.yml index 54cdc2e4..44c8cd7b 100644 --- a/.github/workflows/android_deploy_staging.yml +++ b/.github/workflows/android_deploy_staging.yml @@ -9,6 +9,7 @@ jobs: build_and_deploy_android: name: Build & Deploy Android runs-on: ubuntu-latest + timeout-minutes: 30 environment: staging steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml index 5ea2fb77..c9cfcd6d 100644 --- a/.github/workflows/bump_version.yml +++ b/.github/workflows/bump_version.yml @@ -12,6 +12,7 @@ jobs: bump_version: name: Bump version runs-on: ubuntu-latest + timeout-minutes: 5 steps: - name: Checkout the latest code uses: actions/checkout@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24ebb680..83b608be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,6 +14,7 @@ jobs: test: name: Template initializing scripts test runs-on: ubuntu-latest + timeout-minutes: 30 steps: - uses: actions/checkout@v2.3.2 diff --git a/template/.github/workflows/android_deploy_production.yml b/template/.github/workflows/android_deploy_production.yml index 95276223..50392a67 100644 --- a/template/.github/workflows/android_deploy_production.yml +++ b/template/.github/workflows/android_deploy_production.yml @@ -9,6 +9,7 @@ jobs: build_and_deploy_android: name: Build & Deploy Android runs-on: ubuntu-latest + timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/template/.github/workflows/android_deploy_production_to_playstore.yml b/template/.github/workflows/android_deploy_production_to_playstore.yml index 7c261c21..ccf553fc 100644 --- a/template/.github/workflows/android_deploy_production_to_playstore.yml +++ b/template/.github/workflows/android_deploy_production_to_playstore.yml @@ -9,6 +9,7 @@ jobs: build_and_deploy_android: name: Build & Deploy Android runs-on: ubuntu-latest + timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/template/.github/workflows/android_deploy_staging.yml b/template/.github/workflows/android_deploy_staging.yml index 1dcb514d..f231a2ba 100644 --- a/template/.github/workflows/android_deploy_staging.yml +++ b/template/.github/workflows/android_deploy_staging.yml @@ -9,6 +9,7 @@ jobs: build_and_deploy_android: name: Build & Deploy Android runs-on: ubuntu-latest + timeout-minutes: 30 steps: - uses: actions/checkout@v3 diff --git a/template/.github/workflows/bump_version.yml b/template/.github/workflows/bump_version.yml index 737d76ee..2a91fce4 100644 --- a/template/.github/workflows/bump_version.yml +++ b/template/.github/workflows/bump_version.yml @@ -12,6 +12,7 @@ jobs: bump_version: name: Bump version runs-on: ubuntu-latest + timeout-minutes: 5 steps: - name: Checkout the latest code uses: actions/checkout@v3 diff --git a/template/.github/workflows/ios_deploy_to_app_store.yml b/template/.github/workflows/ios_deploy_to_app_store.yml index c16f847f..91749328 100644 --- a/template/.github/workflows/ios_deploy_to_app_store.yml +++ b/template/.github/workflows/ios_deploy_to_app_store.yml @@ -9,6 +9,7 @@ jobs: build_and_upload_to_app_store: name: Build And Upload iOS Application To AppStore runs-on: macOS-latest + timeout-minutes: 30 defaults: run: working-directory: template diff --git a/template/.github/workflows/ios_deploy_to_testflight.yml b/template/.github/workflows/ios_deploy_to_testflight.yml index 15e2d985..38b41fbf 100644 --- a/template/.github/workflows/ios_deploy_to_testflight.yml +++ b/template/.github/workflows/ios_deploy_to_testflight.yml @@ -9,6 +9,7 @@ jobs: build_and_upload_to_testflight: name: Build And Upload iOS Application To TestFlight runs-on: macOS-latest + timeout-minutes: 30 env: TEAM_ID: ${{ secrets.TEAM_ID }} FASTLANE_USER: ${{ secrets.FASTLANE_USER }} diff --git a/template/.github/workflows/test.yml b/template/.github/workflows/test.yml index bd27098d..074cf7ec 100644 --- a/template/.github/workflows/test.yml +++ b/template/.github/workflows/test.yml @@ -12,6 +12,7 @@ jobs: lint_and_test: name: Static code analyze & Unit test runs-on: ubuntu-latest + timeout-minutes: 30 environment: staging steps: - uses: actions/checkout@v2.3.2 From e681184449c6832f88b8ca3db6dc4ac489573a81 Mon Sep 17 00:00:00 2001 From: Luong Vo Date: Wed, 22 Mar 2023 10:52:26 +0700 Subject: [PATCH 7/9] [#61] Add step name for checkout action for consistency --- .github/workflows/android_deploy_production.yml | 3 ++- .github/workflows/android_deploy_production_to_playstore.yml | 3 ++- .github/workflows/android_deploy_staging.yml | 3 ++- template/.github/workflows/android_deploy_production.yml | 3 ++- .../workflows/android_deploy_production_to_playstore.yml | 3 ++- template/.github/workflows/android_deploy_staging.yml | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/android_deploy_production.yml b/.github/workflows/android_deploy_production.yml index 98b74a4c..b477ba13 100644 --- a/.github/workflows/android_deploy_production.yml +++ b/.github/workflows/android_deploy_production.yml @@ -11,7 +11,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v2 diff --git a/.github/workflows/android_deploy_production_to_playstore.yml b/.github/workflows/android_deploy_production_to_playstore.yml index b84fb776..abc8ef11 100644 --- a/.github/workflows/android_deploy_production_to_playstore.yml +++ b/.github/workflows/android_deploy_production_to_playstore.yml @@ -11,7 +11,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v2 diff --git a/.github/workflows/android_deploy_staging.yml b/.github/workflows/android_deploy_staging.yml index 44c8cd7b..8a98dfed 100644 --- a/.github/workflows/android_deploy_staging.yml +++ b/.github/workflows/android_deploy_staging.yml @@ -12,7 +12,8 @@ jobs: timeout-minutes: 30 environment: staging steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v2 diff --git a/template/.github/workflows/android_deploy_production.yml b/template/.github/workflows/android_deploy_production.yml index 50392a67..ebf53c87 100644 --- a/template/.github/workflows/android_deploy_production.yml +++ b/template/.github/workflows/android_deploy_production.yml @@ -11,7 +11,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - name: Setup Java JDK uses: actions/setup-java@v3 diff --git a/template/.github/workflows/android_deploy_production_to_playstore.yml b/template/.github/workflows/android_deploy_production_to_playstore.yml index ccf553fc..65cd2fe2 100644 --- a/template/.github/workflows/android_deploy_production_to_playstore.yml +++ b/template/.github/workflows/android_deploy_production_to_playstore.yml @@ -11,7 +11,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - name: Setup Java JDK uses: actions/setup-java@v3 diff --git a/template/.github/workflows/android_deploy_staging.yml b/template/.github/workflows/android_deploy_staging.yml index f231a2ba..79db2946 100644 --- a/template/.github/workflows/android_deploy_staging.yml +++ b/template/.github/workflows/android_deploy_staging.yml @@ -11,7 +11,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - name: Setup Java JDK uses: actions/setup-java@v3 From 6b14cdee4853dc0cc68a1eee4c2d209032b2b33b Mon Sep 17 00:00:00 2001 From: Luong Vo Date: Wed, 22 Mar 2023 11:18:29 +0700 Subject: [PATCH 8/9] [#61] Typo: use "set up" instead of "setup" for action --- .github/wiki/Deployment.md | 2 +- .github/workflows/android_deploy_production.yml | 8 ++++---- .../workflows/android_deploy_production_to_playstore.yml | 8 ++++---- .github/workflows/android_deploy_staging.yml | 8 ++++---- .github/workflows/test.yml | 4 ++-- template/.github/workflows/android_deploy_production.yml | 6 +++--- .../workflows/android_deploy_production_to_playstore.yml | 6 +++--- template/.github/workflows/android_deploy_staging.yml | 6 +++--- template/.github/workflows/ios_deploy_to_app_store.yml | 2 +- template/.github/workflows/ios_deploy_to_testflight.yml | 2 +- template/.github/workflows/test.yml | 2 +- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/wiki/Deployment.md b/.github/wiki/Deployment.md index e34bcbd0..96a244d6 100644 --- a/.github/wiki/Deployment.md +++ b/.github/wiki/Deployment.md @@ -30,7 +30,7 @@ - The access to Git’s [Match repository](https://codesigning.guide/). - Create certificates for distribution and [code signing](https://codesigning.guide/) so we are able to fetch the certificates through the [Match](https://docs.fastlane.tools/actions/match/) repository. -- Setup [Fastlane](https://docs.fastlane.tools/getting-started/ios/setup/) and [Match](https://docs.fastlane.tools/actions/match/). +- Set up [Fastlane](https://docs.fastlane.tools/getting-started/ios/setup/) and [Match](https://docs.fastlane.tools/actions/match/). - Add these variables as the secrets of CI: - **FASTLANE_USER**: This will be referred to in `Appfile` and `Fastfile`. Set your Apple ID to this variable. diff --git a/.github/workflows/android_deploy_production.yml b/.github/workflows/android_deploy_production.yml index b477ba13..a6ab510c 100644 --- a/.github/workflows/android_deploy_production.yml +++ b/.github/workflows/android_deploy_production.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Setup Python + - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.9' @@ -22,13 +22,13 @@ jobs: - name: Generate new project run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates" - - name: Setup Java JDK + - name: Set up Java JDK uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: '11' - - name: Setup Flutter environment + - name: Set up Flutter environment uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -40,7 +40,7 @@ jobs: - name: Run code generator. run: flutter packages pub run build_runner build --delete-conflicting-outputs - - name: Setup .env + - name: Set up .env env: ENV_PRODUCTION: ${{ secrets.ENV_PRODUCTION }} run: | diff --git a/.github/workflows/android_deploy_production_to_playstore.yml b/.github/workflows/android_deploy_production_to_playstore.yml index abc8ef11..db10317f 100644 --- a/.github/workflows/android_deploy_production_to_playstore.yml +++ b/.github/workflows/android_deploy_production_to_playstore.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Setup Python + - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.9' @@ -22,13 +22,13 @@ jobs: - name: Generate new project run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates" - - name: Setup Java JDK + - name: Set up Java JDK uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: '11' - - name: Setup Flutter environment + - name: Set up Flutter environment uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -40,7 +40,7 @@ jobs: - name: Run code generator. run: flutter packages pub run build_runner build --delete-conflicting-outputs - - name: Setup .env + - name: Set up .env env: ENV_PRODUCTION: ${{ secrets.ENV_PRODUCTION }} run: | diff --git a/.github/workflows/android_deploy_staging.yml b/.github/workflows/android_deploy_staging.yml index 8a98dfed..4610d16a 100644 --- a/.github/workflows/android_deploy_staging.yml +++ b/.github/workflows/android_deploy_staging.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Setup Python + - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.9' @@ -23,13 +23,13 @@ jobs: - name: Generate new project run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates" - - name: Setup Java JDK + - name: Set up Java JDK uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: '11' - - name: Setup Flutter environment + - name: Set up Flutter environment uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -41,7 +41,7 @@ jobs: - name: Run code generator. run: flutter packages pub run build_runner build --delete-conflicting-outputs - - name: Setup .env.staging + - name: Set up .env.staging env: ENV_STAGING: ${{ secrets.ENV_STAGING }} run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83b608be..0f7ec12f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v2.3.2 - - name: Setup Python + - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.9' @@ -26,7 +26,7 @@ jobs: - name: Generate new project run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates" - - name: Setup Flutter environment + - name: Set up Flutter environment uses: subosito/flutter-action@v2 with: channel: 'stable' diff --git a/template/.github/workflows/android_deploy_production.yml b/template/.github/workflows/android_deploy_production.yml index ebf53c87..6ab95f21 100644 --- a/template/.github/workflows/android_deploy_production.yml +++ b/template/.github/workflows/android_deploy_production.yml @@ -14,13 +14,13 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Setup Java JDK + - name: Set up Java JDK uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: '11' - - name: Setup Flutter environment + - name: Set up Flutter environment uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -32,7 +32,7 @@ jobs: - name: Run code generator. run: flutter packages pub run build_runner build --delete-conflicting-outputs - - name: Setup .env + - name: Set up .env env: ENV_PRODUCTION: ${{ secrets.ENV_PRODUCTION }} run: | diff --git a/template/.github/workflows/android_deploy_production_to_playstore.yml b/template/.github/workflows/android_deploy_production_to_playstore.yml index 65cd2fe2..70c9c87f 100644 --- a/template/.github/workflows/android_deploy_production_to_playstore.yml +++ b/template/.github/workflows/android_deploy_production_to_playstore.yml @@ -14,13 +14,13 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Setup Java JDK + - name: Set up Java JDK uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: '11' - - name: Setup Flutter environment + - name: Set up Flutter environment uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -32,7 +32,7 @@ jobs: - name: Run code generator. run: flutter packages pub run build_runner build --delete-conflicting-outputs - - name: Setup .env + - name: Set up .env env: ENV_PRODUCTION: ${{ secrets.ENV_PRODUCTION }} run: | diff --git a/template/.github/workflows/android_deploy_staging.yml b/template/.github/workflows/android_deploy_staging.yml index 79db2946..e0205efe 100644 --- a/template/.github/workflows/android_deploy_staging.yml +++ b/template/.github/workflows/android_deploy_staging.yml @@ -14,13 +14,13 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Setup Java JDK + - name: Set up Java JDK uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: '11' - - name: Setup Flutter environment + - name: Set up Flutter environment uses: subosito/flutter-action@v2 with: channel: 'stable' @@ -32,7 +32,7 @@ jobs: - name: Run code generator. run: flutter packages pub run build_runner build --delete-conflicting-outputs - - name: Setup .env.staging + - name: Set up .env.staging env: ENV_STAGING: ${{ secrets.ENV_STAGING }} run: | diff --git a/template/.github/workflows/ios_deploy_to_app_store.yml b/template/.github/workflows/ios_deploy_to_app_store.yml index 91749328..b5559f8a 100644 --- a/template/.github/workflows/ios_deploy_to_app_store.yml +++ b/template/.github/workflows/ios_deploy_to_app_store.yml @@ -29,7 +29,7 @@ jobs: with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - - name: Setup Flutter environment + - name: Set up Flutter environment uses: subosito/flutter-action@v2 with: channel: 'stable' diff --git a/template/.github/workflows/ios_deploy_to_testflight.yml b/template/.github/workflows/ios_deploy_to_testflight.yml index 38b41fbf..e6e99080 100644 --- a/template/.github/workflows/ios_deploy_to_testflight.yml +++ b/template/.github/workflows/ios_deploy_to_testflight.yml @@ -26,7 +26,7 @@ jobs: with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - - name: Setup Flutter environment + - name: Set up Flutter environment uses: subosito/flutter-action@v2 with: channel: 'stable' diff --git a/template/.github/workflows/test.yml b/template/.github/workflows/test.yml index 074cf7ec..dfc32f7f 100644 --- a/template/.github/workflows/test.yml +++ b/template/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v2.3.2 - - name: Setup Flutter environment + - name: Set up Flutter environment uses: subosito/flutter-action@v2 with: channel: 'stable' From 6a3bbce19c9ed30ba7b8ae32b7ebce5416977ba3 Mon Sep 17 00:00:00 2001 From: Luong Vo Date: Wed, 22 Mar 2023 11:34:57 +0700 Subject: [PATCH 9/9] [#61] Correct Flutter sdk name --- .github/workflows/android_deploy_production.yml | 4 ++-- .../workflows/android_deploy_production_to_playstore.yml | 4 ++-- .github/workflows/android_deploy_staging.yml | 4 ++-- .github/workflows/test.yml | 8 ++++---- template/.github/workflows/android_deploy_production.yml | 4 ++-- .../workflows/android_deploy_production_to_playstore.yml | 4 ++-- template/.github/workflows/android_deploy_staging.yml | 4 ++-- template/.github/workflows/ios_deploy_to_app_store.yml | 2 +- template/.github/workflows/ios_deploy_to_testflight.yml | 2 +- template/.github/workflows/test.yml | 8 ++++---- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/android_deploy_production.yml b/.github/workflows/android_deploy_production.yml index a6ab510c..7173c2b0 100644 --- a/.github/workflows/android_deploy_production.yml +++ b/.github/workflows/android_deploy_production.yml @@ -34,10 +34,10 @@ jobs: channel: 'stable' flutter-version: '3.3.10' - - name: Get flutter dependencies + - name: Get Flutter dependencies run: flutter pub get - - name: Run code generator. + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs - name: Set up .env diff --git a/.github/workflows/android_deploy_production_to_playstore.yml b/.github/workflows/android_deploy_production_to_playstore.yml index db10317f..7381ec1d 100644 --- a/.github/workflows/android_deploy_production_to_playstore.yml +++ b/.github/workflows/android_deploy_production_to_playstore.yml @@ -34,10 +34,10 @@ jobs: channel: 'stable' flutter-version: '3.3.10' - - name: Get flutter dependencies + - name: Get Flutter dependencies run: flutter pub get - - name: Run code generator. + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs - name: Set up .env diff --git a/.github/workflows/android_deploy_staging.yml b/.github/workflows/android_deploy_staging.yml index 4610d16a..05939515 100644 --- a/.github/workflows/android_deploy_staging.yml +++ b/.github/workflows/android_deploy_staging.yml @@ -35,10 +35,10 @@ jobs: channel: 'stable' flutter-version: '3.3.10' - - name: Get flutter dependencies + - name: Get Flutter dependencies run: flutter pub get - - name: Run code generator. + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs - name: Set up .env.staging diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f7ec12f..89125119 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,17 +32,17 @@ jobs: channel: 'stable' flutter-version: '3.3.10' - - name: Get flutter dependencies. + - name: Get Flutter dependencies run: flutter pub get - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs - - name: Check for any formatting issues in the code. + - name: Check for any formatting issues in the code run: flutter format --set-exit-if-changed . - - name: Statically analyze the Dart code for any errors. + - name: Statically analyze the Dart code for any errors run: flutter analyze . - - name: Run widget tests, unit tests. + - name: Run widget tests, unit tests run: flutter test --machine --coverage diff --git a/template/.github/workflows/android_deploy_production.yml b/template/.github/workflows/android_deploy_production.yml index 6ab95f21..e857d713 100644 --- a/template/.github/workflows/android_deploy_production.yml +++ b/template/.github/workflows/android_deploy_production.yml @@ -26,10 +26,10 @@ jobs: channel: 'stable' flutter-version: '3.3.10' - - name: Get flutter dependencies + - name: Get Flutter dependencies run: flutter pub get - - name: Run code generator. + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs - name: Set up .env diff --git a/template/.github/workflows/android_deploy_production_to_playstore.yml b/template/.github/workflows/android_deploy_production_to_playstore.yml index 70c9c87f..d07ca14b 100644 --- a/template/.github/workflows/android_deploy_production_to_playstore.yml +++ b/template/.github/workflows/android_deploy_production_to_playstore.yml @@ -26,10 +26,10 @@ jobs: channel: 'stable' flutter-version: '3.3.10' - - name: Get flutter dependencies + - name: Get Flutter dependencies run: flutter pub get - - name: Run code generator. + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs - name: Set up .env diff --git a/template/.github/workflows/android_deploy_staging.yml b/template/.github/workflows/android_deploy_staging.yml index e0205efe..70e1f42d 100644 --- a/template/.github/workflows/android_deploy_staging.yml +++ b/template/.github/workflows/android_deploy_staging.yml @@ -26,10 +26,10 @@ jobs: channel: 'stable' flutter-version: '3.3.10' - - name: Get flutter dependencies + - name: Get Flutter dependencies run: flutter pub get - - name: Run code generator. + - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs - name: Set up .env.staging diff --git a/template/.github/workflows/ios_deploy_to_app_store.yml b/template/.github/workflows/ios_deploy_to_app_store.yml index b5559f8a..7e4582aa 100644 --- a/template/.github/workflows/ios_deploy_to_app_store.yml +++ b/template/.github/workflows/ios_deploy_to_app_store.yml @@ -35,7 +35,7 @@ jobs: channel: 'stable' flutter-version: '3.3.10' - - name: Get flutter dependencies + - name: Get Flutter dependencies run: flutter pub get - name: Run code generator diff --git a/template/.github/workflows/ios_deploy_to_testflight.yml b/template/.github/workflows/ios_deploy_to_testflight.yml index e6e99080..04dcb757 100644 --- a/template/.github/workflows/ios_deploy_to_testflight.yml +++ b/template/.github/workflows/ios_deploy_to_testflight.yml @@ -32,7 +32,7 @@ jobs: channel: 'stable' flutter-version: '3.3.10' - - name: Get flutter dependencies + - name: Get Flutter dependencies run: flutter pub get - name: Run code generator diff --git a/template/.github/workflows/test.yml b/template/.github/workflows/test.yml index dfc32f7f..3bc45d98 100644 --- a/template/.github/workflows/test.yml +++ b/template/.github/workflows/test.yml @@ -23,19 +23,19 @@ jobs: channel: 'stable' flutter-version: '3.3.10' - - name: Get flutter dependencies. + - name: Get Flutter dependencies run: flutter pub get - name: Run code generator run: flutter packages pub run build_runner build --delete-conflicting-outputs - - name: Check for any formatting issues in the code. + - name: Check for any formatting issues in the code run: flutter format --set-exit-if-changed . - - name: Statically analyze the Dart code for any errors. + - name: Statically analyze the Dart code for any errors run: flutter analyze . - - name: Run widget tests, unit tests. + - name: Run widget tests, unit tests run: flutter test --machine --coverage - name: Upload coverage to codecov