Build Debug APK #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Debug APK | |
on: | |
workflow_dispatch: # Allow manual triggering via the GitHub Actions UI | |
jobs: | |
build_debug_apk: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Step 2: Set up JDK 17 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
# Step 3: Cache Gradle dependencies | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle | |
# Step 4: Set up Android SDK | |
- name: Set up Android SDK | |
uses: android-actions/setup-android@v2 | |
with: | |
api-level: 34 # Match with your compileSdkVersion | |
build-tools: 34.0.0 # Match with your buildToolsVersion | |
target: android-34 | |
# Step 5: Grant execution permissions to gradlew | |
- name: Grant execute permission to gradlew | |
run: chmod +x ./gradlew | |
# Step 6: Build the debug APK | |
- name: Build Debug APK | |
run: ./gradlew assembleDebug | |
# Step 7: Upload the debug APK as an artifact | |
- name: Upload APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: debug-apk | |
path: app/build/outputs/apk/debug/app-debug.apk |