-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.89 KB
/
Build.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
name: Build
on:
push:
branches: [ master ]
jobs:
build_apk:
name: Generate APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Configure Keystore
run: |
echo "$ANDROID_KEYSTORE_FILE" > keystore.b64
base64 -d -i keystore.b64 > app/keystore.jks
echo "storeFile=keystore.jks" >>keystore.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >>keystore.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >>keystore.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >>keystore.properties
env:
ANDROID_KEYSTORE_FILE: ${{secrets.ANDROID_KEYSTORE_FILE}}
KEYSTORE_KEY_ALIAS: ${{secrets.KEYSTORE_KEY_ALIAS}}
KEYSTORE_KEY_PASSWORD: ${{secrets.KEYSTORE_KEY_PASSWORD}}
KEYSTORE_STORE_PASSWORD: ${{secrets.KEYSTORE_STORE_PASSWORD}}
- name: Create Google Services Json file
run: |
echo "$GOOGLE_SERVICES" > google-services.b64
base64 -d -i google-services.b64 > app/google-services.json
env:
GOOGLE_SERVICES: ${{secrets.GOOGLE_SERVICES_JSON_FILE}}
# Cache gradle
- name: Cache Gradle and wrapper
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: cache-${{ runner.os }}-${{ matrix.jdk }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant Permission to Execute
run: chmod +x gradlew
- name: Build debug APK
run: bash ./gradlew :app:assembleDebug
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: App
path: ${{ github.workspace }}/app/build/outputs/apk/debug/app-debug.apk