Skip to content

Commit 57dbbb4

Browse files
committed
ci: fix job limit by splitting build-kernel job, add always() to release, and add backup caution message
1 parent e3fd96f commit 57dbbb4

1 file changed

Lines changed: 115 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 115 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ env:
1111
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1212

1313
jobs:
14-
# JOB 1: Build varian Stock, KernelSU Next, Sukisu, Resukisu, Mambosu (Total: 208 Jobs)
15-
build-kernel:
16-
name: "${{ matrix.variant == 'stock' && format('{0}-{1}', matrix.variant, matrix.hz.name) || format('{0}-{1}-{2}', matrix.variant, matrix.root, matrix.hz.name) }}${{ matrix.kpm == 'on' && '-kpm' || '' }}${{ matrix.hardened == 'on' && '-hardened' || '' }}${{ matrix.bypasscharging == 'on' && '-bypasscharging' || '' }}"
14+
# JOB 1A: Build varian Standard (Hardened OFF) - Total 152 Jobs
15+
build-kernel-standard:
16+
name: "${{ matrix.variant == 'stock' && format('{0}-{1}', matrix.variant, matrix.hz.name) || format('{0}-{1}-{2}', matrix.variant, matrix.root, matrix.hz.name) }}${{ matrix.kpm == 'on' && '-kpm' || '' }}-standard${{ matrix.bypasscharging == 'on' && '-bypasscharging' || '' }}"
1717
runs-on: ubuntu-24.04
1818
strategy:
19+
fail-fast: false
1920
matrix:
2021
hz:
2122
- { id: 100, name: powersave }
@@ -25,7 +26,7 @@ jobs:
2526
variant: [stock, root, susfs]
2627
root: [none, ksu, ksu-next, sukisu, yukisu, resukisu, mambosu]
2728
kpm: [off, on]
28-
hardened: [off, on]
29+
hardened: [off]
2930
bypasscharging: [off, on]
3031
exclude:
3132
- variant: stock
@@ -64,7 +65,114 @@ jobs:
6465
- variant: susfs
6566
root: mambosu
6667
kpm: on
68+
69+
steps:
70+
- name: Create Swap
71+
run: |
72+
SWAPFILE="/mnt/build_swapfile"
73+
while true; do
74+
if sudo fallocate -l 10G $SWAPFILE || sudo dd if=/dev/zero of=$SWAPFILE bs=1M count=10240 status=progress; then
75+
break
76+
else
77+
sleep 5
78+
fi
79+
done
80+
sudo chmod 600 $SWAPFILE && sudo mkswap $SWAPFILE && sudo swapon $SWAPFILE
81+
82+
- uses: actions/checkout@v4
83+
with: { path: gki-clo }
84+
85+
- name: Setup Build Environment
86+
run: |
87+
sudo apt-get update
88+
sudo apt-get install -y bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses-dev lib32readline-dev lib32z1-dev libncurses-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev python3 clang lld llvm jq
89+
90+
- name: Download Clang Toolchain
91+
run: |
92+
mkdir -p toolchains
93+
git clone --depth=1 https://github.com/ZyCromerZ/Clang.git -b main toolchains/clang
94+
95+
- name: Setup AnyKernel3
96+
run: |
97+
cd gki-clo
98+
[ ! -d "anykernel" ] && git clone https://github.com/osm0sis/AnyKernel3.git anykernel || true
99+
100+
- name: Build Kernel
101+
run: |
102+
cd gki-clo
103+
chmod +x build.sh
104+
./build.sh \
105+
hz=${{ matrix.hz.id }} \
106+
variant=${{ matrix.variant }} \
107+
root=${{ matrix.root }} \
108+
kpm=${{ matrix.kpm }} \
109+
kpm_superkey=${{ matrix.kpm == 'on' && secrets.KPM_SUPERKEY || '' }} \
110+
kpm_patch=${{ matrix.kpm == 'on' && matrix.root == 'resukisu' && 'off' || 'on' }} \
111+
hardened=${{ matrix.hardened }} \
112+
bypasscharging=${{ matrix.bypasscharging }} \
113+
lto=${{ matrix.kpm == 'on' && 'thin' || 'full' }}
114+
115+
- name: Upload Artifact
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: Kono-Ha-${{ matrix.variant == 'stock' && format('{0}-{1}', matrix.variant, matrix.hz.name) || format('{0}-{1}-{2}', matrix.variant, matrix.root, matrix.hz.name) }}${{ matrix.kpm == 'on' && '-kpm' || '' }}${{ matrix.hardened == 'on' && '-hardened' || '' }}${{ matrix.bypasscharging == 'on' && '-bypasscharging' || '' }}
119+
path: gki-clo/Kono-Ha-Release
120+
retention-days: 7
121+
122+
# JOB 1B: Build varian Hardened (Hardened ON) - Total 152 Jobs
123+
build-kernel-hardened:
124+
name: "${{ matrix.variant == 'stock' && format('{0}-{1}', matrix.variant, matrix.hz.name) || format('{0}-{1}-{2}', matrix.variant, matrix.root, matrix.hz.name) }}${{ matrix.kpm == 'on' && '-kpm' || '' }}-hardened${{ matrix.bypasscharging == 'on' && '-bypasscharging' || '' }}"
125+
runs-on: ubuntu-24.04
126+
strategy:
67127
fail-fast: false
128+
matrix:
129+
hz:
130+
- { id: 100, name: powersave }
131+
- { id: 250, name: balance }
132+
- { id: 500, name: performance }
133+
- { id: 1000, name: ultra-performance }
134+
variant: [stock, root, susfs]
135+
root: [none, ksu, ksu-next, sukisu, yukisu, resukisu, mambosu]
136+
kpm: [off, on]
137+
hardened: [on]
138+
bypasscharging: [off, on]
139+
exclude:
140+
- variant: stock
141+
root: ksu
142+
- variant: stock
143+
root: ksu-next
144+
- variant: stock
145+
root: sukisu
146+
- variant: stock
147+
root: resukisu
148+
- variant: stock
149+
root: mambosu
150+
- variant: root
151+
root: none
152+
- variant: susfs
153+
root: none
154+
- variant: stock
155+
root: yukisu
156+
- variant: stock
157+
kpm: on
158+
- variant: root
159+
root: ksu
160+
kpm: on
161+
- variant: root
162+
root: ksu-next
163+
kpm: on
164+
- variant: root
165+
root: mambosu
166+
kpm: on
167+
- variant: susfs
168+
root: ksu
169+
kpm: on
170+
- variant: susfs
171+
root: ksu-next
172+
kpm: on
173+
- variant: susfs
174+
root: mambosu
175+
kpm: on
68176

69177
steps:
70178
- name: Create Swap
@@ -191,7 +299,8 @@ jobs:
191299
retention-days: 7
192300

193301
release:
194-
needs: [build-kernel, build-kernel-patcher]
302+
needs: [build-kernel-standard, build-kernel-hardened, build-kernel-patcher]
303+
if: always()
195304
runs-on: ubuntu-24.04
196305
permissions:
197306
contents: write
@@ -321,6 +430,7 @@ jobs:
321430
with open('release_body.md', 'w') as f:
322431
f.write('Automated kernel build.\n')
323432
f.write(f'Commit: {sha}\n\n')
433+
f.write('> [!CAUTION]\n> **BACKUP your boot.img** before flashing to recover from potential bootloops or other issues.\n\n')
324434
f.write(gen_table('Standard / Root Builds', std, False))
325435
f.write(gen_table('SUSFS ඞ', susfs, False))
326436
f.write(gen_table('Hardened', hard, False))

0 commit comments

Comments
 (0)