-
-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (70 loc) · 2.26 KB
/
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
79
80
81
82
83
84
name: Android CI
on:
push:
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
jobs:
test:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cache gradle
- name: Cache Gradle and wrapper
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: cache-${{ runner.os }}-${{ matrix.jdk }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Run Unit tests
run: bash ./gradlew test --stacktrace
apk:
name: Generate APK
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Java JDK
uses: actions/[email protected]
with:
java-version: 11
distribution: 'temurin'
- name: Grant Permission to Execute
run: chmod +x gradlew
- name: Build debug APK
run: bash ./gradlew assembleDebug --stacktrace
- name: Upload APK to Github Artifacts
uses: actions/[email protected]
with:
name: app
path: app/build/outputs/apk/debug/app-debug.apk
send-apk-on-telegram:
name: Send Apk on Telegram
needs: apk
runs-on: ubuntu-latest
steps:
- name: Download Stored Artifact
uses: actions/download-artifact@v3
with:
name: app
- name: send telegram message on push
uses: appleboy/telegram-action@master
with:
to: "-1001863916163"
token: "5915457647:AAGjdQ2IfM6SWg_iKYgIXuRVsEjA-WIJOBs"
message: |
Hi Guys,
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
Created By @JahidHasanCo
document: app-debug.apk
photo: https://media.giphy.com/media/A6aHBCFqlE0Rq/giphy.gif