-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
48 lines (43 loc) · 1.78 KB
/
action.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
# 🔗 Links:
# Source file: https://github.com/obytes/react-native-template-obytes/blob/master/.github/actions/setup-jdk-generate-apk/action.yml
# Composite actions docs: https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
# ✍️ Description:
# This is a composite action, which means it can be used in other actions.
# This action is used to set up the JDK environment and generate an Android APK for testing.
# This action accepts one input: `APP_ENV`, which is used to generate an APK for a specific environment (development, staging, production). We use staging by default.
# Before generating the APK, we run a pre-build script to generate the necessary native folders based on the APP_ENV.
# On success, the APK is generated at `./android/app/build/outputs/apk/release/app-release.apk`.
# 👀 Example usage:
# - name : 📦 Set Up JDK + Generate Test APK
# uses: ./.github/actions/setup-jdk-generate-apk
# with:
# APP_ENV: 'staging'
name: 'Setup JDK + GRADLE + Generate APK'
description: 'Setup JDK + GRADLE + Generate APK'
inputs:
APP_ENV:
description: 'APP_ENV (one of): development, staging, production'
required: true
default: 'staging'
runs:
using: 'composite'
steps:
- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '11'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Generate Test APK
run: |
pnpm prebuild:${{ inputs.APP_ENV }}
cd android
chmod +x ./gradlew
./gradlew assembleRelease --no-daemon
cd ..
shell: bash
env:
EXPO_NO_DOTENV: '1'
APP_ENV: ${{ inputs.APP_ENV }}
CI: 'true'