Selaa lähdekoodia

Release: add markdown template and template-aware renderer; update commit pins

TheWildJames 3 kuukautta sitten
vanhempi
sitoutus
e727c7095c
2 muutettua tiedostoa jossa 179 lisäystä ja 0 poistoa
  1. 68 0
      .github/config/RELEASE_NOTES.md
  2. 111 0
      .github/scripts/render_release_body.py

+ 68 - 0
.github/config/RELEASE_NOTES.md

@@ -0,0 +1,68 @@
+**IMPORTANT DISCLAIMER**
+
+This software is provided for testing and educational purposes only. Use at your own risk.
+The developers are not responsible for any damage, data loss, or issues that may occur.
+Please ensure you have proper backups before installation.
+
+## KernelSU-Next
+
+A kernel-based root solution for Android devices.
+
+- Version: {{KSU_VERSION}}
+- Tag: {{KSU_GIT_TAG}}
+- Branch: {{KSUN_BRANCH}}
+- Commit: {{KSUN_COMMIT}}
+
+- URL: https://github.com/KernelSU-Next/KernelSU-Next
+- Manager: {{KSU_MANAGER}}
+
+## SUSFS
+
+A KSU addon for hiding root using kernel patches and a userspace module!
+
+- SUS_PATH - Hide suspicious paths
+- SUS_MOUNT - Hide mount points (no CLI support)
+- SUS_KSTAT - Spoof kernel statistics
+- SPOOF_UNAME - Kernel version spoofing
+- SPOOF_CMDLINE - Boot parameter spoofing
+- OPEN_REDIRECT - File access redirection
+- SUS_MAP - Memory mapping protection
+- AVC_SPOOF - Spoof procfs avc denial logs
+
+- Version: v2.1.0
+- Branches:
+
+{{SUSFS_BRANCHES}}
+
+- URL: https://gitlab.com/simonpunk/susfs4ksu
+
+## Baseband Guard (BBG)
+
+LSM-based baseband security
+
+- Branch: main
+- URL: https://github.com/vc-teahouse/Baseband-guard
+
+## DroidSpaces
+
+A lightweight, LXC-inspired container runtime for Android and Linux. Run full Linux distributions natively with zero performance penalty
+
+- URL: https://github.com/ravindu644/Droidspaces-OSS
+
+## Networking
+
+- BBRv1 - Improved TCP congestion control
+- Wireguard - Built-in VPN support
+- IP Set & IPv6 NAT Support - Advanced firewall capabilities
+- TTL Target Support - Network packet manipulation
+
+## Other Features
+
+- TMPFS_XATTR - Extended attributes for tmpfs (Mountify support)
+- TMPFS_POSIX_ACL - POSIX ACLs for tmpfs
+
+## Kernel Flasher
+
+Recommended flashing utility
+
+- URL: https://github.com/fatalcoder524/KernelFlasher

+ 111 - 0
.github/scripts/render_release_body.py

@@ -0,0 +1,111 @@
+import json
+import os
+import sys
+from pathlib import Path
+
+
+PLACEHOLDERS = {
+    "{{KSU_VERSION}}": lambda: os.environ.get("KSU_VERSION", "unknown"),
+    "{{KSU_GIT_TAG}}": lambda: os.environ.get("KSU_GIT_TAG", "no-tag"),
+    "{{KSUN_BRANCH}}": lambda: os.environ.get("KSUN_BRANCH", "dev"),
+    "{{KSUN_COMMIT}}": lambda: os.environ.get("KSUN_COMMIT", "unknown"),
+    "{{KSU_MANAGER}}": lambda: os.environ.get("KSU_MANAGER", "Placeholder"),
+}
+
+
+def render_markdown(template_path: Path):
+    text = template_path.read_text()
+
+    commits_path = template_path.parent / "commits.json"
+    commits = json.loads(commits_path.read_text()) if commits_path.exists() else {}
+
+    for placeholder, getter in PLACEHOLDERS.items():
+        text = text.replace(placeholder, getter())
+
+    susfs_branches = []
+    for branch, commit in commits.get("susfs", {}).items():
+        susfs_branches.append(f"  - {branch}: {commit}")
+
+    if "{{SUSFS_BRANCHS}}" in text:
+        text = text.replace("{{SUSFS_BRANCHS}}", "\n".join(susfs_branches))
+    if "{{SUSFS_BRANCHES}}" in text:
+        text = text.replace("{{SUSFS_BRANCHES}}", "\n".join(susfs_branches))
+
+    print(text, end="")
+
+
+config_path = Path(sys.argv[1])
+if config_path.suffix.lower() == ".md":
+    render_markdown(config_path)
+    sys.exit(0)
+
+# Backward-compatible JSON renderer for older release configs.
+
+def emit(text=""):
+    print(text)
+
+
+def emit_list(items):
+    if isinstance(items, list):
+        for item in items:
+            emit(f"- {item}")
+
+
+def emit_description(value):
+    if isinstance(value, list):
+        for line in value:
+            emit(line)
+    elif value:
+        emit(str(value))
+
+
+data = json.loads(config_path.read_text())
+
+commits_path = config_path.parent / "commits.json"
+commits = json.loads(commits_path.read_text()) if commits_path.exists() else {}
+
+emit("**IMPORTANT DISCLAIMER**")
+for line in data["release"]["disclaimer"]:
+    emit(line)
+
+kernelsu = data.get("kernelsu", {})
+emit()
+emit(f"## {kernelsu.get('name', 'KernelSU-Next')}")
+emit(f"- Version: {os.environ.get('KSU_VERSION', kernelsu.get('version', 'unknown'))}")
+emit(f"- Tag: {os.environ.get('KSU_GIT_TAG', kernelsu.get('tag', 'no-tag'))}")
+emit(f"- Branch: {os.environ.get('KSUN_BRANCH', kernelsu.get('branch', 'dev'))}")
+emit(f"- Commit: {os.environ.get('KSUN_COMMIT', kernelsu.get('commit', 'unknown'))}")
+if kernelsu.get("url"):
+    emit(f"- URL: {kernelsu['url']}")
+if kernelsu.get("manager"):
+    emit(f"- Manager: {kernelsu['manager']}")
+
+skip_keys = {"release", "kernelsu"}
+for key in data.keys():
+    if key in skip_keys:
+        continue
+
+    section = data[key]
+    emit()
+    emit(f"## {section.get('name', key)}")
+
+    if section.get("description"):
+        emit_description(section["description"])
+
+    if section.get("version"):
+        emit(f"- Version: {section['version']}")
+    if section.get("tag"):
+        emit(f"- Tag: {section['tag']}")
+    if section.get("branch"):
+        emit(f"- Branch: {section['branch']}")
+
+    if key == "susfs" and "susfs" in commits:
+        emit("- Branches:")
+        for branch, commit in commits["susfs"].items():
+            emit(f"  - {branch}: {commit}")
+
+    if section.get("items"):
+        emit_list(section["items"])
+
+    if section.get("url"):
+        emit(f"- URL: {section['url']}")