Skip to content

Commit 85233bc

Browse files
committed
Test Kernel version extract
1 parent 51f837e commit 85233bc

File tree

2 files changed

+114
-29
lines changed

2 files changed

+114
-29
lines changed

.github/actions/action.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ runs:
410410
fi
411411
412412
- name: Create ZIP Files for Different Formats
413+
id: create_zip
413414
shell: bash
414415
run: |
415416
echo "Changing to configuration directory: $CONFIG..."
@@ -431,9 +432,65 @@ runs:
431432
echo "Creating zip file $ZIP_NAME..."
432433
zip -r "../$ZIP_NAME" ./*
433434
435+
- name: Save Build Metadata
436+
shell: bash
437+
if: success() && steps.create_zip.conclusion == 'success'
438+
id: save_metadata
439+
run: |
440+
cd "$GITHUB_WORKSPACE"
441+
if [ -z "$(ls *.zip 2>/dev/null)" ]; then
442+
echo "No kernel zip found! Artifact upload might be fake."
443+
exit 1
444+
fi
445+
446+
cd "$CONFIG/kernel_platform/common"
447+
CONFIG_FILES=("build.config.common" "build.config.constants")
448+
BRANCH_LINE=""
449+
450+
for file in "${CONFIG_FILES[@]}"; do
451+
if [ -f "$file" ]; then
452+
line=$(grep '^[[:space:]]*BRANCH=' "$file" | head -n1 || true)
453+
if [ -n "$line" ]; then
454+
BRANCH_LINE="$line"
455+
echo "Found BRANCH in: $file"
456+
break # Found it — exit loop
457+
else
458+
echo "File exists but no BRANCH= found: $file"
459+
fi
460+
else
461+
echo "File not found: $file"
462+
fi
463+
done
464+
465+
if [ -z "$BRANCH_LINE" ]; then
466+
echo "Error: No BRANCH= found in any of: ${CONFIG_FILES[*]}"
467+
exit 1
468+
fi
469+
470+
BRANCH_VALUE="${BRANCH_LINE#*=}"
471+
ANDROID_VERSION="${BRANCH_VALUE%-*}"
472+
473+
if [ -z "$ANDROID_VERSION" ]; then
474+
echo "Error: Could not extract 'androidXX' from BRANCH='$BRANCH_VALUE'"
475+
exit 1
476+
fi
477+
478+
# Extract values using grep and awk
479+
VERSION=$(grep '^VERSION *=' Makefile | awk '{print $3}')
480+
PATCHLEVEL=$(grep '^PATCHLEVEL *=' Makefile | awk '{print $3}')
481+
SUBLEVEL=$(grep '^SUBLEVEL *=' Makefile | awk '{print $3}')
482+
FULL_VERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL"
483+
484+
echo "Kernel Version: $ANDROID_VERSION-$FULL_VERSION"
485+
486+
cd "$GITHUB_WORKSPACE"
487+
echo "$ANDROID_VERSION-$FULL_VERSION" > ${{ inputs.model }}.txt
488+
434489
- name: Upload Build Artifacts
490+
id: upload_ak3_zip
435491
uses: actions/upload-artifact@v4
436492
with:
437493
name: kernel-${{ env.CONFIG }}
438494
path: |
495+
${{ inputs.model }}.txt
439496
*.zip

.github/workflows/build-kernel-release.yml

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -278,27 +278,6 @@ jobs:
278278
REPO_NAME: ${{ github.event.repository.name }}
279279
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
280280
RELEASE_NAME: "*TEST BUILD* OnePlus Kernels With KernelSU Next & SUSFS v1.5.9 *TEST BUILD*"
281-
RELEASE_NOTES: |
282-
This release contains KernelSU Next and SUSFS v1.5.9
283-
284-
Module:
285-
-> https://github.com/sidex15/ksu_module_susfs
286-
287-
Non-Official Managers:
288-
-> https://github.com/KernelSU-Next/KernelSU-Next
289-
290-
Features:
291-
[+] KernelSU-Next
292-
[+] SUSFS v1.5.9
293-
[+] Wireguard Support
294-
[+] Maphide LineageOS Detections
295-
[+] Futile Maphide for jit-zygote-cache Detections
296-
[+] Magic Mount Support
297-
[+] Ptrace message leak fix for kernels < 5.16
298-
[+] Manual Hooks [scope_min_manual_hooks_v1.4]
299-
[+] CONFIG_TMPFS_XATTR Support [Mountify Support]
300-
[+] BBR v1 Support.
301-
[+] HMBIRD scx support for OnePlus 13 & OnePlus Ace 5 Pro.
302281

303282
steps:
304283
- name: Checkout code
@@ -324,19 +303,68 @@ jobs:
324303
with:
325304
path: ./downloaded-artifacts
326305

306+
- name: Generate Device List and Final Release Notes
307+
id: generate-notes
308+
run: |
309+
echo "=== Start building the release notes ==="
310+
cat << EOF > release_notes.md
311+
This release contains KernelSU Next and SUSFS v1.5.9
312+
313+
Module:
314+
-> https://github.com/sidex15/ksu_module_susfs
315+
316+
Non-Official Managers:
317+
-> https://github.com/KernelSU-Next/KernelSU-Next
318+
319+
### Built Devices
320+
321+
| Model | Kernel Version |
322+
|-------|----------------|
323+
EOF
324+
325+
# === Generate table rows ===
326+
while IFS= read -r file; do
327+
if [ -f "$file" ]; then
328+
model=$(basename "$file" .txt)
329+
version=$(cat "$file")
330+
printf "| %-7s | %-16s |\n" "$model" "$version" >> release_notes.md
331+
fi
332+
done < <(find downloaded-artifacts -name "*.txt" -type f | sort)
333+
334+
# === Add features and finalize ===
335+
cat << 'EOF' >> release_notes.md
336+
337+
### Features
338+
- [+] KernelSU-Next
339+
- [+] SUSFS v1.5.9
340+
- [+] Wireguard Support
341+
- [+] Maphide LineageOS Detections
342+
- [+] Futile Maphide for jit-zygote-cache Detections
343+
- [+] Magic Mount Support
344+
- [+] Ptrace message leak fix for kernels < 5.16
345+
- [+] Manual Hooks [scope_min_manual_hooks_v1.4]
346+
- [+] CONFIG_TMPFS_XATTR Support [Mountify Support]
347+
- [+] BBR v1 Support.
348+
- [+] HMBIRD scx support for OnePlus 13 & OnePlus Ace 5 Pro.
349+
EOF
350+
351+
# === Output for debugging ===
352+
echo "--- Final Release Notes ---"
353+
cat release_notes.md
354+
327355
- name: Create GitHub Release
328-
uses: actions/create-release@v1
329-
with:
330-
tag_name: ${{ env.NEW_TAG }}
331-
prerelease: true
332-
release_name: ${{ env.RELEASE_NAME }}
333-
body: ${{ env.RELEASE_NOTES }}
356+
run: |
357+
gh release create "${{ env.NEW_TAG }}" \
358+
--repo "${{ env.REPO_OWNER }}/${{ env.REPO_NAME }}" \
359+
--title "${{ env.RELEASE_NAME }}" \
360+
--notes-file release_notes.md \
361+
--prerelease
334362
env:
335-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
363+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
336364

337365
- name: Upload Release Assets Dynamically
338366
run: |
339-
for file in ./downloaded-artifacts/kernel-*/*; do
367+
for file in ./downloaded-artifacts/kernel-*/*.zip; do
340368
if [ -d "$file" ]; then
341369
continue
342370
fi

0 commit comments

Comments
 (0)