-
Notifications
You must be signed in to change notification settings - Fork 84
141 lines (116 loc) · 4.69 KB
/
build_kernel.yml
File metadata and controls
141 lines (116 loc) · 4.69 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
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
name: KernelSU Builder
on:
push:
workflow_dispatch:
repository_dispatch:
types: [trigger-KernelSU-build]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: ["LineageOS-20", "Zenitsu", "DivestOS-13", "Sage-Android-14"]
env:
VERSION: ${{ matrix.version }}
ARCH: arm64
KBUILD_BUILD_HOST: Github-Action
KBUILD_BUILD_USER: "KernelSU_Builder"
CLANG_PATH: ${{ github.workspace }}/kernel/clang/bin
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y python3-pip jq libarchive-tools zip lib32z-dev libghc-bzlib-dev pngcrush ^liblzma.* python-is-python3 libsdl1.2-dev autoconf libxml2-utils wget pkg-config unzip w3m gawk imagemagick libc6-dev gcc-multilib patchelf gzip clang subversion optipng device-tree-compiler ccache gcc ^liblz4-.* lzip rsync automake fastboot python2.7 patch zip pngquant expat lzop libswitch-perl make libcap-dev python2 adb libxml2 bison libxml-simple-perl zlib1g-dev libarchive-tools libtool squashfs-tools gperf ^lzma.* libfl-dev ncurses-dev pwgen flex libtinfo5 minicom liblz4-tool libmpfr-dev libssl-dev lib32ncurses5-dev libbz2-dev lib32z1-dev libgmp-dev git libncurses5-dev dpkg-dev libmpc-dev lftp python2-dev python3 rar git-lfs policycoreutils unrar libncurses5 libbz2-1.0 ncftp tree python-all-dev bzip2 bc ftp software-properties-common tar libgl1-mesa-dev texinfo schedtool curl libexpat1-dev llvm libc6-dev-i386 apt-utils cmake g++-multilib build-essential re2c axel maven xsltproc g++ libx11-dev libxml-sax-base-perl gnupg bash
sudo pip3 install yq
- name: Set up ccache
run: |
echo "/usr/lib/ccache" >> $GITHUB_PATH
echo "USE_CCACHE=1" >> $GITHUB_ENV
- name: Cache ccache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ runner.os }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ccache-
- name: Clone clang and kernel sources
run: |
chmod +x clone.sh
./clone.sh
- name: Add Clang to PATH
run: |
echo "${CLANG_PATH}" >> $GITHUB_PATH
- name: Compile kernel
run: |
chmod +x build.sh
./build.sh
- name: Make output directory for kernel
run: |
mkdir outw
mkdir outw/false
mkdir outw/true
- name: Move kernel without KernelSU support to output directory
run: |
chmod +x move.sh
./move.sh
- name: Clean build environment
run: |
chmod +x clean.sh
./clean.sh
- name: Set KERNELSU environment variable to true
run: echo "KERNELSU=true" >> $GITHUB_ENV
- name: Set KERNELSU_VERSION environment variable
run: echo "KERNELSU_VERSION=$(cat ksu_version.txt)" >> $GITHUB_ENV
- name: Add KernelSU support to kernel
run: |
chmod +x kernelSU.sh
./kernelSU.sh
- name: Compile kernel with KernelSU support
run: |
chmod +x build.sh
./build.sh
- name: Move kernel with KernelSU support to output directory
run: |
chmod +x move.sh
./move.sh
- name: Clone AnyKernel3
run: |
chmod +x anykernel.sh
./anykernel.sh
- name: Set ZIP_NO_KSU and ZIP_KSU environment variables
run: |
echo "ZIP_NO_KSU=${{ env.VERSION }}-NoKernelSU.zip" >> $GITHUB_ENV
echo "ZIP_KSU=${{ env.VERSION }}-KernelSU-$(cat ksu_version.txt).zip" >> $GITHUB_ENV
- name: Make AnyKernel3 zip
run: |
chmod +x makezip.sh
./makezip.sh
- name: Extract info for release
run: |
chmod +x extract.sh
./extract.sh
- name: Make a release
uses: softprops/action-gh-release@v1
with:
files: |
${{ github.workspace }}/${{ env.ZIP_NO_KSU }}
${{ github.workspace }}/${{ env.ZIP_KSU }}
token: ${{ secrets.GITHUB_TOKEN }}
name: KernelSU Release - ${{ env.KERNELSU_VERSION }}
tag_name: ${{ github.run_id }}
body: |
**Info:**
- KernelSU Version: ${{ env.KERNELSU_VERSION }}.
**Installation:**
- Download desired zip file.
- Flash the zip file in recovery using sideload or any other method.
<details>
<summary>Build Settings</summary>
```
${{ env.buildsettings }}
```
</details>
draft: false
prerelease: false