Skip to content

Commit 92fabd5

Browse files
authored
ci: add GitHub Actions steps to build and upload debug APKs (#6)
1 parent aa250cd commit 92fabd5

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/android.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Android CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
name: Build APK
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: 'temurin'
23+
java-version: '17'
24+
25+
- name: Create local.properties from secrets
26+
run: |
27+
echo "sdk.dir=/usr/local/lib/android/sdk" >> local.properties
28+
echo "SUPABASE_URL=${{ secrets.SUPABASE_URL }}" >> local.properties
29+
echo "SUPABASE_API_KEY=${{ secrets.SUPABASE_API_KEY }}" >> local.properties
30+
echo "API_URL=${{ secrets.API_URL }}" >> local.properties
31+
32+
33+
- name: Cache Gradle
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.gradle/caches
38+
~/.gradle/wrapper
39+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
40+
restore-keys: |
41+
${{ runner.os }}-gradle-
42+
43+
- name: Grant execute permission for gradlew
44+
run: chmod +x ./gradlew
45+
46+
- name: Build Debug APK
47+
run: ./gradlew assembleDebug
48+
49+
- name: Upload F-droid APK
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: app-fdroid-debug.apk
53+
path: app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk
54+
55+
- name: Upload Play APK
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: app-play-debug.apk
59+
path: app/build/outputs/apk/play/debug/app-play-debug.apk

0 commit comments

Comments
 (0)