A reproducible, CI‑friendly GitHub Action that builds Android apps using Gradle, detects the version from your Gradle files, optionally scans the unsigned APK with VirusTotal, automatically creates git tags, signs APK/AAB artifacts using either a Base64 keystore or a repository keystore, and outputs final release‑ready files.
Runs on all GitHub‑hosted runners without Node or Docker — pure composite action.
- 🔧 Build Android apps using any Gradle task (default:
assembleRelease) - 🔐 Sign APK/AAB artifacts using
apksigner - 🗂️ Supports Base64 keystores and repo‑based keystores
- 🦠 Optional VirusTotal scan before signing
- 🏷️ Automatic version detection (
versionName+versionCode) - 🏷️ Automatic git tag creation (
v<versionName>) - 📦 Outputs final signed artifacts
- 🏁 Fully reproducible, no external dependencies
- 🌐 Works on all GitHub‑hosted runners
| Name | Required | Description |
|---|---|---|
keystore |
no | Base64‑encoded keystore (ignored if use_repo_keystore=true) |
keystore_password |
yes | Password for the keystore |
key_alias |
yes | Alias of the signing key |
key_password |
yes | Password for the signing key |
gradle_task |
no | Gradle task to run (default: assembleRelease) |
use_repo_keystore |
no | Use a keystore stored in the repository (true / false) |
repo_keystore_path |
no | Path to the repo keystore (default: release-key.jks) |
auto_tag |
no | Automatically create git tag based on versionName (true / false) |
virustotal_scan |
no | Scan unsigned APK with VirusTotal before signing (true / false) |
virustotal_api_key |
no | VirusTotal API key (required if virustotal_scan=true) |
virustotal_timeout |
no | Max seconds to wait for VirusTotal analysis (default: 120) |
| Name | Description |
|---|---|
signed_apk |
Path to the final signed APK |
version_name |
Detected versionName |
version_code |
Detected versionCode |
name: Build Android App
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: FreetimeMaker/android-build-sign-release@v1.2.0
id: android
with:
keystore: ${{ secrets.KEYSTORE_BASE64 }}
keystore_password: ${{ secrets.KEYSTORE_PASSWORD }}
key_alias: ${{ secrets.KEY_ALIAS }}
key_password: ${{ secrets.KEY_PASSWORD }}
auto_tag: true
virustotal_scan: true
virustotal_api_key: ${{ secrets.VT_API_KEY }}
- uses: actions/upload-artifact@v4
with:
name: Signed APK
path: ${{ steps.android.outputs.signed_apk }}
- uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.android.outputs.version_name }}
files: ${{ steps.android.outputs.signed_apk }}steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: FreetimeMaker/android-build-sign-release@v1.2.0
id: android
with:
use_repo_keystore: true
repo_keystore_path: "keystore/release.jks"
keystore_password: ${{ secrets.KEYSTORE_PASSWORD }}
key_alias: ${{ secrets.KEY_ALIAS }}
key_password: ${{ secrets.KEY_PASSWORD }}
auto_tag: true
- uses: actions/upload-artifact@v4
with:
name: Signed APK
path: ${{ steps.android.outputs.signed_apk }}Just run this command: base64 -w 0 my-release-key.jks > keystore.b64
Place your keystore anywhere in the repo: keystore/release.jks Use it like this: use_repo_keystore: true repo_keystore_path: "keystore/release.jks"
If enabled, the Action will:
Build the app
Locate the unsigned APK
Upload it to VirusTotal
Wait for the analysis
Fail the workflow if:
any engine reports malicious > 0
the scan times out
the API key is missing
Enable it like this: virustotal_scan: true virustotal_api_key: ${{ secrets.VT_API_KEY }}
Extracts: versionName versionCode
from: app/build.gradle app/build.gradle.kts
Example: versionName "1.4.2" versionCode 42
Outputs: version_name = 1.4.2 version_code = 42
If auto_tag: true, the Action creates: v and pushes it automatically.
MIT