scripts: setup ksunextbot

This commit is contained in:
Rifat Azad
2025-01-19 14:23:08 +06:00
parent 2c17a5f4f3
commit f60eed24e8
9 changed files with 57 additions and 23 deletions

View File

@@ -51,7 +51,7 @@ build_from_image() {
echo "[+] Images to upload"
find . -type f -name "*.gz"
# find . -type f -name "*.gz" -exec python3 "$GITHUB_WORKSPACE"/KernelSU-Next/scripts/ksubot.py {} +
# find . -type f -name "*.gz" -exec python3 "$GITHUB_WORKSPACE"/KernelSU-Next/scripts/ksunextbot.py {} +
}
for dir in Image*; do

View File

@@ -30,7 +30,7 @@ build_from_image() {
echo '[+] Images to upload'
find . -type f -name "*.gz"
# find . -type f -name "*.gz" -exec python3 "$GITHUB_WORKSPACE"/KernelSU-Next/scripts/ksubot.py {} +
# find . -type f -name "*.gz" -exec python3 "$GITHUB_WORKSPACE"/KernelSU-Next/scripts/ksunextbot.py {} +
}
for dir in Image*; do

View File

@@ -82,7 +82,7 @@ jobs:
uses: actions/cache@v4
if: false
with:
path: scripts/ksubot.session
path: scripts/ksunextbot.session
key: ${{ runner.os }}-bot-session
- name: Build boot images

View File

@@ -106,7 +106,7 @@ jobs:
uses: actions/cache@v4
if: false
with:
path: scripts/ksubot.session
path: scripts/ksunextbot.session
key: ${{ runner.os }}-bot-session
- name: Build boot images

View File

@@ -118,7 +118,7 @@ jobs:
uses: actions/cache@v4
if: false
with:
path: scripts/ksubot.session
path: scripts/ksunextbot.session
key: ${{ runner.os }}-bot-session
- name: Build boot images

View File

@@ -91,7 +91,7 @@ jobs:
uses: actions/cache@v4
if: false
with:
path: scripts/ksubot.session
path: scripts/ksunextbot.session
key: ${{ runner.os }}-bot-session
- name: Build boot images

View File

@@ -71,6 +71,15 @@ jobs:
with:
fetch-depth: 0
- name: Setup need_upload
id: need_upload
run: |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
echo "UPLOAD=true" >> $GITHUB_OUTPUT
else
echo "UPLOAD=false" >> $GITHUB_OUTPUT
fi
- name: Write key
run: |
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
@@ -150,3 +159,32 @@ jobs:
with:
name: "mappings"
path: "manager/app/build/outputs/mapping/release/"
- name: Bot session cache
if: steps.need_upload.outputs.UPLOAD == 'true'
id: bot_session_cache
uses: actions/cache@v4
with:
path: scripts/ksunextbot.session
key: ${{ runner.os }}-bot-session
- name: Upload to telegram
if: steps.need_upload.outputs.UPLOAD == 'true'
env:
API_ID: ${{ secrets.API_ID }}
API_HASH: ${{ secrets.API_HASH }}
CHAT_ID: ${{ secrets.CHAT_ID }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
COMMIT_URL: ${{ github.event.head_commit.url }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
TITLE: Nightly Manager (CI BUILD)
run: |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
export VERSION=$(git rev-list --count HEAD)
APK=$(find ./app/build/outputs/apk/release -name "*.apk")
pip3 install telethon
python3 $GITHUB_WORKSPACE/scripts/ksunextbot.py $APK
fi

View File

@@ -5,7 +5,7 @@ on:
paths:
- '.github/workflows/build-su.yml'
- 'userspace/su/**'
- 'scripts/ksubot.py'
- 'scripts/ksunextbot.py'
pull_request:
branches: [ "next" ]
paths: