mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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>
This commit is contained in:
parent
87051cfa9e
commit
255497bc8d
51
.github/workflows/build-kernel.yml
vendored
51
.github/workflows/build-kernel.yml
vendored
@ -16,34 +16,49 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
timezoneLinux: "America/Sao_Paulo"
|
timezoneLinux: "America/Sao_Paulo"
|
||||||
|
|
||||||
- name: Run build script
|
- name: Run standard build script
|
||||||
run: |
|
run: |
|
||||||
export KBUILD_BUILD_USER=nobody
|
export KBUILD_BUILD_USER=nobody
|
||||||
export KBUILD_BUILD_HOST=android-build
|
export KBUILD_BUILD_HOST=android-build
|
||||||
source build.sh
|
source build.sh
|
||||||
echo "ZIPNAME=${ZIPNAME}" >> $GITHUB_ENV
|
echo "ZIPNAME=${ZIPNAME}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup build date
|
- name: Run KSU build script
|
||||||
run: echo "BUILD_DATE=$(date '+%H:%M %d/%m/%Y')" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Git variables
|
|
||||||
run: |
|
run: |
|
||||||
HEAD="$(git rev-parse HEAD)"
|
export KBUILD_BUILD_USER=nobody
|
||||||
HEAD_COMMIT="https://github.com/rd-stuffs/msm-4.14/commit/$HEAD"
|
export KBUILD_BUILD_HOST=android-build
|
||||||
echo "HEAD_COMMIT=${HEAD_COMMIT}" >> $GITHUB_ENV
|
source build.sh --su
|
||||||
|
echo "ZIPNAME_KSU=${ZIPNAME}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Upload build artifact
|
- name: Upload standard artifact
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
with:
|
with:
|
||||||
|
name: standard-artifact
|
||||||
path: ${{ env.ZIPNAME }}
|
path: ${{ env.ZIPNAME }}
|
||||||
|
|
||||||
- name: Upload to Telegram
|
- name: Upload KSU artifact
|
||||||
uses: appleboy/telegram-action@master
|
uses: actions/upload-artifact@main
|
||||||
with:
|
with:
|
||||||
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
name: KSU-artifact
|
||||||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
path: ${{ env.ZIPNAME_KSU }}
|
||||||
document: ${{ env.ZIPNAME }}
|
|
||||||
message: |
|
- name: Create Telegram caption
|
||||||
${{ env.BUILD_DATE }}
|
run: |
|
||||||
|
BUILD_DATE="$(date '+%H:%M %d/%m/%Y')"
|
||||||
${{ env.HEAD_COMMIT }}
|
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 }}"
|
||||||
|
36
.github/workflows/build-ksu.yml
vendored
36
.github/workflows/build-ksu.yml
vendored
@ -1,36 +0,0 @@
|
|||||||
name: Build KSU
|
|
||||||
|
|
||||||
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 build script
|
|
||||||
run: |
|
|
||||||
export KBUILD_BUILD_USER=nobody
|
|
||||||
export KBUILD_BUILD_HOST=android-build
|
|
||||||
source build.sh --su
|
|
||||||
echo "ZIPNAME=${ZIPNAME}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Upload build artifact
|
|
||||||
uses: actions/upload-artifact@main
|
|
||||||
with:
|
|
||||||
path: ${{ env.ZIPNAME }}
|
|
||||||
|
|
||||||
- name: Upload to Telegram
|
|
||||||
uses: appleboy/telegram-action@master
|
|
||||||
with:
|
|
||||||
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
|
||||||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
|
||||||
document: ${{ env.ZIPNAME }}
|
|
Loading…
x
Reference in New Issue
Block a user