forked from OnePlusOSS/android_kernel_oneplus_sm8150
-
Notifications
You must be signed in to change notification settings - Fork 20
212 lines (210 loc) · 8.68 KB
/
kernelsu-los21.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Build OnePlus-Sm8150-Kernel-LOS21
on:
workflow_dispatch:
schedule:
# Run once a week on Sunday at midnight. See http://crontab.guru
- cron: '0 21 * * *'
push:
branches:
- oneplus/LOS_SM8150_14.0
pull_request:
branches:
- oneplus/LOS_SM8150_14.0
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "2G"
CCACHE_HARDLINK: "true"
steps:
- 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/grm34/proton-clang -b ZenMaxBuilder clang --depth=1
git clone https://github.com/snowwolf725/AnyKernel3 -b oneplus7 --depth=1
rm -rf AnyKernel3/.git
- name: Checkout Android 10 kernel source
run: |
git clone --recurse-submodules https://github.com/snowwolf725/android_kernel_oneplus_sm8150 -b oneplus/OOS_SM8150_10.0 --depth=1 kernel
- name: Get Version
id: get_version
run: |
cd kernel/KernelSU
git pull
git rev-list --count HEAD
echo "VERSION=$(expr $(git rev-list --count HEAD) + 10200)" >> $GITHUB_OUTPUT
cd ../../
- name: Build Kernel
run: |
export KERNEL_DEFCONFIG="blu_spark_defconfig"
export KERNEL_CMDLINE="ARCH=arm64 CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi- LLVM=1 LLVM_IAS=1 O=out"
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
cd kernel
make $KERNEL_CMDLINE $KERNEL_DEFCONFIG
make $KERNEL_CMDLINE -j$(nproc --all)
cp out/arch/arm64/boot/Image ../AnyKernel3
cd ..
- name: Create AK3 zip for android 10
run: |
cd AnyKernel3
zip -r ../OP7-OOS10-kernel-SU-${{ steps.get_version.outputs.VERSION }}.zip *
cd ..
- name: Checkout Android 11 kernel source
run: |
rm -rf kernel
git clone --recurse-submodules https://github.com/snowwolf725/android_kernel_oneplus_sm8150 -b oneplus/OOS_SM8150_11.0 --depth=1 kernel
cd kernel/KernelSU
git pull
cd ../../
- name: Setup OOS 11
run: |
export KERNEL_DEFCONFIG="blu_spark_defconfig"
export 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"
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
cd kernel
make $KERNEL_CMDLINE CC="ccache clang-14" $KERNEL_DEFCONFIG
make $KERNEL_CMDLINE CC="ccache clang-14" -j$(nproc --all)
cp out/arch/arm64/boot/Image ../AnyKernel3
cd ..
- name: Create AK3 zip for android 11
run: |
cd AnyKernel3
zip -r ../OP7-OOS11-kernel-SU-${{ steps.get_version.outputs.VERSION }}.zip *
cd ..
- name: Checkout Android 12 kernel source
run: |
rm -rf kernel
git clone --recurse-submodules https://github.com/snowwolf725/android_kernel_oneplus_sm8150 -b oneplus/OOS_SM8150_12.0 --depth=1 kernel
cd kernel/KernelSU
git pull
cd ../../
- name: Setup OOS 12
run: |
export KERNEL_DEFCONFIG="vendor/sm8150-perf_defconfig"
export 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"
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
cd kernel
make $KERNEL_CMDLINE CC="ccache clang" $KERNEL_DEFCONFIG
make $KERNEL_CMDLINE CC="ccache clang" -j$(nproc --all)
cp out/arch/arm64/boot/Image ../AnyKernel3
cd ..
- name: Create AK3 zip for android 12
run: |
cd AnyKernel3
zip -r ../OP7-OOS12-kernel-SU-${{ steps.get_version.outputs.VERSION }}.zip *
cd ..
- name: Checkout Android 13 kernel source
run: |
rm -rf kernel
git clone --recurse-submodules https://github.com/snowwolf725/android_kernel_oneplus_sm8150 -b oneplus/LOS_SM8150_13.0 --depth=1 kernel
cd kernel/KernelSU
git pull
cd ../../
- name: Setup LOS 20
run: |
export KERNEL_DEFCONFIG="vendor/sm8150-perf_defconfig"
export 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 CONFIG_BUILD_ARM64_DT_OVERLAY=n O=out"
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
cd kernel
make $KERNEL_CMDLINE CC="ccache clang" $KERNEL_DEFCONFIG
make $KERNEL_CMDLINE CC="ccache clang" -j$(nproc --all)
cp out/arch/arm64/boot/Image ../AnyKernel3
cd ..
- name: Create AK3 zip for android 13
run: |
cd AnyKernel3
zip -r ../OP7-LOS20-kernel-SU-${{ steps.get_version.outputs.VERSION }}.zip *
cd ..
- name: Upload Kernel-SU 13
uses: actions/upload-artifact@v4
with:
name: OP7-LOS20-kernel-SU-${{ steps.get_version.outputs.VERSION }}
path: "AnyKernel3/*"
- name: Checkout Android 14 kernel source
run: |
rm -rf kernel
git clone --recurse-submodules https://github.com/snowwolf725/android_kernel_oneplus_sm8150 -b oneplus/LOS_SM8150_14.0 --depth=1 kernel
cd kernel/KernelSU
git pull
cd ../../
- name: Setup LOS 21
run: |
export KERNEL_DEFCONFIG="lineage_sm8150_defconfig"
export 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 CONFIG_BUILD_ARM64_DT_OVERLAY=n O=out"
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
cd kernel
git config --global user.email "[email protected]"
git config --global user.name "KernelSUBot"
git add -A && git commit -a -m "Add KernelSU"
make $KERNEL_CMDLINE CC="ccache clang" $KERNEL_DEFCONFIG
make $KERNEL_CMDLINE CC="ccache clang" -j$(nproc --all)
cp out/arch/arm64/boot/Image ../AnyKernel3
cd ..
- name: Create AK3 zip for android 14
run: |
cd AnyKernel3
zip -r ../OP7-LOS21-kernel-SU-${{ steps.get_version.outputs.VERSION }}.zip *
cd ..
- name: Upload Kernel-SU 14
uses: actions/upload-artifact@v4
with:
name: OP7-LOS21-kernel-SU-${{ steps.get_version.outputs.VERSION }}
path: "AnyKernel3/*"
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
files: |
OP7-OOS10-kernel-SU-${{ steps.get_version.outputs.VERSION }}.zip
OP7-OOS11-kernel-SU-${{ steps.get_version.outputs.VERSION }}.zip
OP7-OOS12-kernel-SU-${{ steps.get_version.outputs.VERSION }}.zip
OP7-LOS20-kernel-SU-${{ steps.get_version.outputs.VERSION }}.zip
OP7-LOS21-kernel-SU-${{ steps.get_version.outputs.VERSION }}.zip
name: OnePlus7_kernelsu-${{ steps.get_version.outputs.VERSION }}
tag_name: ${{ steps.get_version.outputs.VERSION }}
body: |
Device: Oneplus 7/Oneplus 7Pro/Oneplus 7T/Oneplus 7TPro
Target: OOS10, OOS11, OOS12, LOS20, LOS21
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}