Add GitHub Actions workflow for building and releasing APK #1
Workflow file for this run
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 and Release APK | |
on: | |
push: | |
tags: | |
- 'v*' # Triggers only when you push a tag starting with 'v' (e.g., v1.0, v1.1) | |
jobs: | |
build: | |
name: Build and Release Android APK | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the code | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Set up Java and Gradle | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
# Step 3: Build the APK | |
- name: Build APK | |
run: | | |
chmod +x ./gradlew | |
./gradlew assembleDebug | |
# Step 4: Upload APK to GitHub Release | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "app/build/outputs/apk/debug/app-debug.apk" | |
tag: ${{ github.ref_name }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: "Release ${{ github.ref_name }}" | |
body: "This release includes the latest APK build." |