ci: add version to tg msg (#75)

This commit is contained in:
Ylarod
2023-01-16 18:15:35 +08:00
committed by GitHub
parent bf3edfd0ef
commit b9dd673518
5 changed files with 10 additions and 0 deletions

View File

@@ -139,6 +139,7 @@ jobs:
TITLE: kernel-aarch64-${{ matrix.version }}
run: |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
export VERSION=$(git describe --tags --always)
OUTDIR=android-kernel/out/android12-5.10/dist
IMAGE_GZ=${{ matrix.version }}-Image.gz
BOOT=${{ matrix.version }}-boot.img.zip

View File

@@ -96,6 +96,7 @@ jobs:
TITLE: kernel-aarch64-${{ matrix.version }}
run: |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
export VERSION=$(git describe --tags --always)
OUTDIR=android-kernel/out/android13-5.15/dist
BOOT=${{ matrix.version }}-boot.img.zip
zip $BOOT -j -r $OUTDIR/boot.img

View File

@@ -84,6 +84,7 @@ jobs:
TITLE: Manager
run: |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
export VERSION=$(git describe --tags --always)
APK=$(find ./app/build/outputs/apk/release -name "*.apk")
pip3 install python-telegram-bot
python3 $GITHUB_WORKSPACE/scripts/ksubot.py $APK

View File

@@ -44,6 +44,7 @@ jobs:
TITLE: SU
run: |
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
export VERSION=$(git describe --tags --always)
pip3 install python-telegram-bot
mv ./userspace/su/libs/arm64-v8a/su su-arm64
mv ./userspace/su/libs/x86_64/su su-x86_64

View File

@@ -13,8 +13,10 @@ COMMIT_URL = os.environ.get("COMMIT_URL")
COMMIT_MESSAGE = os.environ.get("COMMIT_MESSAGE")
RUN_URL = os.environ.get("RUN_URL")
TITLE = os.environ.get("TITLE")
VERSION = os.environ.get("VERSION")
MSG_TEMPLATE = """
*{title}*
_{version}_
```
{commit_message}
```
@@ -26,6 +28,7 @@ MSG_TEMPLATE = """
def get_caption():
msg = MSG_TEMPLATE.format(
title=helpers.escape_markdown(TITLE, 2),
version=helpers.escape_markdown(VERSION, 2),
commit_message=helpers.escape_markdown(COMMIT_MESSAGE, 2, telegram.MessageEntity.PRE),
commit_url=helpers.escape_markdown(COMMIT_URL, 2, telegram.MessageEntity.TEXT_LINK),
run_url=helpers.escape_markdown(RUN_URL, 2, telegram.MessageEntity.TEXT_LINK)
@@ -57,6 +60,9 @@ def check_environ():
if TITLE is None:
print("[-] Invalid TITLE")
exit(1)
if VERSION is None:
print("[-] Invalid VERSION")
exit(1)
async def main():