forked from tpatel27/android_kernel_samsung_gto
-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (77 loc) · 2.75 KB
/
kernelsu_build.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
name: Build Kernel
on:
workflow_dispatch:
schedule:
# Run once a week on Sunday at midnight. See http://crontab.guru
- cron: '0 21 * * *'
push:
branches:
- Nethunter
pull_request:
branches:
- Nethunter
jobs:
build:
runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "2G"
CCACHE_HARDLINK: "true"
KERNEL_DEFCONFIG: "SMT295A10_defconfig"
KERNEL_CMDLINE: "ARCH=arm64 CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=aarch64-linux-androidkernel- CROSS_COMPILE_ARM32=arm-linux-gnueabi- LLVM=1 LLVM_IAS=1 O=out"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 1
- name: Set up ccache
uses: hendrikmuhs/[email protected]
- name: Remove unnecessary files
run: |
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt install gcc-aarch64-linux-gnu -y
sudo apt install gcc-arm-linux-gnueabi -y
sudo apt install clang-14 -y
sudo apt install binutils make python3 libssl-dev build-essential bc bison flex unzip libssl-dev ca-certificates xz-utils mkbootimg cpio device-tree-compiler git git-lfs -y
git clone https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9 aarch64 --depth=1
git clone https://github.com/snowwolf725/AnyKernel3 -b oneplus7 --depth=1
rm -rf AnyKernel3/.git
- name: Remove unnecessary files
run: |
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Get Version
id: get_version
run: |
cd KernelSU
git fetch --unshallow
git pull
git rev-list --count HEAD
echo "VERSION=$(expr $(git rev-list --count HEAD) + 10200)" >> $GITHUB_OUTPUT
cd ..
- name: Build Kernel
run: |
export PATH=$(pwd)/clang/bin/:$(pwd)/aarch64/bin/:$PATH
export ARCH=arm64
export SUBARCH=arm64
export LD=ld.lld
export BRAND_SHOW_FLAG=oneplus
export TARGET_PRODUCT=msmnile
make $KERNEL_CMDLINE $KERNEL_DEFCONFIG CC="ccache clang-14"
make $KERNEL_CMDLINE CC="ccache clang-14" -j$(nproc --all)
cp out/arch/arm64/boot/Image AnyKernel3
- name: Upload Kernel-SU
uses: actions/upload-artifact@v4
with:
name: OP7-OOS11-kernel-SU-${{ steps.get_version.outputs.VERSION }}
path: "AnyKernel3/*"