Soundscape-Android

Continuous integration actions

This document describes the initial GitHGub actions in the repo. They’re written by someone new to GitHub, so improvements are always welcome.

GitHub secrets

Release build signing

The approach to signing in build-app.yaml is based on this description.

There are 5 secrets required, those are what were used when creating the signing keystore (in this case done from within Android Studio with Generate Signed App Bundle or APK):

Google services

The google-services.json file is not super secret so long as the server is configured appropriately, but we protect it just in case. The approach taken is the same as for the keystore:

There’s a mock google-services.json file checked in to GitHub to allow builds without access to secrets to complete. Authenticate for talking to the Firebase servers is done using google-github-actions/auth@v2. We pass in the credentials_json, see this page for details of what this is and how to format it. (To remove line breaks run cat soundscape-android-CREDENTIALS-NAME.json | tr -d '\012\015').

Repo commit without pull request

The run-test.yaml action bumps the version number, committing the change back into the repo. The repo has branch protection enabled which requires a pull request for any commits. We pass in a token as described here to allow the pull request to be bypassed:

Map tile API key

The code uses maplibre to render vector tiles. During evaluation we’re using https://www.maptiler.com/ as the source of those tiles though it seems like the most cost effective long term approach would be to move to our own Cloudflare solution. Server cost is one of the main driving factors here. The Mapping API key which for developers is stored in local.properties as tileProviderApiKey, and for the GitHub actions is

Actions

run-tests.yaml is the action which is run on each Pull Request. It runs several layers of tests:

build-app.yaml is the action used to build a release and is manually triggered. It’s steps are:

jekyll-gh-pages.yml is the action to build the GitHub Pages documentation site (including this page!). It’s triggered whenever there is a changes submitted within the /docs directory. To work it needs GitHub Pages to be enabled on the repository and for them to be configured with the Source being GitHub Actions.