generated from nimblehq/git-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from nimblehq/feature/61-setup-cd-to-build-an…
…d-deploy-android-app-to-playstore [#61] As a developer, I can have a CD process to build and deploy the Android app to Play Store
- Loading branch information
Showing
14 changed files
with
198 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
.github/workflows/android_deploy_production_to_playstore.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,34 +14,35 @@ jobs: | |
test: | ||
name: Template initializing scripts test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Setup Python | ||
- 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: Setup Flutter environment | ||
- name: Set up Flutter environment | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
template/.github/workflows/android_deploy_production_to_playstore.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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 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 | ||
|
||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.