msm-4.14/.github/workflows/build-kernel.yml
Richard Raya 255497bc8d workflows: Improvements
Merge KSU workflow into main script.
Directly use the Telegram API for posting builds.

Change-Id: Iae193d8b38f6a8d1a103708a8ca9570259c80c64
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-12 19:50:09 -03:00

65 lines
1.9 KiB
YAML

name: Build Kernel
on:
push:
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup timezone
uses: szenius/set-timezone@master
with:
timezoneLinux: "America/Sao_Paulo"
- name: Run standard build script
run: |
export KBUILD_BUILD_USER=nobody
export KBUILD_BUILD_HOST=android-build
source build.sh
echo "ZIPNAME=${ZIPNAME}" >> $GITHUB_ENV
- name: Run KSU build script
run: |
export KBUILD_BUILD_USER=nobody
export KBUILD_BUILD_HOST=android-build
source build.sh --su
echo "ZIPNAME_KSU=${ZIPNAME}" >> $GITHUB_ENV
- name: Upload standard artifact
uses: actions/upload-artifact@main
with:
name: standard-artifact
path: ${{ env.ZIPNAME }}
- name: Upload KSU artifact
uses: actions/upload-artifact@main
with:
name: KSU-artifact
path: ${{ env.ZIPNAME_KSU }}
- name: Create Telegram caption
run: |
BUILD_DATE="$(date '+%H:%M %d/%m/%Y')"
HEAD="$(git rev-parse HEAD)"
HEAD_COMMIT="https://github.com/rd-stuffs/msm-4.14/commit/$HEAD"
echo -e "${BUILD_DATE}\n\n${HEAD_COMMIT}" > caption.txt
- name: Upload standard build to Telegram
run: |
caption=$(<caption.txt)
curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument" \
-F chat_id=${{ secrets.TELEGRAM_CHAT_ID }} \
-F document=@"${{ env.ZIPNAME }}" \
-F caption="${caption}"
- name: Upload KSU build to Telegram
run: |
curl -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument" \
-F chat_id=${{ secrets.TELEGRAM_CHAT_ID }} \
-F document=@"${{ env.ZIPNAME_KSU }}"