ci: add version to tg msg (#75)
This commit is contained in:
1
.github/workflows/build-kernel-5.10.yml
vendored
1
.github/workflows/build-kernel-5.10.yml
vendored
@@ -139,6 +139,7 @@ jobs:
|
|||||||
TITLE: kernel-aarch64-${{ matrix.version }}
|
TITLE: kernel-aarch64-${{ matrix.version }}
|
||||||
run: |
|
run: |
|
||||||
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
||||||
|
export VERSION=$(git describe --tags --always)
|
||||||
OUTDIR=android-kernel/out/android12-5.10/dist
|
OUTDIR=android-kernel/out/android12-5.10/dist
|
||||||
IMAGE_GZ=${{ matrix.version }}-Image.gz
|
IMAGE_GZ=${{ matrix.version }}-Image.gz
|
||||||
BOOT=${{ matrix.version }}-boot.img.zip
|
BOOT=${{ matrix.version }}-boot.img.zip
|
||||||
|
|||||||
1
.github/workflows/build-kernel-5.15.yml
vendored
1
.github/workflows/build-kernel-5.15.yml
vendored
@@ -96,6 +96,7 @@ jobs:
|
|||||||
TITLE: kernel-aarch64-${{ matrix.version }}
|
TITLE: kernel-aarch64-${{ matrix.version }}
|
||||||
run: |
|
run: |
|
||||||
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
||||||
|
export VERSION=$(git describe --tags --always)
|
||||||
OUTDIR=android-kernel/out/android13-5.15/dist
|
OUTDIR=android-kernel/out/android13-5.15/dist
|
||||||
BOOT=${{ matrix.version }}-boot.img.zip
|
BOOT=${{ matrix.version }}-boot.img.zip
|
||||||
zip $BOOT -j -r $OUTDIR/boot.img
|
zip $BOOT -j -r $OUTDIR/boot.img
|
||||||
|
|||||||
1
.github/workflows/build-manager.yml
vendored
1
.github/workflows/build-manager.yml
vendored
@@ -84,6 +84,7 @@ jobs:
|
|||||||
TITLE: Manager
|
TITLE: Manager
|
||||||
run: |
|
run: |
|
||||||
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
||||||
|
export VERSION=$(git describe --tags --always)
|
||||||
APK=$(find ./app/build/outputs/apk/release -name "*.apk")
|
APK=$(find ./app/build/outputs/apk/release -name "*.apk")
|
||||||
pip3 install python-telegram-bot
|
pip3 install python-telegram-bot
|
||||||
python3 $GITHUB_WORKSPACE/scripts/ksubot.py $APK
|
python3 $GITHUB_WORKSPACE/scripts/ksubot.py $APK
|
||||||
|
|||||||
1
.github/workflows/build-su.yml
vendored
1
.github/workflows/build-su.yml
vendored
@@ -44,6 +44,7 @@ jobs:
|
|||||||
TITLE: SU
|
TITLE: SU
|
||||||
run: |
|
run: |
|
||||||
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
||||||
|
export VERSION=$(git describe --tags --always)
|
||||||
pip3 install python-telegram-bot
|
pip3 install python-telegram-bot
|
||||||
mv ./userspace/su/libs/arm64-v8a/su su-arm64
|
mv ./userspace/su/libs/arm64-v8a/su su-arm64
|
||||||
mv ./userspace/su/libs/x86_64/su su-x86_64
|
mv ./userspace/su/libs/x86_64/su su-x86_64
|
||||||
|
|||||||
@@ -13,8 +13,10 @@ COMMIT_URL = os.environ.get("COMMIT_URL")
|
|||||||
COMMIT_MESSAGE = os.environ.get("COMMIT_MESSAGE")
|
COMMIT_MESSAGE = os.environ.get("COMMIT_MESSAGE")
|
||||||
RUN_URL = os.environ.get("RUN_URL")
|
RUN_URL = os.environ.get("RUN_URL")
|
||||||
TITLE = os.environ.get("TITLE")
|
TITLE = os.environ.get("TITLE")
|
||||||
|
VERSION = os.environ.get("VERSION")
|
||||||
MSG_TEMPLATE = """
|
MSG_TEMPLATE = """
|
||||||
*{title}*
|
*{title}*
|
||||||
|
_{version}_
|
||||||
```
|
```
|
||||||
{commit_message}
|
{commit_message}
|
||||||
```
|
```
|
||||||
@@ -26,6 +28,7 @@ MSG_TEMPLATE = """
|
|||||||
def get_caption():
|
def get_caption():
|
||||||
msg = MSG_TEMPLATE.format(
|
msg = MSG_TEMPLATE.format(
|
||||||
title=helpers.escape_markdown(TITLE, 2),
|
title=helpers.escape_markdown(TITLE, 2),
|
||||||
|
version=helpers.escape_markdown(VERSION, 2),
|
||||||
commit_message=helpers.escape_markdown(COMMIT_MESSAGE, 2, telegram.MessageEntity.PRE),
|
commit_message=helpers.escape_markdown(COMMIT_MESSAGE, 2, telegram.MessageEntity.PRE),
|
||||||
commit_url=helpers.escape_markdown(COMMIT_URL, 2, telegram.MessageEntity.TEXT_LINK),
|
commit_url=helpers.escape_markdown(COMMIT_URL, 2, telegram.MessageEntity.TEXT_LINK),
|
||||||
run_url=helpers.escape_markdown(RUN_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:
|
if TITLE is None:
|
||||||
print("[-] Invalid TITLE")
|
print("[-] Invalid TITLE")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
if VERSION is None:
|
||||||
|
print("[-] Invalid VERSION")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
|
|||||||
Reference in New Issue
Block a user