-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (67 loc) Β· 2.49 KB
/
android_ci.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
name: Orbit CI
on:
pull_request:
branches: [develop]
paths:
- 'app/**'
- 'build.gradle'
- '**/*.kt'
jobs:
build:
runs-on: ubuntu-latest
steps:
# Gradle Cache
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle.properties', '**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Checkout Code
- name: Checkout the code
uses: actions/checkout@v4
# Setup JDK
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
# Setup Android SDK
- name: Setup Android SDK
uses: android-actions/setup-android@v3
# Grant Execute Permission
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# Decode google-services.json
- name: Decode google-services.json
env:
FIREBASE_SECRET: ${{ secrets.FIREBASE_SECRET }}
run: echo $FIREBASE_SECRET | base64 --decode > app/google-services.json
# Debug google-services.json
- name: Debug google-services.json
run: cat app/google-services.json
# Add Local Properties
- name: Add Local Properties
env:
BASE_URL: ${{ secrets.BASE_URL }}
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
ADMOB_APP_ID_DEBUG: ${{ secrets.ADMOB_APP_ID_DEBUG }}
ADMOB_APP_ID_RELEASE: ${{ secrets.ADMOB_APP_ID_RELEASE }}
ADMOB_AD_UNIT_ID_DEBUG: ${{ secrets.ADMOB_AD_UNIT_ID_DEBUG }}
ADMOB_AD_UNIT_ID_RELEASE: ${{ secrets.ADMOB_AD_UNIT_ID_RELEASE }}
run: |
echo -e "baseUrl=$BASE_URL" > local.properties
echo -e "amplitudeApiKey=$AMPLITUDE_API_KEY" >> local.properties
echo -e "admobAppIdDebug=$ADMOB_APP_ID_DEBUG" >> local.properties
echo -e "admobAppIdRelease=$ADMOB_APP_ID_RELEASE" >> local.properties
echo -e "admobAdUnitIdDebug=$ADMOB_AD_UNIT_ID_DEBUG" >> local.properties
echo -e "admobAdUnitIdRelease=$ADMOB_AD_UNIT_ID_RELEASE" >> local.properties
# Debug Local Properties Check
- name: Debug Local Properties
run: cat local.properties
# Run Lint and Build
- name: Run lint and build
run: ./gradlew ktlintCheck assembleDebug