-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions workflow for building and releasing APK
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
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." |