Automated Build Android With Using Github Action
- Project Github Action Script
- Using Github Workflows
- Private Repository Tested (Passed Build App bundle(s) and APK generated successfully)
- Full Code For Github Action Workflows Click Here
Article Sources
- How To Securely Build and Sign Your Android App With GitHub Actions
- How to Use GitHub Actions to Automate Android App Development
How To Use Workflows
Step 1. Upload Your Project on Github
- Project must be android studio project using gradle
Step 2. Create files github workflows
- Create Files with name generate-apk-aab-debug-release.yml inside folder .github/workflows/
- .github/workflows/generate-apk-aab-debug-release.yml this is position files
Step 3. Create Code
name: Generate APK / AAB Debug And Release
on:
# Triggers the workflow on push or pull request events but only for default and protected branches
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set Up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Run tests
run: ./gradlew test
# Run Build Project
- name: Build project
run: ./gradlew build
# Create APK Debug
- name: Build apk debug project (APK)
run: ./gradlew assembleDebug
# Create APK Release
- name: Build apk release project (APK)
run: ./gradlew assemble
# Create Bundle AAB Release
# Noted for main module build [module-name]:bundleRelease
- name: Build app bundle release (AAB)
run: ./gradlew app:bundleRelease
# Upload Artifact Build
# Noted For Output [module-name]/build/outputs/
- name: Upload debug build APK
uses: actions/upload-artifact@v2
with:
name: App bundle(s) and APK(s) generated
path: app/build/outputs/
Step 4. Automated Build on Actions tab on your github repository
Step 5. Download Artifact
Extras (Private Repository Succesfully Build Proven)
Result Generated from Github Action
APK Debug
APK Release
AAB App Bundle
Colaborator
Very open to anyone, I'll write your name under this, please contribute by sending an email to me
- Mail To [email protected]
- Subject : Github _ [Github-Username-Account] _ [Language] _ [Repository-Name]
- Example : Github_amirisback_kotlin_admob-helper-implementation
Name Of Contribute
- Muhammad Faisal Amir
- Waiting List
- Waiting List
Waiting for your contribute
Attention !!!
- Please enjoy and don't forget fork and give a star
- Don't Forget Follow My Github Account