-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (53 loc) · 1.72 KB
/
android_cd.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
name: Android CD
on:
push:
branches:
- release
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
environment: Android CI/CD
steps:
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Access BASE_URL
env:
GNR_BASE_URL: ${{ secrets.GNR_BASE_URL }}
run: echo GNR_BASE_URL=\"$GNR_BASE_URL\" > ./local.properties
- name: Generate Debug Keystore file from Github Secrets
run: |
mkdir ./app/keystore
echo "$KEYSTORE" > ./app/keystore/debug_keystore.b64
base64 -d -i ./app/keystore/debug_keystore.b64 > ./app/keystore/debug.keystore
env:
KEYSTORE: ${{ secrets.DEBUG_KEYSTORE_BASE64 }}
- name: Build with Gradle
run: ./gradlew assembleDebug
- name: Send APK to Slack
uses: MeilCli/slack-upload-file@v1
with:
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
file_path: ./app/build/outputs/apk/debug/app-debug.apk
channels: release-android
file_name: debug_apk.apk
file_type: apk
initial_comment: ${{ github.event.head_commit.message }}