Skip to content

Commit 42eacdd

Browse files
committed
added a workflow to build the Android APKs
1 parent 9f40e92 commit 42eacdd

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Android Build and Release
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'ios/**'
7+
workflow_dispatch: # Allows manual triggering from the Actions tab
8+
9+
jobs:
10+
build:
11+
name: Build Android APKs
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20.0.0'
22+
cache: 'npm'
23+
24+
- name: Set up Java
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: '17' # Recommended for modern React Native/Gradle versions
28+
distribution: 'zulu'
29+
30+
- name: Install Dependencies
31+
run: |
32+
npm install
33+
npm install -g react-native-cli
34+
35+
- name: Run Jetifier
36+
run: npx jetify -r
37+
38+
- name: Change wrapper permissions
39+
run: chmod +x android/gradlew
40+
41+
- name: Build DevDebug APK
42+
run: |
43+
cd android
44+
./gradlew assembleDevDebug
45+
46+
- name: Build Debug APK
47+
run: |
48+
cd android
49+
./gradlew assembleDebug
50+
51+
- name: Upload APKs to Release
52+
uses: softprops/action-gh-release@v2
53+
if: startsWith(github.ref, 'refs/tags/')
54+
with:
55+
files: |
56+
android/app/build/outputs/apk/dev/debug/*.apk
57+
android/app/build/outputs/apk/debug/*.apk
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)