Skip to content

Commit

Permalink
Use GitHub Actions for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
garethbowen authored Dec 21, 2020
1 parent a003946 commit 6705216
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 102 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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" }'
174 changes: 174 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
lane: build
options: '{ "flavor": "unbranded" }'
- name: Assemble gamma
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "medicmobilegamma" }'
- name: Assemble demo
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "medicmobiledemo" }'
- name: Assemble bracuganda
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "bracuganda" }'
- name: Assemble cic_guatemala
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "cic_guatemala" }'
- name: Assemble cmmb_kenya
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "cmmb_kenya" }'
- name: Assemble covid_moh_mali
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "covid_moh_mali" }'
- name: Assemble ebpp_indonesia
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "ebpp_indonesia" }'
- name: Assemble hope_through_health
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "hope_through_health" }'
- name: Assemble livinggoods
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "livinggoods" }'
- name: Assemble livinggoodskenya
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "livinggoodskenya" }'
- name: Assemble livinggoods_assisted_networks
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "livinggoods_assisted_networks" }'
- name: Assemble livinggoods_innovation_ke
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "livinggoods_innovation_ke" }'
- name: Assemble livinggoods_innovation_ke_supervisor
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "livinggoods_innovation_ke_supervisor" }'
- name: Assemble livinggoods_innovation_ke_hivst
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "livinggoods_innovation_ke_hivst" }'
- name: Assemble moh_kenya_siaya_red
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "moh_kenya_siaya_red" }'
- name: Assemble moh_kenya_siaya_green
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "moh_kenya_siaya_green" }'
- name: Assemble moh_kenya_siaya_black
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "moh_kenya_siaya_black" }'
- name: Assemble moh_mali
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "moh_mali" }'
- name: Assemble moh_zanzibar_training
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "moh_zanzibar_training" }'
- name: Assemble moh_zanzibar
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "moh_zanzibar" }'
- name: Assemble musomali
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "musomali" }'
- name: Assemble pih_malawi
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "pih_malawi" }'
- name: Assemble pih_malawi_supervisor
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "pih_malawi_supervisor" }'
- name: Assemble simprints
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "simprints" }'
- name: Assemble surveillance_covid19_kenya
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "surveillance_covid19_kenya" }'
- name: Assemble vhw_burundi
uses: maierj/[email protected]
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 }}
100 changes: 0 additions & 100 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
android.useAndroidX=true
org.gradle.jvmargs=-Xmx2048m
Binary file modified secrets.tar.gz.enc
Binary file not shown.

0 comments on commit 6705216

Please sign in to comment.