Skip to content

A GitHub Actions Workflow to build an Android App and upload the assets to GitHub Releases.

License

Notifications You must be signed in to change notification settings

owwlo/android-github-actions-build-release-demo

Repository files navigation

This project all starts as I need some CI tooling to build and publish my personal Android for fun. Before crafting it, I did some research but hardly find any project satisfy my need enough. So, here we go...

Features

  • Whether making a new "Release" is controlled by hashtags embedded in the commit message
    • If a commit message contains #release, a new Action job will be kicked off: example
    • If #hide appears in the commit message, the commit message will be excluded from the changelog: example
    • If you want to change the above behaviors or to add secret sauce, you can edit scripts/filter_changelog.py
  • A changelog will be generated along with the "Release", the changelog starts from the last #release hashtag to the most recent one: example

Adapt it into your Project

Easy! Follow these steps:

  1. Have your Android App checked into your repo (assuming your project uses ./gradlew build to build. wait... what?! you don't use gradle? alright, you can update the build instruction in the Build Repo step defined in .github/workflows/main.yml)
  2. Copy .github/workflows/main.yml, scripts/filter_changelog.py to your repo

Wa-lah! You are done! Try triggering your first build run by pushing a change with #release in its commit message! If everything works well, you will see: example

FAQs

Q: My project doesn't use Gradle. Will this workflow work for me? A: No(sort of). You will have to update the build instruction that is defined in the Build Repo step in .github/workflows/main.yml

Q: I hate the release naming release.20210123_123456, can I change it? A: Sorry bro, life isn't prefect, deal with it! ... kidding, the naming is defined as the tag field in the Upload APKs to Release step in .github/workflows/main.yml

Q: Your changelog format s**ks! How I can replace it with mine? A: Alright, update it in scripts/filter_changelog.py

This Workflow is Inspired by...