forked from NextGenXplorer/Reshme_Info
-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (64 loc) · 2.54 KB
/
android-build.yml
File metadata and controls
79 lines (64 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: 📦 Expo EAS Android AAB → APK (Signed)
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
android-build:
runs-on: ubuntu-latest
steps:
- name: 🏗 Checkout repo
uses: actions/checkout@v4
- name: 🧱 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: 🧰 Setup Expo & EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 📦 Install dependencies
run: npm install
- name: 🧩 Setup Android SDK
uses: android-actions/setup-android@v3
- name: 🔐 Restore keystore from Base64
run: |
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > keystore.jks
- name: 🏗️ Build Android AAB (local)
run: eas build --platform android --profile production --local --non-interactive
env:
EAS_NO_VCS: 1
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
ANDROID_KEYSTORE_PATH: keystore.jks
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
- name: 📥 Download bundletool
run: |
BUNDLETOOL_VERSION=$(curl -s https://api.github.com/repos/google/bundletool/releases/latest | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
curl -L -o bundletool.jar "https://github.com/google/bundletool/releases/download/${BUNDLETOOL_VERSION}/bundletool-all-${BUNDLETOOL_VERSION}.jar"
echo "Downloaded bundletool version: ${BUNDLETOOL_VERSION}"
ls -la bundletool.jar
- name: 🔁 Convert AAB → SIGNED universal APK
run: |
AAB_PATH=$(find . -name "*.aab" | head -n 1)
java -jar bundletool.jar build-apks \
--bundle=$AAB_PATH \
--output=app.apks \
--mode=universal \
--ks=keystore.jks \
--ks-key-alias=${{ secrets.ANDROID_KEY_ALIAS }} \
--ks-pass=pass:${{ secrets.ANDROID_KEYSTORE_PASSWORD }} \
--key-pass=pass:${{ secrets.ANDROID_KEY_PASSWORD }}
unzip app.apks -d apk-output
- name: 📤 Upload AAB
uses: actions/upload-artifact@v4
with:
name: android-aab
path: "**/*.aab"
- name: 📤 Upload APK
uses: actions/upload-artifact@v4
with:
name: android-apk
path: apk-output/universal.apk