Skip to content

Commit

Permalink
Merge pull request #181 from nimblehq/release/1.6.0
Browse files Browse the repository at this point in the history
Release 1.6.0
  • Loading branch information
luongvo authored Apr 4, 2023
2 parents e52894d + 57ef547 commit a50ef69
Show file tree
Hide file tree
Showing 22 changed files with 469 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Team
# @luongvo is the Team Lead
* @manh-t @doannimble @luongvo @markgravity
* @manh-t @doannimble @luongvo @markgravity @sleepylee @chornerman

# Engineering Leads
CODEOWNERS @nimblehq/engineering-leads
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ contact_links:
- name: Request For Comments (RFC)
about: When having an idea on how to improve our processes, propose the idea so that the team can provide feedback.
# URL to create an RFC with the template
url: https://github.com/nimblehq/flutter_templates/discussions/new?category=rfcs&title=+&body=%23%23+Issue%0D%0A%0D%0ADescribe+the+issue+the+team+is+currently+facing.+Provide+as+much+content+as+possible.%0D%0A%0D%0A%23%23+Solution%0D%0A%0D%0ADescribe+the+solution+you+are+prescribing+for+the+issue%0D%0A%0D%0A%23%23+Who+Benefits%3F%0D%0A%0D%0ADescribe+who+will+be+the+beneficiaries+e.g.+everyone,+specific+chapters,+clients...%0D%0A%0D%0A%23%23+What%27s+Next%3F%0D%0A%0D%0AProvide+an+actionable+list+of+things+that+must+happen+in+order+to+implement+the+solution:%0D%0A%0D%0A-+[+]%0D%0A-+[+]%0D%0A-+[+]
url: https://github.com/nimblehq/flutter-templates/discussions/new?category=rfcs&title=+&body=%23%23+Issue%0D%0A%0D%0ADescribe+the+issue+the+team+is+currently+facing.+Provide+as+much+content+as+possible.%0D%0A%0D%0A%23%23+Solution%0D%0A%0D%0ADescribe+the+solution+you+are+prescribing+for+the+issue%0D%0A%0D%0A%23%23+Who+Benefits%3F%0D%0A%0D%0ADescribe+who+will+be+the+beneficiaries+e.g.+everyone,+specific+chapters,+clients...%0D%0A%0D%0A%23%23+What%27s+Next%3F%0D%0A%0D%0AProvide+an+actionable+list+of+things+that+must+happen+in+order+to+implement+the+solution:%0D%0A%0D%0A-+[+]%0D%0A-+[+]%0D%0A-+[+]

- name: Ask a question
about: When having a question about a pull request, issue, or problem, create a Q&A discussion to get help from the team.
url: https://github.com/nimblehq/flutter_templates/discussions/new?category=q-a
url: https://github.com/nimblehq/flutter-templates/discussions/new?category=q-a
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/release_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
https://github.com/nimblehq/flutter_templates/milestone/?
https://github.com/nimblehq/flutter-templates/milestone/?

## Features

Expand Down
34 changes: 26 additions & 8 deletions .github/wiki/Deployment.md
Original file line number Diff line number Diff line change
@@ -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/).
- 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:
- 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.
- 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.
- **FASTLANE_PASSWORD**: This variable will be referred to internally in Fastlane. Set the password of your Apple ID to this variable.
Expand All @@ -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)
- [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)
59 changes: 59 additions & 0 deletions .github/workflows/android_deploy_production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Android - Deploy Production build to Firebase

on:
push:
branches:
- main

jobs:
build_and_deploy_android:
name: Build & Deploy Android
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up 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: Set up Java JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'

- name: Set up 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: Set up .env
env:
ENV_PRODUCTION: ${{ secrets.ENV_PRODUCTION }}
run: |
echo $ENV_PRODUCTION > .env
# App Bundle requires Firebase connected to Play Store to upload https://appdistribution.page.link/KPoa
- name: Build Android apk
run: flutter build apk --flavor production --debug --build-number $GITHUB_RUN_NUMBER

- name: Deploy Android Production to Firebase
uses: wzieba/[email protected]
with:
appId: ${{ secrets.FIREBASE_ANDROID_APP_ID_PRODUCTION }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }}
groups: nimble
file: build/app/outputs/flutter-apk/app-production-debug.apk
62 changes: 62 additions & 0 deletions .github/workflows/android_deploy_production_to_playstore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up 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: Set up Java JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'

