diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..71242f37 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,35 @@ +name: Build and test + +on: [push, pull_request] + +jobs: + build: + name: Build + runs-on: ubuntu-18.04 + steps: + - 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/fastlane-action@v1.4.0 + env: + ANDROID_KEYSTORE_PATH: ${{ secrets.ANDROID_KEYSTORE_PATH }} + ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} + ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} + ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} + with: + lane: build + options: '{ "flavor": "unbranded" }' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..cbf51d06 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,174 @@ +name: Build and publish + +on: + push: + tags: v*.*.* + +env: + ANDROID_KEYSTORE_PATH: ${{ secrets.ANDROID_KEYSTORE_PATH }} + ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} + ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} + ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} + +jobs: + build: + name: Build + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - 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/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "unbranded" }' + - name: Assemble gamma + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "medicmobilegamma" }' + - name: Assemble demo + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "medicmobiledemo" }' + - name: Assemble bracuganda + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "bracuganda" }' + - name: Assemble cic_guatemala + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "cic_guatemala" }' + - name: Assemble cmmb_kenya + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "cmmb_kenya" }' + - name: Assemble covid_moh_mali + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "covid_moh_mali" }' + - name: Assemble ebpp_indonesia + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "ebpp_indonesia" }' + - name: Assemble hope_through_health + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "hope_through_health" }' + - name: Assemble livinggoods + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "livinggoods" }' + - name: Assemble livinggoodskenya + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "livinggoodskenya" }' + - name: Assemble livinggoods_assisted_networks + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "livinggoods_assisted_networks" }' + - name: Assemble livinggoods_innovation_ke + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "livinggoods_innovation_ke" }' + - name: Assemble livinggoods_innovation_ke_supervisor + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "livinggoods_innovation_ke_supervisor" }' + - name: Assemble livinggoods_innovation_ke_hivst + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "livinggoods_innovation_ke_hivst" }' + - name: Assemble moh_kenya_siaya_red + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "moh_kenya_siaya_red" }' + - name: Assemble moh_kenya_siaya_green + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "moh_kenya_siaya_green" }' + - name: Assemble moh_kenya_siaya_black + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "moh_kenya_siaya_black" }' + - name: Assemble moh_mali + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "moh_mali" }' + - name: Assemble moh_zanzibar_training + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "moh_zanzibar_training" }' + - name: Assemble moh_zanzibar + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "moh_zanzibar" }' + - name: Assemble musomali + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "musomali" }' + - name: Assemble pih_malawi + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "pih_malawi" }' + - name: Assemble pih_malawi_supervisor + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "pih_malawi_supervisor" }' + - name: Assemble simprints + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "simprints" }' + - name: Assemble surveillance_covid19_kenya + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "surveillance_covid19_kenya" }' + - name: Assemble vhw_burundi + uses: maierj/fastlane-action@v1.4.0 + with: + lane: build + options: '{ "flavor": "vhw_burundi" }' + - name: GitHub release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + draft: true + files: build/outputs/apk/**/*.apk + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aeffc6e5..00000000 --- a/.travis.yml +++ /dev/null @@ -1,100 +0,0 @@ -language: android -dist: trusty # Android builds are only supported on our Trusty image -jdk: oraclejdk8 -android: - components: - - tools - - platform-tools - - extra-android-m2repository - - build-tools-29.0.2 - - android-29 -env: -- GRADLE_OPTS="-XX:MaxPermSize=2048M" -stages: - - name: test - - name: alpha - if: tag =~ ^v.+-alpha\.[0-9]+$ # eg: v3.6.0-alpha.1 - - name: final - if: tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ # eg: v3.6.0 -jobs: - include: - - stage: test - script: make test - - - stage: alpha - script: fastlane build flavor:unbranded - script: fastlane build flavor:medicmobilegamma - script: fastlane build flavor:medicmobiledemo - - - stage: final - # flavors sorted alphabetically with three per job - script: - - fastlane build flavor:unbranded - - fastlane build flavor:medicmobilegamma - - fastlane build flavor:medicmobiledemo - - script: - - fastlane build flavor:bracuganda - - fastlane build flavor:cic_guatemala - - fastlane build flavor:cmmb_kenya - - script: - - fastlane build flavor:covid_moh_mali - - fastlane build flavor:ebpp_indonesia - - fastlane build flavor:hope_through_health - - script: - - fastlane build flavor:livinggoods - - fastlane build flavor:livinggoodskenya - - fastlane build flavor:livinggoods_assisted_networks - - script: - - fastlane build flavor:livinggoods_innovation_ke - - fastlane build flavor:livinggoods_innovation_ke_supervisor - - fastlane build flavor:livinggoods_innovation_ke_hivst - - script: -# - fastlane build flavor:moh_kenya_siaya_white - - fastlane build flavor:moh_kenya_siaya_red - - fastlane build flavor:moh_kenya_siaya_green - - fastlane build flavor:moh_kenya_siaya_black - - fastlane build flavor:moh_mali - - script: - - fastlane build flavor:moh_zanzibar_training - - fastlane build flavor:moh_zanzibar - - script: - - fastlane build flavor:musomali - - fastlane build flavor:pih_malawi - - fastlane build flavor:pih_malawi_supervisor - - script: - - fastlane build flavor:simprints - - fastlane build flavor:surveillance_covid19_kenya - - fastlane build flavor:vhw_burundi - - script: -before_install: -- openssl aes-256-cbc -K $encrypted_323c4a109760_key -iv $encrypted_323c4a109760_iv -in secrets.tar.gz.enc -out ./secrets.tar.gz -d -- tar -xf ./secrets.tar.gz -- gem update --system -- gem install fastlane --no-document --quiet -before_cache: -- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock -- rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - "$HOME/.gradle/caches/" - - "$HOME/.gradle/wrapper/" - - "$HOME/.android/build-cache" -deploy: - - provider: releases - skip_cleanup: true - overwrite: true - api_key: - secure: Dm6ciqGeR3zT+/hdO4jq+2sMa/d3sHSQ1U9ya9tCu71+BMZfjRA8vgBAWgnp6xixCUTEppJNgRrKaCR9V12Yu8Yl3ceY3bGRd6xhR9uUK+PgFUSjptuiwgwE1Fbj7lxT1NG1ZptvnqYZ0YhPiAC5cmcJUuz/0g83fKJfDNrX9V6IGQObdiPqDJX3cVbU/5NpSbIsnNqQfaldMP2Y1m1gODMCifOqM2Mj1nHd+X9OzEpuICCZiiHJJBKafdifZKmPlSgYDjt3d6DCsn5YiNnNm5Rs4kqWJc4YvV2G+S4eMnL7XB4pg45zZQ6ZIwn3NPp5a4pfHTn5nGC/2Hqqe8cw+xURYf/qrOZp3mQgAYiJht9bivMhwlvCvTh2kw+xorTj7wlFDSyj78QLxjxidiAj0AkBdYlVttSXDXAoCTGKHDhFEtKNviVdB9TNfYwKTFin4BCPsPnBEQZB9pzqIwBha9INjutYUJ9aX1uC7a1grR7Oa6IL7NH0Z0sV7bYkoW91X0ZxQtsVnFduc2y6AwKzqlO1VKN0U55KmUnj0STCGSMHZoI1cObBJtCzUcUnH7NIEfeZLq/tQ8sRkFlCJ1g2bJI0VG8DMTP56krvHKNknLacN5SjloNCST3SL6qlYto95ypSlfU+u3qpC6kNdXa7Yvodk+5u7VVQcX18xczbYvs= - file_glob: true - file: ./build/outputs/apk/**/*.apk - on: - tags: true - repo: medic/medic-android - branch: master - - provider: script - script: fastlane deploy flavor:unbranded && fastlane deploy flavor:medicmobilegamma && fastlane deploy flavor:medicmobiledemo - skip_cleanup: true - on: - tags: true - repo: medic/medic-android - branch: master diff --git a/README.md b/README.md index 42566a00..54e1e249 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,13 @@ To add a new brand: 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 [Travis CI](https://travis-ci.org/github/medic/medic-android) to build, sign, and properly version the build. The release-ready APKs are available for side-loading from [GitHub Releases](https://github.com/medic/medic-android/releases) and are uploaded to the Google Play Console in the "alpha" channel for only the `unbranded` and `gamma` flavors. +3. Creating this tag will trigger [GitHub Action](https://github.com/medic/medic-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/medic-android/releases). 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, but the `demo` flavour is updated also. +2. The exact same process as Step 3 above. 3. Announce the release on the [CHT forum](https://forum.communityhealthtoolkit.org), under the "Product - Releases" category. 4. 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 diff --git a/gradle.properties b/gradle.properties index 5bac8ac5..f991a87d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,2 @@ android.useAndroidX=true +org.gradle.jvmargs=-Xmx2048m diff --git a/secrets.tar.gz.enc b/secrets.tar.gz.enc index b2668a99..6ca00e2b 100644 Binary files a/secrets.tar.gz.enc and b/secrets.tar.gz.enc differ