-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (49 loc) · 1.73 KB
/
Copy pathandroid-ci.yml
File metadata and controls
60 lines (49 loc) · 1.73 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
name: Android CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
name: Build PartyMaker APK
runs-on: ubuntu-latest
steps:
# Step 1: Get the code from the Repo
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Install a JDK that is compatible with Android (version 17)
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
# Step 3: Set up Android SDK
- name: Set up Android SDK
uses: android-actions/setup-android@v3
# Step 4: Create local.properties file so build doesn't fail
- name: Create local.properties
run: echo "sdk.dir=$ANDROID_HOME" > local.properties
# Step 5: Decode secrets.properties
- name: Decode secrets.properties
run: |
echo "${{ secrets.SECRETS_PROPERTIES }}" | base64 -d > secrets.properties
# Step 6: Decode google-services.json
- name: Decode google-services.json
run: |
echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 -d > app/google-services.json
echo "Google Services JSON file created"
# Step 7: Cache Gradle – to speed up runs
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# Step 8: Grant permissions to the gradlew file
- name: Grant permission to execute gradlew
run: chmod +x ./gradlew
# Step 9: Running the actual build
- name: Build with Gradle
run: ./gradlew assembleDebug