-
-
Notifications
You must be signed in to change notification settings - Fork 29
64 lines (61 loc) · 3.29 KB
/
android-main.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 Main CI
on:
push:
branches:
- 'main'
- 'release/*'
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check_spotless:
name: Check spotless
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 11
- name: Check formatting using spotless
uses: gradle/[email protected]
with:
arguments: spotlessCheck
build:
name: Build debug
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 11
- name: Build with Gradle
uses: gradle/[email protected]
with:
arguments: assembledebug --stacktrace
env:
TZ: UTC
- name: Publish on Telegram
run: |
COMMIT_COUNT=$(git rev-list --count ${GITHUB_REF})
working_dir=$PWD
cd app/build/outputs/apk/fdroid/debug
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on app-fdroid-arm64-v8a-debug.7z app-fdroid-arm64-v8a-debug.apk
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on app-fdroid-armeabi-v7a-debug.7z app-fdroid-armeabi-v7a-debug.apk
cp app-fdroid-arm64-v8a-debug.7z amaze-utils-fdroid-arm64-v8a-v0.1-$(echo $COMMIT_COUNT).7z
cp app-fdroid-armeabi-v7a-debug.7z amaze-utils-fdroid-armeabi-v7a-v0.1-$(echo $COMMIT_COUNT).7z
echo $(curl -v -F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" --header "Content-Type: multipart/form-data" -F [email protected]$(echo $COMMIT_COUNT).7z https://api.telegram.org/${{ secrets.AMAZE_BOT_ID }}:${{ secrets.TELEGRAM_INTEGRATION_KEY }}/sendDocument)
echo $(curl -v -F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" --header "Content-Type: multipart/form-data" -F [email protected]$(echo $COMMIT_COUNT).7z https://api.telegram.org/${{ secrets.AMAZE_BOT_ID }}:${{ secrets.TELEGRAM_INTEGRATION_KEY }}/sendDocument)
cd $working_dir
cd app/build/outputs/apk/play/debug
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on app-play-arm64-v8a-debug.7z app-play-arm64-v8a-debug.apk
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on app-play-armeabi-v7a-debug.7z app-play-armeabi-v7a-debug.apk
cp app-play-arm64-v8a-debug.7z amaze-utils-play-arm64-v8a-v0.1-$(echo $COMMIT_COUNT).7z
cp app-play-armeabi-v7a-debug.7z amaze-utils-play-armeabi-v7a-v0.1-$(echo $COMMIT_COUNT).7z
echo $(curl -v -F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" --header "Content-Type: multipart/form-data" -F [email protected]$(echo $COMMIT_COUNT).7z https://api.telegram.org/${{ secrets.AMAZE_BOT_ID }}:${{ secrets.TELEGRAM_INTEGRATION_KEY }}/sendDocument)
echo $(curl -v -F "chat_id=${{ secrets.TELEGRAM_CHAT_ID }}" --header "Content-Type: multipart/form-data" -F [email protected]$(echo $COMMIT_COUNT).7z https://api.telegram.org/${{ secrets.AMAZE_BOT_ID }}:${{ secrets.TELEGRAM_INTEGRATION_KEY }}/sendDocument)