-
Notifications
You must be signed in to change notification settings - Fork 35
78 lines (66 loc) · 2.02 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
on:
workflow_dispatch:
pull_request:
branches:
- 'master'
env:
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
ALIAS: ${{ secrets.ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
jobs:
build:
name: Build APK
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: oracle
cache: 'gradle'
- name: Checkout keystore repository
uses: actions/checkout@v4
with:
repository: ${{ secrets.KEYSTORE_GIT_REPOSITORY }}
token: ${{ secrets.KEYSTORE_ACCESS_TOKEN }}
path: app/keystore
- name: Build APK
run: bash ./gradlew assembleRelease --stacktrace --no-daemon
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: logfox-release
compression-level: 0
path: app/build/outputs/apk/release/app-release.apk
send:
name: Send APK
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Get the last commit message
id: get_commit_msg
run: |
commit_message=$(git log -1 --pretty=format:'%s')
echo "::set-output name=message::$commit_message"
- name: Download APK
uses: actions/download-artifact@v4
with:
name: logfox-release
- name: Send APK to Telegram
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
document: app-release.apk
disable_web_page_preview: true
message: |
*${{ github.actor }}* committed to *${{ github.repository }}*
Branch: *${{ github.head_ref }}*
Commit message: `${{ steps.get_commit_msg.outputs.message }}`