Skip to content

Automate APK distribution via GitHub Releases #4

Description

@LangerSword

Summary

Implement an automated build and distribution pipeline to provide pre-built APK binaries through GitHub Releases. This will eliminate the requirement for users and testers to manually clone the repository and compile the project using Android Studio.

Context

The current distribution model for WazPay is "source-only." To run the application, a user must have a local development environment configured with the Android SDK, NDK, and specific Gradle versions. This creates significant friction for non-technical testers and early adopters who may not have the hardware or technical background to manage a 30GB+ Android Studio installation.

By utilizing GitHub Actions, we can automate the build process and attach the resulting APK directly to the "Releases" section of the repository.

Requirements

Phase 1: GitHub Actions Integration

Create a CI/CD workflow (.github/workflows/android-release.yml) to handle the build process:

  • Trigger build on tagged releases or manual dispatch.
  • Configure the Java Development Kit (JDK) and Android SDK environments within the runner.
  • Execute the Gradle assembler task to generate the binary.

Phase 2: Signing and Security

Ensure the distributed binaries are verifiable and secure:

  • Set up GitHub Secrets to store the .jks keystore and signing credentials.
  • Automate the signing of the release APK during the build process.
  • Generate SHA-256 checksums for every release to allow users to verify file integrity.

Phase 3: Release Management

Automate the publishing side:

  • Use a release action to create a draft or a published release.
  • Automatically upload the signed APK and the checksum file as release assets.
  • Draft release notes that include the commit log since the previous version.

Implementation Notes

  • Gradle Caching: Use actions/cache to cache Gradle dependencies. This prevents the runner from downloading the entire dependency tree for every build, significantly reducing execution time.
  • Build Variants: Initially, we should provide both a debug build for internal testing and a release build for end-users.
  • Version Bundling: Ensure the version code in build.gradle is automatically updated or synced with the GitHub tag to avoid versioning conflicts.

Success Criteria

  • GitHub Action workflow successfully compiles the APK.
  • Signed APK is automatically uploaded to the GitHub Releases tab upon tagging.
  • Checksum file (SHA-256) is generated and attached to the release.
  • Documentation updated to point users toward the Releases page rather than local building instructions.

Difficulty

Intermediate (DevOps/CI/CD)

Labels

enhancement, devops, distribution

References

  • Android Developer Documentation: "Build your app from the command line"
  • GitHub Actions Documentation: "Workflow syntax for GitHub Actions"
  • softprops/action-gh-release (recommended action for artifact uploads)

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions