Android App Template with GitHub Workflow Build
An Android CI/CD template that automates building of Android APK and AAB files using GitHub Actions, supporting debug builds as well as release builds and uploading build artifacts for distribution. The workflow being used is manually triggerable.
- Automated CI/CD with GitHub Actions for building Android APKs and AABs.
- Customizable Project Setup using an initialization script.
- Environment Variables for Secure Signing of builds.
- Manual Trigger Workflow for controlled release management.
- Easy Artifact Download directly from GitHub Actions.
-
Run the
init.py
script to set up your Android project metadata:- Updates package name, app name, and version details in the source code.
- Configures secrets for GitHub workflows.
python init.py
The script reads metadata from a _meta.json
file. Example structure:
{
"old_package": "dev.mfm.app",
"new_package": "com.package.new",
"name": "NewAppName",
"version_name": "1.0.0",
"version_code": "1"
}
- Verify your Android project files are updated correctly:
strings.xml
: Contains the updated app name.build.gradle
: Updated with the new app name, version name, and version code.- Package directory structure updated for the new package name.
- Keystore Information:
- Add secrets to sign your builds:
KEYSTORE_BASE_64
,DEBUG_KEYSTORE_PASSWORD
,DEBUG_KEYSTORE_ALIAS
,DEBUG_KEY_PASSWORD
.
- Add secrets to sign your builds:
-
Trigger workflows from the Actions tab:
- Select Build release-app for production builds.
- Select Build debug-app for testing builds.
-
Download artifacts (
release-build.zip
ordebug-build.zip
) from the workflow run.
This workflow was inspired by Lloyd Dcosta's guide on Medium and enhanced by @MFM-347.
The code in this repository is licensed under the Apache 2.0 License.