-
-
Notifications
You must be signed in to change notification settings - Fork 29
86 lines (68 loc) Β· 2.72 KB
/
android.yml
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
80
81
82
83
84
85
86
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Global envs
# env:
# ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/x.x.x
# ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/x.x.x
# TODO: Avoid brutally editing/setting ndk.dir in local.properties
jobs:
build-android:
runs-on: ubuntu-22.04
# Local job envs
steps:
- uses: actions/checkout@v3
- name: Setup JDK 19
uses: actions/setup-java@v3.11.0
with:
java-version: 19
distribution: temurin
cache: 'gradle'
- name: Install all project dependencies
run: yarn && yarn setup
- name: npx react-native info
run: npx react-native info
- name: Build application Debug APK with Gradle
uses: gradle/gradle-build-action@v2.4.2
with:
arguments: assembleDebug
build-root-directory: android
# Avoid release poisoned cache problems
# Preserve hosted agent free disk space
- name: Delete Android build pre-computed outputs
uses: gradle/gradle-build-action@v2.4.2
with:
arguments: clean
build-root-directory: android
- name: Build application Release APK with Gradle
uses: gradle/gradle-build-action@v2.4.2
with:
arguments: assembleRelease
build-root-directory: android
# - name: Build project Make-based (not CMake)
# run: |
# /usr/local/lib/android/sdk/ndk/x.x.x/ndk-build
# NDK_PROJECT_PATH=null
# APP_BUILD_SCRIPT=/home/runner/work/react-native-template-new-architecture/react-native-template-new-architecture/node_modules/react-native/ReactAndroid/src/main/jni/react/jni/Android.mk
# NDK_APPLICATION_MK=/home/runner/work/react-native-template-new-architecture/react-native-template-new-architecture/node_modules/react-native/ReactAndroid/src/main/jni/Application.mk
# E2E Release APK for Detox per VM image architecture for AVD
# --active-arch-only
# - M1: -PreactNativeArchitectures=arm64-v8a
# - Other: -PreactNativeArchitectures=x86_64
# Release AAB/APK with all 4 ABIs
# - 1 AAB/APK, 1 upload
# - Consider ccache without matrix
# - Parallelise each ABI via matrix
# - Upload each ABI seperately
# - Consider sccache
# - Bigger organisation/team
# - Running more frequent builds