Centralise Builders

This commit is contained in:
XelXen 2022-09-18 14:28:54 +05:30 committed by GitHub
parent e9052b0b2d
commit 99d2fc0a36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 88 deletions

2
.github/checkrun.py vendored
View File

@ -5,7 +5,7 @@ f = open('commit.json')
data = load(f)
f.close()
message = data['commit']['message']
data = data['commit']['message']
if "\n\n" in message:
if message.split("\n\n",1)[-1].split()[0] == "[SILENT]":

29
.github/pkg.py vendored
View File

@ -1,29 +0,0 @@
import os
from json import load
import time
data = load(open('commit.json'))
while True:
os.system('curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/sign.txt --output sign.txt')
f = open('sign.txt')
print(f)
print(data['sha'][0:7])
if f == data['sha'][0:7]:
break
else:
time.sleep(10)
os.system("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-x86-debug.apk --output app-x86-debug.apk")
print("Build [x86] Downloaded")
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")
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")

5
.github/sign.py vendored
View File

@ -1,5 +0,0 @@
from json import load
data = load(open("commit.json"))
f = open('sign.txt', "w")
f.write(data['sha'][0:7])

View File

@ -21,14 +21,16 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-python@v3
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- 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,16 +55,30 @@ jobs:
./gradlew assembleDebug
- name: Upload to Archive
continue-on-error: true
run: |
git clone https://github.com/LibreTubeAlpha/Archive archive
rm -rf archive/*.apk archive/sign.txt
rm -rf archive/*.apk
mv app/build/outputs/apk/debug/*.apk archive/
mv .github/sign.txt archive/
cd archive
git add -f *
git commit -m "WORKFLOW: ALPHA BUILDS"
git push -u
cd ..
- name: Telegram Bot
continue-on-error: true
run: |
cd archive
curl https://libre-tube.github.io/images/LibreAlpha.png --output alpha.png
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
echo "TG_POST_ID = '${{ secrets.TG_POST_ID }}'" >> tgconfig.py
echo "TG_API_HASH = '${{ secrets.TG_API_HASH }}'" >> tgconfig.py
python -m pip install --upgrade pip
pip install python-telegram-bot
python tg.py
- name: Upload APK
uses: actions/upload-artifact@v3

View File

@ -1,48 +0,0 @@
name: Telegram Bot
on:
workflow_dispatch:
push:
paths-ignore:
- "README*.md"
- "fastlane/**"
- "assets/**"
- ".github/**/*.md"
jobs:
debug-builds:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Check for Execution Orders
run: |
cd .github
curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} > commit.json
python checkrun.py
cd ..
- name: Download packages
run: |
cd .github
python pkg.py
cd ..
- name: Telegram Bot
continue-on-error: true
run: |
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
chmod 755 ./bot-api
echo "TG_TOKEN = '${{ secrets.TG_TOKEN }}'" > tgconfig.py
echo "TG_API_ID = '${{ secrets.TG_API_ID }}'" >> tgconfig.py
echo "TG_POST_ID = '${{ secrets.TG_POST_ID }}'" >> tgconfig.py
echo "TG_API_HASH = '${{ secrets.TG_API_HASH }}'" >> tgconfig.py
python -m pip install --upgrade pip
pip install python-telegram-bot
python tg.py