From 2ab60750d497dbfa3592c84567faf619880bab10 Mon Sep 17 00:00:00 2001 From: Ylarod Date: Mon, 16 Jan 2023 19:18:42 +0800 Subject: [PATCH] ci: update msg (#76) --- .github/workflows/build-kernel-5.10.yml | 5 ++++- .github/workflows/build-kernel-5.15.yml | 5 ++++- .github/workflows/build-manager.yml | 2 +- .github/workflows/build-su.yml | 4 +++- scripts/ksubot.py | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-kernel-5.10.yml b/.github/workflows/build-kernel-5.10.yml index 98706b68..522b541e 100644 --- a/.github/workflows/build-kernel-5.10.yml +++ b/.github/workflows/build-kernel-5.10.yml @@ -41,6 +41,7 @@ jobs: - uses: actions/checkout@v3 with: path: KernelSU + fetch-depth: 0 - name: Setup kernel source run: | @@ -139,7 +140,9 @@ jobs: TITLE: kernel-aarch64-${{ matrix.version }} run: | if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then - export VERSION=$(git describe --tags --always) + cd $GITHUB_WORKSPACE/KernelSU + export VERSION=$(git rev-list --count HEAD) + cd - OUTDIR=android-kernel/out/android12-5.10/dist IMAGE_GZ=${{ matrix.version }}-Image.gz BOOT=${{ matrix.version }}-boot.img.zip diff --git a/.github/workflows/build-kernel-5.15.yml b/.github/workflows/build-kernel-5.15.yml index 814cb503..1edc9006 100644 --- a/.github/workflows/build-kernel-5.15.yml +++ b/.github/workflows/build-kernel-5.15.yml @@ -29,6 +29,7 @@ jobs: - uses: actions/checkout@v3 with: path: KernelSU + fetch-depth: 0 - name: Setup kernel source run: | @@ -96,7 +97,9 @@ jobs: TITLE: kernel-aarch64-${{ matrix.version }} run: | if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then - export VERSION=$(git describe --tags --always) + cd $GITHUB_WORKSPACE/KernelSU + export VERSION=$(git rev-list --count HEAD) + cd - OUTDIR=android-kernel/out/android13-5.15/dist BOOT=${{ matrix.version }}-boot.img.zip zip $BOOT -j -r $OUTDIR/boot.img diff --git a/.github/workflows/build-manager.yml b/.github/workflows/build-manager.yml index e7c5e94c..19ffbf6c 100644 --- a/.github/workflows/build-manager.yml +++ b/.github/workflows/build-manager.yml @@ -84,7 +84,7 @@ jobs: TITLE: Manager run: | if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then - export VERSION=$(git describe --tags --always) + export VERSION=$(git rev-list --count HEAD) APK=$(find ./app/build/outputs/apk/release -name "*.apk") pip3 install python-telegram-bot python3 $GITHUB_WORKSPACE/scripts/ksubot.py $APK diff --git a/.github/workflows/build-su.yml b/.github/workflows/build-su.yml index 68e1e3d9..409d48fe 100644 --- a/.github/workflows/build-su.yml +++ b/.github/workflows/build-su.yml @@ -16,6 +16,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - uses: nttld/setup-ndk@v1 with: ndk-version: r25b @@ -44,7 +46,7 @@ jobs: TITLE: SU run: | if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then - export VERSION=$(git describe --tags --always) + export VERSION=$(git rev-list --count HEAD) pip3 install python-telegram-bot mv ./userspace/su/libs/arm64-v8a/su su-arm64 mv ./userspace/su/libs/x86_64/su su-x86_64 diff --git a/scripts/ksubot.py b/scripts/ksubot.py index 90fbe8ce..c366abf5 100644 --- a/scripts/ksubot.py +++ b/scripts/ksubot.py @@ -16,7 +16,7 @@ TITLE = os.environ.get("TITLE") VERSION = os.environ.get("VERSION") MSG_TEMPLATE = """ *{title}* -_{version}_ +\#ci\_{version} ``` {commit_message} ```