-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.91 KB
/
Copy pathlocal-build-apk.yml
File metadata and controls
71 lines (60 loc) · 1.91 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
name: Local Build - Android APK (no EAS)
on:
workflow_dispatch:
inputs:
upload_artifact:
description: "Upload APK as workflow artifact"
required: true
default: "true"
type: choice
options:
- "true"
- "false"
jobs:
gradle-apk:
name: Build universal APK with Gradle
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Setup Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-${{ runner.os }}-
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Generate native Android project
run: npx expo prebuild -p android --clean --no-install
- name: Build release APK
working-directory: android
run: ./gradlew :app:assembleRelease --no-daemon
- name: Locate APK
id: locate
run: |
APK_PATH=$(find android/app/build/outputs/apk/release -name "*.apk" | head -n 1)
echo "apk_path=$APK_PATH" >> "$GITHUB_OUTPUT"
ls -lh "$APK_PATH"
- name: Upload APK artifact
if: ${{ github.event.inputs.upload_artifact == 'true' }}
uses: actions/upload-artifact@v7
with:
name: nyaya-sahayak-${{ github.sha }}-apk
path: ${{ steps.locate.outputs.apk_path }}
retention-days: 30