[ ] PR title descriptive (can be used in release notes)
Breaking Changes
Once merged any content repos targeting android build must have app_id and app_name specified in their config.ts android configuration
Description
Refactor android configuration to allow any deployment to be built or run as an android app locally, and provide a template for future ios deployment-based configuration.
Existing support for building deployment apps has been refactored to work in the same way as local development, removing a lot of the existing hardcoded configurations and shell scripting requirements.
The main changes by feature are:
Deployment Config
Add support for android app_id and app_name variables. It is proposed to include these in the config themselves as supplying as part of github actions only makes it harder to test/develop locally.
Workflows
Add new android configure workflow which handles android config file replacements
Add new android workflow as a convenience to call configure workflow alongside splash and launcher icon workflows
Remove populate_android_assets workflow, but the 2 child workflows it calls still accessible within the android namespace, i.e. yarn workflow android set_splash_image and yarn workflow android set_launcher_icon
Documentation updated where workflow references found
Github Actions
reusable-android-build.yml - no longer required APP_ID and APP_NAME variables, android config shell scripts removed
reusable-app-build.yml - no longer required APP_ID and APP_NAME variables, android config shell scripts removed
reusable-content-sync.yml - versioning now handled by script
Android Folder
Add a new templates subfolder used to locate specific templates that need to be moved after populating (templated strings.xml conflicts with generated and templated MainActivity.java needs to sit in subfolder specific to app id)
Other Changes
env-replace output log added
add template files for core android build files
yarn scripts version update to no longer populate --android version code (now read from content_tag_latest when setting up android build). Also added support for --content to directly update the content_tag_latest deployment config, and a --auto-patch to automatically increment version code patch by 1 (e.g. 1.2.3 -> 1.2.4).
This reduces complexity needed to version in github actions and catches an error in action code where config.git.content_tag_latest = xxx would not be supported (only config.git = {content_tag_latest: xxx})
Review Notes
Android configuration
Update deployment config to include android app_id and app_name, e.g.
View changes made to android build files (and confirm they are as expected).
If testing on android ensure you have a google-services.json file locally which includes entry for the target appId
Note this will also run the splash and logo workflows, to just run the config can instead use yarn workflow android configure
Content Versioning
Prompt config.ts content version update via
yarn scripts version --content
Auto-update config.ts content version via
yarn scripts version --content --auto-patch
Github Actions
Not easy to test, ideally we should create a debug_app play store entry which can be used to test from the debug_app content repo once merged
Follow-up tasks
[x] Update relevant documentation for new android app config (@jfmcquade) #2255
[x] Generate similar workflow as required for ios (@jfmcquade) #2256
[x] Remove all template-generated files and add to gitignore (currently retained to more easily view diffs) (@chrismclarke ) #2260
[ ] Consider refactoring reusable-android-release.yml so that no workflows need APP_ID variable provided (can either load from deployment, or use previous workflow to write to output/disk and retrieve) (@ChrisMarsh82 or @chrismclarke )
Git Issues
Closes #2136
Closes #2119
Closes #1768
Screenshots/Videos
Example android workflow variable replacements
(splash fails on debug, but rest of files configured)
Example running debug_app independently on device (previous used plh_teens)
PR Checklist
Breaking Changes
app_id
andapp_name
specified in their config.ts android configurationDescription
Refactor android configuration to allow any deployment to be built or run as an android app locally, and provide a template for future ios deployment-based configuration.
Existing support for building deployment apps has been refactored to work in the same way as local development, removing a lot of the existing hardcoded configurations and shell scripting requirements.
The main changes by feature are:
Deployment Config
app_id
andapp_name
variables. It is proposed to include these in the config themselves as supplying as part of github actions only makes it harder to test/develop locally.Workflows
android configure
workflow which handles android config file replacementsandroid
workflow as a convenience to call configure workflow alongside splash and launcher icon workflowspopulate_android_assets
workflow, but the 2 child workflows it calls still accessible within the android namespace, i.e.yarn workflow android set_splash_image
andyarn workflow android set_launcher_icon
Github Actions
reusable-android-build.yml - no longer required
APP_ID
andAPP_NAME
variables, android config shell scripts removed reusable-app-build.yml - no longer requiredAPP_ID
andAPP_NAME
variables, android config shell scripts removed reusable-content-sync.yml - versioning now handled by scriptAndroid Folder
templates
subfolder used to locate specific templates that need to be moved after populating (templatedstrings.xml
conflicts with generated and templatedMainActivity.java
needs to sit in subfolder specific to app id)Other Changes
yarn scripts version
update to no longer populate--android
version code (now read fromcontent_tag_latest
when setting up android build). Also added support for--content
to directly update thecontent_tag_latest
deployment config, and a--auto-patch
to automatically increment version code patch by 1 (e.g.1.2.3
->1.2.4
). This reduces complexity needed to version in github actions and catches an error in action code whereconfig.git.content_tag_latest = xxx
would not be supported (onlyconfig.git = {content_tag_latest: xxx}
)Review Notes
Android configuration
View changes made to android build files (and confirm they are as expected). If testing on android ensure you have a google-services.json file locally which includes entry for the target appId
Note this will also run the splash and logo workflows, to just run the config can instead use
yarn workflow android configure
Content Versioning Prompt config.ts content version update via
Auto-update config.ts content version via
Github Actions Not easy to test, ideally we should create a debug_app play store entry which can be used to test from the debug_app content repo once merged
Follow-up tasks
reusable-android-release.yml
so that no workflows needAPP_ID
variable provided (can either load from deployment, or use previous workflow to write to output/disk and retrieve) (@ChrisMarsh82 or @chrismclarke )Git Issues
Closes #2136 Closes #2119 Closes #1768
Screenshots/Videos
Example android workflow variable replacements (splash fails on debug, but rest of files configured)![image](https://github.com/IDEMSInternational/parenting-app-ui/assets/10515065/d395c927-4f78-492c-8755-2fda540e959e)
Example running debug_app independently on device (previous used plh_teens)![image](https://github.com/IDEMSInternational/parenting-app-ui/assets/10515065/c0db894a-010d-4296-b221-ae240b4bf11e)