-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
164 - Target Android 11 and other build changes (#194)
Target SDK ~29~ → 30 (Android 11) and minor improvements * Upgrade targeted SDK * Skip upload of APKs for `webview-armeabi-v7a` arch not used * Allow `abi` argument to be overwritten in ui tests. * `make assemble-all` only assemble release versions * Only build when pushing to master or pull requests * Don't build the repo if only `**.md` files are pushed * Disable for now demo app publishing (demo.dev.medicmobile.org is unmaintained) * Disabling instrumentation test momentarily
- Loading branch information
Showing
7 changed files
with
106 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,45 @@ | ||
name: Build and test | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
name: Build | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Set up ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6 | ||
|
||
- name: Set up fastlane | ||
run: gem install fastlane --no-document --quiet | ||
|
||
- name: Unpack secrets | ||
env: | ||
ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY }} | ||
ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV }} | ||
run: | | ||
openssl aes-256-cbc -K $ANDROID_SECRETS_KEY -iv $ANDROID_SECRETS_IV -in secrets.tar.gz.enc -out ./secrets.tar.gz -d | ||
tar -xf ./secrets.tar.gz | ||
- name: Assemble unbranded | ||
uses: maierj/[email protected] | ||
env: | ||
|
@@ -34,20 +51,57 @@ jobs: | |
lane: build | ||
options: '{ "flavor": "unbranded" }' | ||
|
||
instrumentation-tests: | ||
runs-on: macos-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: test unbranded | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: 29 | ||
arch: x86 | ||
script: make test-ui | ||
- name: run tests on gamma | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: 29 | ||
arch: x86 | ||
script: make test-ui-gamma | ||
# instrumentation-tests: | ||
# | ||
# name: Instrumentation tests | ||
# runs-on: macos-latest | ||
# steps: | ||
# | ||
# - name: Checkout | ||
# uses: actions/checkout@v2 | ||
# | ||
# - name: Gradle cache | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: | | ||
# ~/.gradle/caches | ||
# ~/.gradle/wrapper | ||
# key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} | ||
# | ||
# - name: AVD cache | ||
# uses: actions/cache@v2 | ||
# id: avd-cache | ||
# with: | ||
# path: | | ||
# ~/.android/avd/* | ||
# ~/.android/adb* | ||
# key: avd-${{ matrix.api-level }} | ||
# | ||
# - name: Create AVD and generate snapshot for caching | ||
# if: steps.avd-cache.outputs.cache-hit != 'true' | ||
# uses: reactivecircus/android-emulator-runner@v2 | ||
# with: | ||
# api-level: 29 | ||
# target: google_apis | ||
# force-avd-creation: false | ||
# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
# disable-animations: false | ||
# script: echo "Generated AVD snapshot for caching." | ||
# | ||
# - name: Run test-ui on unbranded | ||
# uses: reactivecircus/android-emulator-runner@v2 | ||
# with: | ||
# api-level: 29 | ||
# target: google_apis | ||
# force-avd-creation: false | ||
# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
# script: make test-ui | ||
# | ||
# - name: Run test-ui on gamma | ||
# uses: reactivecircus/android-emulator-runner@v2 | ||
# with: | ||
# api-level: 29 | ||
# target: google_apis | ||
# force-avd-creation: false | ||
# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
# script: make test-ui-gamma |
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 |
---|---|---|
|
@@ -15,7 +15,8 @@ jobs: | |
name: Build | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set release version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Set up ruby | ||
|
@@ -41,11 +42,12 @@ jobs: | |
with: | ||
lane: build | ||
options: '{ "flavor": "medicmobilegamma" }' | ||
- name: Assemble demo | ||
uses: maierj/[email protected] | ||
with: | ||
lane: build | ||
options: '{ "flavor": "medicmobiledemo" }' | ||
# demo app is disabled for now | ||
#- name: Assemble demo | ||
# uses: maierj/[email protected] | ||
# with: | ||
# lane: build | ||
# options: '{ "flavor": "medicmobiledemo" }' | ||
- name: Assemble bracuganda | ||
uses: maierj/[email protected] | ||
with: | ||
|
@@ -191,16 +193,21 @@ jobs: | |
with: | ||
lane: build | ||
options: '{ "flavor": "itech_aurum" }' | ||
- name: Assemble itech_aurum | ||
- name: Assemble itech_malawi | ||
uses: maierj/[email protected] | ||
with: | ||
lane: build | ||
options: '{ "flavor": "itech_malawi" }' | ||
|
||
- name: GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
draft: true | ||
files: build/outputs/apk/**/*.apk | ||
# APKs for webview-armeabi-v7a are not uploaded | ||
files: | | ||
build/outputs/apk/**/*-xwalk-arm64-v8a-release.apk | ||
build/outputs/apk/**/*-xwalk-armeabi-v7a-release.apk | ||
build/outputs/apk/**/*-webview-arm64-v8a-release.apk | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} |
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 |
---|---|---|
|
@@ -76,7 +76,7 @@ Earlier releases are no longer accepted by the Google Play Store. | |
|
||
### Changes | ||
|
||
- [improvement] [cht-android#106](https://github.com/medic/cht-android/issues/106): Update target SDK version to 29 for Play Store compliance | ||
- [improvement] [cht-android#106](https://github.com/medic/cht-android/issues/106): Update target SDK version to 29 for Play Store compliance. | ||
|
||
## 0.5.0 | ||
|
||
|
@@ -118,7 +118,7 @@ See the [Makefile](./Makefile) for more details. | |
|
||
The command above builds and assembles the _debug_ and _release_ APKs of the Unbranded Webview version of the app. | ||
|
||
Each APK will be generated and stored in `build/outputs/apk/[flavor][Engine]/[debug|release]/`, for example after assembling the _Medicmobiledemo Webview_ flavor with `make flavor=MedicmobiledemoWebview assemble`, the _release_ versions of the APKs generated are stored in `build/outputs/apk/medicmobiledemoWebview/release/`. | ||
Each APK will be generated and stored in `build/outputs/apk/[flavor][Engine]/[debug|release]/`, for example after assembling the _Simprints Webview_ flavor with `make flavor=SimprintsWebview assemble`, the _release_ versions of the APKs generated are stored in `build/outputs/apk/simprintsWebview/release/`. | ||
|
||
To assemble other flavors, use the following command: `make flavour=[Flavor][Engine] assemble`. See the [Flavor selection](#flavor-selection) section for more details about `make` commands. | ||
|
||
|
@@ -162,32 +162,32 @@ To build and deploy APKs for all configured brands: | |
|
||
To add a new brand: | ||
|
||
1. add `productFlavors { <new_brand> { ... } }` in `build.gradle` | ||
2. add icons, strings etc. in `src/<new_brand>` | ||
3. to enable automated deployments, add the `new_brand` to `.github/workflows/publish.yml` | ||
1. add `productFlavors { <new_brand> { ... } }` in `build.gradle`. | ||
2. add icons, strings etc. in `src/<new_brand>`. | ||
3. to enable automated deployments, add the `new_brand` to `.github/workflows/publish.yml`. | ||
|
||
|
||
# Releasing | ||
|
||
## Alpha for release testing | ||
|
||
1. Make sure all issues for this release have passed AT and been merged into `master` | ||
1. Make sure all issues for this release have passed AT and been merged into `master`. | ||
2. Create a git tag starting with `v` and ending with the alpha version, e.g. `v1.2.3-alpha.1` and push the tag to GitHub. | ||
3. Creating this tag will trigger [GitHub Action](https://github.com/medic/cht-android/actions) to build, sign, and properly version the build. The release-ready APKs are available for side-loading from [GitHub Releases](https://github.com/medic/cht-android/releases). | ||
4. Announce the release in #quality-assurance | ||
4. Announce the release in #quality-assurance. | ||
|
||
## Final for users | ||
|
||
1. Create a git tag starting with `v`, e.g. `v1.2.3` and push the tag to GitHub. | ||
2. The exact same process as Step 3 above. | ||
3. Publish the unbranded, demo, simprints, and gamma flavors to the Play Store. | ||
3. Publish the unbranded, simprints, and gamma flavors to the Play Store. | ||
4. Announce the release on the [CHT forum](https://forum.communityhealthtoolkit.org), under the "Product - Releases" category. | ||
5. Each flavor is then individually released to users via "Release Management" in the Google Play Console. Once a flavor has been tested and is ready to go live, click Release to Production | ||
5. Each flavor is then individually released to users via "Release Management" in the Google Play Console. Once a flavor has been tested and is ready to go live, click Release to Production. | ||
|
||
|
||
# Copyright | ||
|
||
Copyright 2013-2021 Medic Mobile, Inc. <[email protected]> | ||
Copyright 2013-2021 Medic Mobile, Inc. <[email protected]>. | ||
|
||
|
||
# License | ||
|
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