-
Notifications
You must be signed in to change notification settings - Fork 0
261 lines (218 loc) Β· 11.4 KB
/
builder-v01-galaxya12s.yaml
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# This is for Building the Android Kernel
# Builder v0.1 Made for MizKernel
# Note that the kernel is only Image and not Image.gz-dtb because samsung and the gz-dtb wont work on samsung
name: "Android Kernel Builder - v1 : MizKernel"
on:
workflow_dispatch:
inputs:
version:
description: "What forked version you want from MizKernel"
required: true
default: "stable"
type: choice
options:
- "stable"
- "unstable"
- "testing"
apatch:
description: "Apply APatch to the Kernel"
required: true
default: "false"
type: boolean
apatch_password:
description: "Password for APatch, don't forget the password or else you're locked out from root access lol"
required: true
default: "A12345678"
type: string
notify_telegram_channel:
description: "Notify the Telegram Channel (Make sure you set up the secrets with variable named: TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID)"
required: true
default: "false"
type: boolean
permissions:
contents: write
jobs:
build:
name: "Build MizKernel"
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Set up Timezone"
run: |
# Only set time to Asia/Manila and NEVER ANY TZ
sudo timedatectl set-timezone Asia/Manila
- name: "Clean up Bloated Actions"
uses: rokibhasansagar/slimhub_actions@main
with:
retain: "docker_imgcache,docker_buildkit,container_tools,nodejs_npm,toolcache_node"
- name: "Set up dependencies"
run: |
sudo apt update
sudo apt upgrade -y
sudo apt install aria2 libncurses5 git python-is-python3 python2 python3 wget curl libc6-dev tar -y
sudo apt install cpio default-jdk git-core gnupg flex bison gperf build-essential zip curl aria2 libc6-dev libncurses5-dev x11proto-core-dev libx11-dev libreadline6-dev libgl1-mesa-glx libgl1-mesa-dev python3 make sudo gcc g++ bc grep tofrodos python3-markdown libxml2-utils xsltproc zlib1g-dev -y
git clone https://github.com/Mizumo-prjkt/clang-r383902
git clone https://github.com/Mizumo-prjkt/aarch64-linux-android-4.9-llvm
- name: "Clone the Kernel"
run: |
git clone https://github.com/MizProject/MizKernel-GalaxyA12s MizKernel
cd MizKernel
git checkout ${{ github.event.inputs.version }}
cd ..
- name: "Move the toolchains"
run: |
mv clang-r383902 MizKernel/clang-r383902
mv aarch64-linux-android-4.9-llvm MizKernel/aarch64-linux-android-4.9-llvm
- name: "Build the kernel"
run: |
cd MizKernel
./build_kernel.sh
cd ..
- name: "Pull Finished Kernel"
run: |
mkdir processing
cp MizKernel/arch/arm64/boot/Image processing/Image-${{github.run_id}}
mkdir out
- name: "Pull Image-gz-dtb (if present) to out"
run: |
echo "Pulling Image-gzdtb"
echo "If this session fails, either, it's not config in defconfig or idk where, probably in the shadow realm"
cp MizKernel/arch/arm64/boot/Image.gz-dtb out/Image.gz-dtb
continue-on-error: true
# Variable fetching is disabled because it's not working
# - name: "Variable fetching"
# run: |
# echo "IDENTIFIER=$(curl -s https://raw.githubusercontent.com/MizProject/MizKernel-GalaxyA12s/refs/heads/${{github.event.inputs.version}}/CHANGELOG | cat | tr -d '\n\r')" >> $GITHUB_ENV
# echo "CHANGELOG=$(curl -s https://raw.githubusercontent.com/MizProject/MizKernel-GalaxyA12s/refs/heads/${{github.event.inputs.version}}/IDENTIFIER | cat | tr -d '\n\r')" >> $GITHUB_ENV
# echo "DEBUG IDENT: ${{ env.IDENTIFIER }}"
# echo "DEBUG CLOG: ${{ env.CHANGELOG }}"
- name: "Patch with APatch"
if: ${{ github.event.inputs.apatch == 'true' }}
run: |
aria2c -x 10 https://magojohnji.github.io/magiskboot-linux/x86_64/magiskboot
chmod +x magiskboot
aria2c -x 10 https://github.com/bmax121/KernelPatch/releases/download/0.10.7/kptools-linux
chmod +x kptools-linux
# The aria2c is for downloading the boot.img from Galaxy A12s, if you want to use your own boot.img, edit the link
aria2c -x 10 https://github.com/MizProject/MizKernel-GalaxyA12s/releases/download/apatch-template/boot.img
mv boot.img processing/boot.img
aria2c -x 10 https://github.com/bmax121/KernelPatch/releases/download/0.10.7/kpimg-android
sudo mv magiskboot /usr/bin/magiskboot
sudo mv kptools-linux /usr/bin/kptools-linux
sudo chmod +x /usr/bin/magiskboot
sudo chmod +x /usr/bin/kptools-linux
mv kpimg-android processing/kpimg-android
cd processing
magiskboot unpack boot.img
rm -rf kernel
kptools-linux -p --image Image-${{github.run_id}} --skey ${{ github.event.inputs.apatch_password }} --kpimg kpimg-android --out kernel
magiskboot repack boot.img
mv new-boot.img ../out/boot.img
cp -rf kernel ../out/Image
cd ..
- name: "Patch Boot Img (Non-Apatch)"
if: ${{ github.event.inputs.apatch == 'false' }}
run: |
aria2c -x 10 https://magojohnji.github.io/magiskboot-linux/x86_64/magiskboot
chmod +x magiskboot
sudo mv magiskboot /usr/bin/magiskboot
sudo chmod +x /usr/bin/magiskboot
aria2c -x 10 https://github.com/MizProject/MizKernel-GalaxyA12s/releases/download/apatch-template/boot.img
mv boot.img processing/boot.img
cd processing
magiskboot unpack boot.img
rm -rf kernel
cp Image-${{github.run_id}} kernel
magiskboot repack boot.img
mv new-boot.img ../out/boot.img
cd ..
- name: "Zip it"
run: |
aria2c -x 10 https://github.com/MizProject/MizKernel-GalaxyA12s/releases/download/zi-template/AnyKernel-TEMPLATE.zip
mkdir AnyKernel
mv AnyKernel-TEMPLATE.zip AnyKernel
cd AnyKernel
unzip AnyKernel-TEMPLATE.zip
rm -rf AnyKernel-TEMPLATE.zip
rm -rf Image
cd ..
if [ ${{ github.event.inputs.apatch }} == 'true' ]; then
cp processing/kernel AnyKernel/Image
else
cp processing/kernel AnyKernel/Image
fi
rm -rf AnyKernel/version
if [ ${{ github.event.inputs.apatch }} == 'true' ]; then
EXTRMSG=" APatch is applied"
fi
echo "MizKernel-${{github.run_id}}" - Type: ${{github.event.inputs.version}} >> AnyKernel/version
echo "Autogen by Github Actions" >> AnyKernel/version
echo "Build Date: $(date)" >> AnyKernel/version
echo "See the changelog for more info" >> AnyKernel/version
echo "Link: https://raw.githubusercontent.com/MizProject/MizKernel-GalaxyA12s/refs/heads/${{github.event.inputs.version}}/CHANGELOG" >> AnyKernel/version
cd AnyKernel
zip -r MizKernel-${{github.run_id}}-twrp.zip ./*
cd ..
mv AnyKernel/MizKernel-${{github.run_id}}-twrp.zip out/MizKernel-${{github.run_id}}-twrp.zip
- name: "To Github Artifact"
uses: actions/upload-artifact@v4
with:
name: "MizKernel-${{github.run_id}}-artifacts"
path: |
out/boot.img
out/Image
out/MizKernel-${{github.run_id}}-twrp.zip
continue-on-error: true
- name: "Deploy to Github Release"
uses: softprops/action-gh-release@v2
with:
files: |
out/*
name: "MizKernel - ${{github.run_id}} - ${{ github.event.inputs.version }}"
tag_name: "${{ github.run_id }}"
body: |
### This is latest build of MizKernel under type: ${{ github.event.inputs.version }}<br>
The source code kernel is available at: https://github.com/MizProject/MizKernel-GalaxyA12s<br>
Apatch was used? : ${{ github.event.inputs.apatch }}<br>
APatch Password: ${{ github.event.inputs.apatch_password }}<br>
(Note that if Apatch is set to true, the kernel is patched with APatch, if false, the kernel is not patched with APatch)
The Boot Image is advisable to be flashed using Odin or Heimdall<br>
The Kernel Image is a raw kernel, you can install it using dd via twrp if you know where to put the kernel in the partition<br>
The Zip File is a flashable zip for TWRP
Changelog: https://raw.githubusercontent.com/MizProject/MizKernel-GalaxyA12s/refs/heads/${{ github.event.inputs.version }}/CHANGELOG
env:
GITHUB_TOKEN: ${{ secrets.GH_FALLBACK_TOKEN }}
- name: "Notify Telegram Channel"
if: ${{ github.event.inputs.notify_telegram_channel == 'true' }}
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
message: |
π MizKernel Build Completed π
Action ID: ${{ github.run_id }}
Apatch: ${{ github.event.inputs.apatch }}
Release type: ${{ github.event.inputs.version }}
Apatch Password: ${{ github.event.inputs.apatch_password }}
If Apatch is set to true, that means the kernel is patched with APatch
If false, the kernel is not patched with APatch, thus ignore the Apatch Password
For A12s using APatch already, trying to apply an update, i suggest using the zip variant instead, no need to reflash boot partition.
Link: https://github.com/MizProject/MizKernel-Kitchen/releases/tag/${{ github.run_id }}
Changelog: https://raw.githubusercontent.com/MizProject/MizKernel-GalaxyA12s/refs/heads/${{ github.event.inputs.version }}/CHANGELOG
- name: "Notify Telegram Channel - Exynos 850 Chat"
if: ${{ github.event.inputs.notify_telegram_channel == 'true' }}
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_EXYNOS_CHAT_ID }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
message: |
π MizKernel Build Completed π
Action ID: ${{ github.run_id }}
Apatch: ${{ github.event.inputs.apatch }}
Release type: ${{ github.event.inputs.version }}
Apatch Password: ${{ github.event.inputs.apatch_password }}
If Apatch is set to true, that means the kernel is patched with APatch
If false, the kernel is not patched with APatch, thus ignore the Apatch Password
For A12s using APatch already, trying to apply an update, i suggest using the zip variant instead, no need to reflash boot partition.
Link: https://github.com/MizProject/MizKernel-Kitchen/releases/tag/${{ github.run_id }}