-
-
Notifications
You must be signed in to change notification settings - Fork 21
75 lines (64 loc) · 2.27 KB
/
gradle.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
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Gradle CI
on:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize]
jobs:
gradle-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up JAVA
uses: actions/[email protected]
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
cache: 'gradle'
check-latest: true
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle packages
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Test
run: ./gradlew test
- name: Assemble
run: ./gradlew assembleDebug -Dec_accessToken="${{ secrets.EC_TOKEN }}" -Dmetrica_api="${{ secrets.METRICA_API }}"
- name: Cleanup Gradle Cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: Get APK
uses: actions/[email protected]
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
- name: Get wearos APK
uses: actions/[email protected]
with:
name: wearos-debug
path: wearos/build/outputs/apk/debug/wearos-debug.apk
- name: Send apk to telegram
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
if: github.event_name == 'pull_request' && env.TELEGRAM_TOKEN != ''
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: env.TELEGRAM_TOKEN
message: |
${{ github.event.pull_request.title }}
${{ github.base_ref }} <= ${{ github.head_ref }}
PR: https://github.com/Wheellog/Wheellog.Android/pull/${{github.event.number}}
document: app/build/outputs/apk/debug/app-debug.apk