Check for Execution order

This commit is contained in:
XelXen 2022-06-18 20:34:35 +05:30 committed by GitHub
parent 0072ac1ede
commit cb8708d646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 4 deletions

12
.github/checkrun.py vendored Normal file
View File

@ -0,0 +1,12 @@
from json import load
from os import system
f = open('commit.json')
data = load(f)
f.close()
message = data['commit']['message']
if "\n\n" in message:
if message.split("\n\n",1)[-1].split()[0] == "[SILENT]":
system('killall -9 python')

6
.github/tg.py vendored
View File

@ -2,11 +2,11 @@ import telegram
from tgconfig import *
from json import load
import multiprocessing
import os
from os import system
from time import sleep as wait
def deploy():
os.system(f'~/bot-api --local --api-id={TG_API_ID} --api-hash={TG_API_HASH}')
system(f'~/bot-api --local --api-id={TG_API_ID} --api-hash={TG_API_HASH}')
def bot():
wait(10)
@ -22,7 +22,7 @@ def bot():
Signed-off-by: {data['commit']['author']['name']}
''', parse_mode=telegram.ParseMode.MARKDOWN)
bot.send_media_group(TG_POST_ID, [telegram.InputMediaDocument(open('app-x86-debug.apk', 'rb')), telegram.InputMediaDocument(open('app-x86_64-debug.apk', 'rb')), telegram.InputMediaDocument(open('app-armeabi-v7a-debug.apk', 'rb')), telegram.InputMediaDocument(open('app-arm64-v8a-debug.apk', 'rb'))])
os.system('killall -9 python || true')
system('killall -9 python')
if __name__ == '__main__':
multideploy = multiprocessing.Process(target=deploy)

View File

@ -26,10 +26,13 @@ jobs:
java-version: 11
distribution: "temurin"
cache: "gradle"
- name: Check for Execution Orders
run: |
cd .github
python checkrun.py
- name: Patch and Compile
run: |
cd .github
python patch.py
cd ..
./gradlew assembleDebug