forked from SOVIET-ANDROID/kernel_xiaomi_raphael
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (84 loc) · 4.09 KB
/
Copy pathbuild_ci.yml
File metadata and controls
95 lines (84 loc) · 4.09 KB
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
87
88
89
90
91
92
93
94
95
name: Build Kernel
on:
repository_dispatch:
workflow_dispatch:
push:
branches:
- "13.0"
env:
CheckOut_DIR: /home/runner/work/kernel_xiaomi_raphael/kernel_xiaomi_raphael
AnyKernel: /home/runner/work/kernel_xiaomi_raphael/AnyKernel
jobs:
KSUForRaphael:
runs-on: ubuntu-latest
steps:
- name: Installing Dependencies
run: |
sudo apt update -y
sudo apt-get install -y zip flex bison libncurses-dev gawk libiberty-dev autoconf kmod bc build-essential gcc libc6 curl libstdc++6 git wget libssl-dev cpio p7zip-full ccache
sudo apt clean
- name: Cloning Sources and Toolchain
run: |
git clone https://gitlab.com/crdroidandroid/android_prebuilts_clang_host_linux-x86_clang-r445002 --depth=1 --single-branch --no-tags -b 12.0 ~/clang
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 -b android-10.0.0_r47 --depth=1 --single-branch --no-tags ~/aarch64-linux-android-4.9
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9 -b android-10.0.0_r47 --depth=1 --single-branch --no-tags ~/arm-linux-androideabi-4.9
git clone https://github.com/onettboots/boolx_anykernel.git ${{ env.AnyKernel }}
- name: CheckOut Kernel Tree
uses: actions/checkout@v3.5.2
with:
ref: "13.0"
- name: Checkout Commit Info
run: |
useVersionInfo=$(git show -s --date=short --format="提交人: %an<br/>提交时间: %cd<br/>提交内容: %s<br/>commit hash: %H")
echo "useVersionInfo=$useVersionInfo" >> $GITHUB_ENV
echo "DATE=$(date "+%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
echo "DATE1=$(date "+%Y-%m-%d")" >> $GITHUB_ENV
- name: Remove Old KernelSU Files
run: |
rm -rf drivers/staging/kernelsu && rm -rf .git/module/*
- name: Integrate KernelSU
run:
curl -LSs "https://raw.githubusercontent.com/SoDebug/KernelSU/SOVIET-ANDROID_dev/kernel/setup.sh" | bash -s v0.5.x_dev_SOVIET-ANDROID
- name: Compiling Kernel
run: |
CLANG=~/clang/bin
GCC32=~/arm-linux-androideabi-4.9/bin
GCC64=~/aarch64-linux-android-4.9/bin
PATH=$CLANG:$GCC64:$GCC32:$PATH
export PATH
export ARCH=arm64
export CLANG_TRIPLE=aarch64-linux-gnu
export CROSS_COMPILE=aarch64-linux-android-
export CROSS_COMPILE_ARM32=arm-linux-androideabi-
output_dir=out
make LLVM=1 LLVM_IAS=1 CC="ccache clang" raphael_defconfig
make LLVM=1 LLVM_IAS=1 CC="ccache clang" -j$(grep -c ^processor /proc/cpuinfo)
- name: Packaging the Kernel
run: |
cp -v ${{ env.CheckOut_DIR }}/out/arch/arm64/boot/Image.gz-dtb ${{ env.AnyKernel }} &&
cp -v ${{ env.CheckOut_DIR }}/out/arch/arm64/boot/dtbo.img ${{ env.AnyKernel }}/o &&
cd ${{ env.AnyKernel }} &&
7z a -mx9 Raphael-Kernel_KSU_Manully_SA13.zip *
- name: Generate release tag
id: tag
run: |
echo "release_tag=$(date +"%Y%m%d")" >> $GITHUB_OUTPUT
touch release.txt
echo "SoDebug Kernel Config:" >> release.txt
echo "机型代号:raphael" >> release.txt
echo "机型名称:Redmi K20 Pro | Mi 9T Pro" >> release.txt
echo "内核源码:https://github.com/SOVIET-ANDROID/kernel_xiaomi_raphael.git" >> release.txt
echo "内核源码分支:13.0" >> release.txt
echo "源码最近提交信息:" >> release.txt
echo "${{ env.useVersionInfo }}" >> release.txt
echo "status=success" >> $GITHUB_OUTPUT
- name: Upload firmware to release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
name: ${{ env.DATE }} Kernel for Raphael
body_path: release.txt
files: |
${{env.AnyKernel }}/Raphael-Kernel_KSU_Manully_SA13.zip