Skip to content

Commit 6e6a822

Browse files
committed
Test Kernel version extract
1 parent 51f837e commit 6e6a822

File tree

2 files changed

+133
-29
lines changed

2 files changed

+133
-29
lines changed

.github/actions/action.yml

Lines changed: 76 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,84 @@ runs:
431432
echo "Creating zip file $ZIP_NAME..."
432433
zip -r "../$ZIP_NAME" ./*
433434
435+
- name: Debug Check Directory Structure
436+
shell: bash
437+
run: |
438+
echo "=== Debug: Current Directory ==="
439+
pwd
440+
echo "$GITHUB_WORKSPACE"
441+
echo "=== Listing CONFIG dir: $CONFIG ==="
442+
ls -la "$CONFIG" || echo "No such directory: $CONFIG"
443+
echo "=== Does kernel_platform/common exist inside $CONFIG? ==="
444+
ls -la "$CONFIG/kernel_platform/common" || echo "Path not found"
445+
echo "=== Looking for Makefile ==="
446+
find . -name "Makefile" -type f
447+
448+
- name: Save Build Metadata
449+
shell: bash
450+
if: success() && steps.create_zip.conclusion == 'success'
451+
id: save_metadata
452+
run: |
453+
set -euo pipefail
454+
cd "$GITHUB_WORKSPACE"
455+
if [ -z "$(ls *.zip 2>/dev/null)" ]; then
456+
echo "No kernel zip found! Artifact upload might be fake."
457+
exit 1
458+
fi
459+
460+
echo "=== Save Build Metadata (Model: ${{ inputs.model }}) ==="
461+
echo "CONFIG = $CONFIG"
462+
echo "Current dir: $(pwd)"
463+
ls -la
464+
465+
cd "$CONFIG/kernel_platform/common"
466+
CONFIG_FILES=("build.config.common" "build.config.constants")
467+
BRANCH_LINE=""
468+
469+
for file in "${CONFIG_FILES[@]}"; do
470+
if [ -f "$file" ]; then
471+
line=$(grep '^[[:space:]]*BRANCH=' "$file" | head -n1)
472+
if [ -n "$line" ]; then
473+
BRANCH_LINE="$line"
474+
echo "Found BRANCH in: $file"
475+
break # Found it — exit loop
476+
else
477+
echo "File exists but no BRANCH= found: $file"
478+
fi
479+
else
480+
echo "File not found: $file"
481+
fi
482+
done
483+
484+
if [ -z "$BRANCH_LINE" ]; then
485+
echo "Error: No BRANCH= found in any of: ${CONFIG_FILES[*]}"
486+
exit 1
487+
fi
488+
489+
BRANCH_VALUE="${BRANCH_LINE#*=}"
490+
ANDROID_VERSION="${BRANCH_VALUE%-*}"
491+
492+
if [ -z "$ANDROID_VERSION" ]; then
493+
echo "Error: Could not extract 'androidXX' from BRANCH='$BRANCH_VALUE'"
494+
exit 1
495+
fi
496+
497+
# Extract values using grep and awk
498+
VERSION=$(grep '^VERSION *=' Makefile | awk '{print $3}')
499+
PATCHLEVEL=$(grep '^PATCHLEVEL *=' Makefile | awk '{print $3}')
500+
SUBLEVEL=$(grep '^SUBLEVEL *=' Makefile | awk '{print $3}')
501+
FULL_VERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL"
502+
503+
echo "Kernel Version: $ANDROID_VERSION-$FULL_VERSION"
504+
505+
cd "$GITHUB_WORKSPACE"
506+
echo "$ANDROID_VERSION-$FULL_VERSION" > ${{ inputs.model }}.txt
507+
434508
- name: Upload Build Artifacts
509+
id: upload_ak3_zip
435510
uses: actions/upload-artifact@v4
436511
with:
437512
name: kernel-${{ env.CONFIG }}
438513
path: |
514+
${{ inputs.model }}.txt
439515
*.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)