-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (85 loc) · 3.99 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Kernel Compiling CI
on:
push:
branches: [ "tm" ]
pull_request:
branches: [ "tm" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cloning
run: |
git clone https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9.git -b lineage-19.1 GCC --depth=1
git clone https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.9.git -b lineage-19.1 GCC32 --depth=1
git clone https://github.com/rokusenpaislab/anykernel.git AK_DIR --depth=1
git clone https://github.com/Nicklas373/aosp-clang.git -b r412851 CLANG_DIR --depth=1
git clone https://android.googlesource.com/platform/system/libufdt scripts/ufdt/libufdt --depth=1
- name: Compiling
run: |
DIR="${PWD}"
ARCH="arm64"
SUBARCH="arm64"
export ARCH SUBARCH
export CROSS_COMPILE=$DIR/GCC/bin/aarch64-linux-android-
export CROSS_COMPILE_ARM32=$DIR/GCC32/bin/arm-linux-androideabi-
export KBUILD_BUILD_USER=user
export KBUILD_BUILD_HOST=user
PATH=$DIR/CLANG_DIR/bin:$DIR/GCC32/bin:$DIR/GCC/bin:${PATH}
KERNEL_IMG=$DIR/out/arch/$ARCH/boot/Image.gz-dtb
KERNEL_DTBO=$DIR/out/arch/$ARCH/boot/dtbo.img
DEVICE="violet"
[[ ! -d out ]] && mkdir out
[[ -f "$KERNEL_IMG" ]] && rm "$KERNEL_IMG"
find . -name "*.dtb" -type f -delete
COMMIT=$(git log --pretty=format:"%s" -1)
COMMIT_SHA=$(git rev-parse --short HEAD)
KERNEL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
curl -s "https://api.telegram.org/bot${{secrets.BOT_TOKEN}}/sendMessage" \
-F parse_mode=markdown \
-F disable_web_page_preview=true \
-F text="
*Kernel Compiling Started !!*
Device: $DEVICE
Branch: $KERNEL_BRANCH
HEAD: $COMMIT_SHA: $COMMIT
" \
-F chat_id=${{secrets.TG_CHAT}} &> /dev/null
BUILD_START=$(date +"%s")
make O=out vendor/violet-perf_defconfig -j$(nproc --all)
make -j$(nproc --all) O=out \
CROSS_COMPILE=$CROSS_COMPILE \
CROSS_COMPILE_COMPACT=$CROSS_COMPILE_ARM32 \
CC=$DIR/CLANG_DIR/bin/clang \
CLANG_TRIPLE=aarch64-linux-gnu- Image.gz-dtb 2>&1 |& tee error.log
BUILD_END=$(date +"%s")
DIFF=$((BUILD_END - BUILD_START))
if ! [ -a "$KERNEL_IMG" ]; then
echo -e "\n> Build failed"
curl -F document=@"error.log" "https://api.telegram.org/bot${{secrets.BOT_TOKEN}}/sendDocument" \
-F caption="
*Kernel Compiling Failed !!*
Time Taken: $((DIFF / 60))m $((DIFF % 60))s
" \
-F chat_id=${{secrets.TG_CHAT}} \
-F parse_mode=markdown &> /dev/null
exit 1
fi
python3 $DIR/scripts/ufdt/libufdt/utils/src/mkdtboimg.py create $DIR/out/arch/arm64/boot/dtbo.img --page_size=4096 $DIR/out/arch/arm64/boot/dts/qcom/sm6150-idp-overlay.dtbo
echo -e "\n> Build successful! generating flashable zip..."
cd $DIR/AK_DIR || echo -e "\nAnykernel directory does not exist" || exit 1
git clean -fd
mv "$KERNEL_IMG" $DIR/AK_DIR/Image.gz-dtb
mv "$KERNEL_DTBO" $DIR/AK_DIR/dtbo.img
ZIP_NAME=Vertigo-v2.0stable-$DEVICE-$(date +%Y-%m-%d_%H%M).zip
zip -r9 "$ZIP_NAME" ./* -x .git README.md ./*placeholder
echo -e "\n> ZIP DONE.\n> File: $ZIP_NAME"
curl -F document=@"$ZIP_NAME" "https://api.telegram.org/bot${{ secrets.BOT_TOKEN }}/sendDocument" \
-F caption="
*Kernel Compiling Successful !!*
Time Taken: $((DIFF / 60))m $((DIFF % 60))s
" \
-F chat_id=${{secrets.TG_CHAT}} \
-F parse_mode=markdown &> /dev/null