- name: Set up 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: Set up .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

# 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
60 changes: 60 additions & 0 deletions .github/workflows/android_deploy_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Android - Deploy Staging build to Firebase

on:
push:
branches:
- develop

jobs:
build_and_deploy_android:
name: Build & Deploy Android
runs-on: ubuntu-latest
timeout-minutes: 30
environment: staging
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up 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: Set up Java JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'

- name: Set up 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: Set up .env.staging
env:
ENV_STAGING: ${{ secrets.ENV_STAGING }}
run: |
echo $ENV_STAGING > .env.staging
# App Bundle requires Firebase connected to Play Store to upload https://appdistribution.page.link/KPoa
- name: Build Android apk
run: flutter build apk --flavor staging --debug --build-number $GITHUB_RUN_NUMBER

- name: Deploy Android Staging to Firebase
uses: wzieba/[email protected]
with:
appId: ${{ secrets.FIREBASE_ANDROID_APP_ID_STAGING }}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIAL_JSON }}
groups: nimble
file: build/app/outputs/flutter-apk/app-staging-debug.apk
13 changes: 8 additions & 5 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@ jobs:
bump_version:
name: Bump version
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set new version
id: set_version
run: |
perl -i -pe 's/^(version:\s+\d+\.\d+\.\d+\+)(\d+)$/"version: ${{ github.event.inputs.newVersion }}+".($2+1)/e' ./template/pubspec.yaml
- name: Create Pull Request
- name: Create pull request
uses: peter-evans/create-pull-request@v4
with:
assignees: ${{ secrets.GITHUB_USER }}
Expand All @@ -34,14 +37,14 @@ jobs:
labels: |
type : chore
body: |
## What happened
## What happened 👀
Bump version to ${{ github.event.inputs.newVersion }}
## Insight
## Insight 📝
Automatically created by the Bump Version workflow.
## Proof Of Work
## Proof Of Work 📹
On the Files changed tab
19 changes: 11 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,35 @@ jobs:
test:
name: Template initializing scripts test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/[email protected]

- uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Set new project
- name: Generate new project
run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates"

- uses: subosito/flutter-action@v1
- name: Set up Flutter environment
uses: subosito/flutter-action@v2
with:
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
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
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ All the templates that can be used to kick off a new Flutter application quickly

Clone the repository

`git clone [email protected]:nimblehq/flutter_templates.git`
`git clone [email protected]:nimblehq/flutter-templates.git`

## Documentation

Checkout the [Wiki](https://github.com/nimblehq/flutter-templates/wiki) page to access the full documentation.

## Use the template

Expand All @@ -28,7 +32,7 @@ Clone the repository
| PROJECT_NAME | Yes | The application project name. The naming convention follows `your_project_name` |
| APP_NAME | Yes | The application name. |

More available configs [here](https://github.com/nimblehq/flutter_templates/wiki/Generating-A-Project)
More available configs [here](https://github.com/nimblehq/flutter-templates/wiki/Generating-A-Project)

- For more supporting commands, run:

Expand Down
2 changes: 1 addition & 1 deletion template/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
https://github.com/nimblehq/flutter_templates/issues/??
https://github.com/nimblehq/flutter-templates/issues/??

## What happened 👀

Expand Down
4 changes: 2 additions & 2 deletions template/.github/PULL_REQUEST_TEMPLATE/release_template.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Link to the milestone on Github e.g. https://github.com/nimblehq/flutter_templates/milestone/41?closed=1
Link to the milestone on Github e.g. https://github.com/nimblehq/flutter-templates/milestone/41?closed=1
or Link to the project management tool for the release

## Features

Provide the ID and title of the issue in the section for each type (feature, chore and bug). The link is optional.

- [#1] As a user, I can log in or
- [[#1](https://github.com/nimblehq/flutter_templates/issues/1)] As a user, I can log in
- [[#1](https://github.com/nimblehq/flutter-templates/issues/1)] As a user, I can log in

## Chores
- Same structure as in ## Feature
Expand Down
Loading

0 comments on commit a50ef69

Please sign in to comment.