mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 05:40:31 +05:30
Enable SHA Checking
This commit is contained in:
parent
08a546c0b5
commit
df133f0a36
1
.github/checkrun.py
vendored
1
.github/checkrun.py
vendored
@ -14,4 +14,3 @@ if "\n\n" in message:
|
||||
print("Silence not found")
|
||||
else:
|
||||
print("Empty Description")
|
||||
|
||||
|
39
.github/pkg.py
vendored
39
.github/pkg.py
vendored
@ -1,29 +1,24 @@
|
||||
import os
|
||||
from json import load
|
||||
|
||||
data = load(open('commit.json'))
|
||||
while True:
|
||||
os.system("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-x86-debug.apk --output app-x86-debug.apk")
|
||||
outputStr = open("app-x86-debug.apk","r").read()
|
||||
if "Not Found" not in outputStr:
|
||||
print("Build [x86] Downloaded")
|
||||
os.system('curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/sign.txt --output sign.txt')
|
||||
f = open('sign.txt')
|
||||
if f == data['sha'][0:7]:
|
||||
break
|
||||
|
||||
while True:
|
||||
os.system("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-x86_64-debug.apk --output app-x86_64-debug.apk")
|
||||
outputStr = open("app-x86_64-debug.apk","r").read()
|
||||
if "Not Found" not in outputStr:
|
||||
print("Build [x86_64] Downloaded")
|
||||
break
|
||||
os.system("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-x86-debug.apk --output app-x86-debug.apk")
|
||||
print("Build [x86] Downloaded")
|
||||
|
||||
while True:
|
||||
os.system("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-armeabi-v7a-debug.apk --output app-armeabi-v7a-debug.apk")
|
||||
outputStr = open("app-armeabi-v7a-debug.apk","r").read()
|
||||
if "Not Found" not in outputStr:
|
||||
print("Build [arm7] Downloaded")
|
||||
break
|
||||
os.system("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-x86_64-debug.apk --output app-x86_64-debug.apk")
|
||||
print("Build [x86_64] Downloaded")
|
||||
|
||||
while True:
|
||||
os.system("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-armeabi-v8a-debug.apk --output app-armeabi-v8a-debug.apk")
|
||||
outputStr = open("app-armeabi-v8a-debug.apk","r").read()
|
||||
if "Not Found" not in outputStr:
|
||||
print("Build [arm8] Downloaded")
|
||||
break
|
||||
os.system("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-armeabi-v7a-debug.apk --output app-armeabi-v7a-debug.apk")
|
||||
print("Build [arm7] Downloaded")
|
||||
|
||||
os.system("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-armeabi-v8a-debug.apk --output app-armeabi-v8a-debug.apk")
|
||||
print("Build [arm8] Downloaded")
|
||||
|
||||
os.system("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-universal-debug.apk --output app-armeabi-v8a-debug.apk")
|
||||
print("Build [universal] Downloaded")
|
4
.github/sign.py
vendored
Normal file
4
.github/sign.py
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
from json import load
|
||||
|
||||
f = open('sign.txt', "w")
|
||||
f.write(data['sha'][0:7])
|
4
.github/tg.py
vendored
4
.github/tg.py
vendored
@ -6,7 +6,7 @@ from os import system
|
||||
from time import sleep as wait
|
||||
|
||||
def deploy():
|
||||
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)
|
||||
@ -21,7 +21,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'))])
|
||||
bot.send_media_group(TG_POST_ID, [telegram.InputMediaDocument(open('app-x86-debug.apk', 'rb')), telegram.InputMediaDocument(open('app-universal-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'))])
|
||||
system('killall -9 python')
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -25,8 +25,10 @@ jobs:
|
||||
- name: Check for Execution Orders
|
||||
run: |
|
||||
cd .github
|
||||
touch sign.txt
|
||||
curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} > commit.json
|
||||
python checkrun.py
|
||||
python sign.py
|
||||
cd ..
|
||||
|
||||
- name: Set up JDK 11
|
||||
@ -53,8 +55,9 @@ jobs:
|
||||
- name: Upload to Archive
|
||||
run: |
|
||||
git clone https://github.com/LibreTubeAlpha/Archive archive
|
||||
rm -rf archive/*.apk
|
||||
rm -rf archive/*.apk archive/sign.txt
|
||||
mv app/build/outputs/apk/debug/*.apk archive/
|
||||
mv .github/sign.txt archive/
|
||||
cd archive
|
||||
git add -f *
|
||||
git commit -m "WORKFLOW: ALPHA BUILDS"
|
||||
|
10
.github/workflows/tg-bot.yml
vendored
10
.github/workflows/tg-bot.yml
vendored
@ -22,22 +22,24 @@ jobs:
|
||||
- name: Check for Execution Orders
|
||||
run: |
|
||||
cd .github
|
||||
mv checkrun.py ~
|
||||
cd ~
|
||||
curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} > commit.json
|
||||
python checkrun.py
|
||||
cd ..
|
||||
|
||||
- name: Download packages
|
||||
run: |
|
||||
cd ~
|
||||
mv .github/pkg.py .
|
||||
cd .github
|
||||
python pkg.py
|
||||
cd ..
|
||||
|
||||
- name: Telegram Bot
|
||||
continue-on-error: true
|
||||
run: |
|
||||
cd ~
|
||||
cd .github
|
||||
curl https://libre-tube.github.io/images/LibreAlpha.png --output alpha.png
|
||||
curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/exec --output ~/bot-api
|
||||
curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/exec --output bot-api
|
||||
chmod 755 ./bot-api
|
||||
echo "TG_TOKEN = '${{ secrets.TG_TOKEN }}'" > tgconfig.py
|
||||
echo "TG_API_ID = '${{ secrets.TG_API_ID }}'" >> tgconfig.py
|
||||
|
Loading…
Reference in New Issue
Block a user