Просмотр исходного кода

Remove boot image building action and update release notes with installation instructions

TheWildJames 3 месяцев назад
Родитель
Сommit
d3ff2c89ff

+ 0 - 90
.github/actions/build-boot-images/action.yml

@@ -1,90 +0,0 @@
-name: 'Build Boot Images'
-description: 'Creates boot artifacts (boot.img, boot-gz.img, boot-lz4.img) and stores them in boot-artifacts/'
-
-inputs:
-  android_version:
-    description: 'Android version (e.g., android13)'
-    required: true
-  kernel_version:
-    description: 'Kernel version (e.g., 5.15)'
-    required: true
-  os_patch_level:
-    description: 'OS patch level (e.g., 2025-09)'
-    required: true
-  file_name:
-    description: 'Release file prefix for artifacts'
-    required: true
-
-runs:
-  using: composite
-  steps:
-    - shell: bash
-      working-directory: ${{ github.workspace }}
-      run: |
-        set -euo pipefail
-
-        ANDROID_VERSION="${{ inputs.android_version }}"
-        KERNEL_VERSION="${{ inputs.kernel_version }}"
-        OS_PATCH_LEVEL="${{ inputs.os_patch_level }}"
-        FILE_NAME="${{ inputs.file_name }}"
-
-        mkdir -p bootimgs
-        mkdir -p boot-artifacts
-
-        if [ -f "${{ github.workspace }}/kernel/out/$ANDROID_VERSION-$KERNEL_VERSION/dist/Image" ]; then
-          cp "${{ github.workspace }}/kernel/out/$ANDROID_VERSION-$KERNEL_VERSION/dist/Image" "${{ github.workspace }}/bootimgs/Image"
-          cp "${{ github.workspace }}/kernel/out/$ANDROID_VERSION-$KERNEL_VERSION/dist/Image.lz4" "${{ github.workspace }}/bootimgs/Image.lz4"
-        else
-          cp "${{ github.workspace }}/kernel/bazel-bin/common/kernel_aarch64/Image" "${{ github.workspace }}/bootimgs/Image"
-          cp "${{ github.workspace }}/kernel/bazel-bin/common/kernel_aarch64/Image.lz4" "${{ github.workspace }}/bootimgs/Image.lz4"
-        fi
-
-        gzip -n -k -f -9 "${{ github.workspace }}/bootimgs/Image" > "${{ github.workspace }}/bootimgs/Image.gz"
-
-        cd "${{ github.workspace }}/bootimgs"
-
-        case "$ANDROID_VERSION" in
-          android12)
-            GKI_URL="https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-${OS_PATCH_LEVEL}_r1.zip"
-            FALLBACK_URL="https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-2023-01_r1.zip"
-
-            status="$(curl -sL -w "%{http_code}" "$GKI_URL" -o /dev/null || true)"
-            if [ "$status" = "200" ]; then
-              curl -L -o gki-kernel.zip "$GKI_URL"
-            else
-              curl -L -o gki-kernel.zip "$FALLBACK_URL"
-            fi
-
-            unzip -q gki-kernel.zip
-            rm -f gki-kernel.zip
-
-            if [ -f "./boot-5.10.img" ]; then
-              BOOT_IMG="./boot-5.10.img"
-            else
-              BOOT_IMG="$(ls -1 ./boot-*.img 2>/dev/null | head -n 1 || true)"
-            fi
-
-            if [ -z "${BOOT_IMG:-}" ]; then
-              exit 1
-            fi
-
-            "$UNPACK_BOOTIMG" --boot_img="$PWD/$BOOT_IMG"
-            ;;
-        esac
-
-        for kernel_image in Image Image.gz Image.lz4; do
-          case "$kernel_image" in
-            Image) output_image="boot.img" ;;
-            Image.gz) output_image="boot-gz.img" ;;
-            Image.lz4) output_image="boot-lz4.img" ;;
-          esac
-
-          if [ "$ANDROID_VERSION" = "android12" ]; then
-            "$MKBOOTIMG" --header_version 4 --kernel "$kernel_image" --output "$output_image" --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "$OS_PATCH_LEVEL"
-          else
-            "$MKBOOTIMG" --header_version 4 --kernel "$kernel_image" --output "$output_image"
-          fi
-
-          "$AVBTOOL" add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image "$output_image" --algorithm SHA256_RSA2048 --key "$BOOT_SIGN_KEY_PATH"
-          cp "$output_image" "${{ github.workspace }}/boot-artifacts/${FILE_NAME}-${output_image}"
-        done

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

@@ -66,3 +66,22 @@ A lightweight, LXC-inspired container runtime for Android and Linux. Run full Li
 Recommended flashing utility
 
 - URL: https://github.com/fatalcoder524/KernelFlasher
+
+## Installation Instructions
+
+### Prerequisites
+- Unlocked bootloader.
+- Backup your current boot image.
+- Have root access using Magisk / KernelSU / Apatch (Any forks).
+
+### Via Kernel Flasher
+Download the correct AnyKernel3 ZIP for your device.
+If you previously used another root method, clean it up first:
+a. Magisk: perform a complete uninstall after flashing the AnyKernel3 ZIP.
+b. KSU LKM (boot/init_boot/vendor_boot‑patched): Flash back the stock boot/init_boot/vendor_boot depending on what you patched.
+c. KSU GKI: if you are 100% sure you already flashed stock init_boot/boot/vendor_boot, no action is needed; otherwise, follow the same steps as KSU LKM.
+d. APatch: remove /data/adb contents to avoid leftover root conflicts after flashing the AnyKernel3 ZIP.
+Flash the ZIP to the active slot using Kernel Flasher.
+Install the KernelSU‑Next Manager APK, same version as mentioned in the release notes.
+Open the KernelSU‑Next app.
+Reboot the device if you performed any cleanup in step 2

+ 0 - 34
.github/workflows/build.yml

@@ -385,40 +385,6 @@ jobs:
         compression_level: 9
         github_token: ${{ secrets.GITHUB_TOKEN }}
 
-    # Boot image building and packaging are disabled for now.
-    # Uncomment this block later if you want to generate and upload boot artifacts again.
-    # - name: Create Bootimgs Folder and Build Boot Images
-    #   uses: ./.github/actions/build-boot-images
-    #   with:
-    #     android_version: ${{ inputs.android_version }}
-    #     kernel_version: ${{ inputs.kernel_version }}
-    #     os_patch_level: ${{ inputs.os_patch_level }}
-    #     file_name: ${{ steps.extract.outputs.file_name }}
-    #
-    # - name: Upload Boot Image (.img)
-    #   uses: actions/upload-artifact@v7
-    #   with:
-    #     name: ${{ steps.extract.outputs.file_name }}-boot.img
-    #     path: ${{ github.workspace }}/boot-artifacts/${{ steps.extract.outputs.file_name }}-boot.img
-    #     if-no-files-found: error
-    #     archive: false
-    #
-    # - name: Upload Boot Image (.img.gz)
-    #   uses: actions/upload-artifact@v7
-    #   with:
-    #     name: ${{ steps.extract.outputs.file_name }}-boot-gz.img
-    #     path: ${{ github.workspace }}/boot-artifacts/${{ steps.extract.outputs.file_name }}-boot-gz.img
-    #     if-no-files-found: error
-    #     archive: false
-    #
-    # - name: Upload Boot Image (.img.lz4)
-    #   uses: actions/upload-artifact@v7
-    #   with:
-    #     name: ${{ steps.extract.outputs.file_name }}-boot-lz4.img
-    #     path: ${{ github.workspace }}/boot-artifacts/${{ steps.extract.outputs.file_name }}-boot-lz4.img
-    #     if-no-files-found: error
-    #     archive: false
-    #
     - name: Prepare AnyKernel3 Zip
       uses: ./.github/actions/prepare-anykernel3
       with:

+ 114 - 28
.github/workflows/main.yml

@@ -14,7 +14,7 @@ on:
           - Action
           - Pre-Release
           - Release
-        default: Actions
+        default: Action
       kernel_build_version:
         description: "Kernel Version"
         type: choice
@@ -196,9 +196,106 @@ jobs:
         path: AIO-REJ.zip
         if-no-files-found: ignore
 
+  release-preview:
+    runs-on: ubuntu-latest
+    if: ${{ always() && github.event_name == 'workflow_dispatch' }}
+    permissions:
+      contents: read
+    needs:
+    - build-android12-5-10
+    - build-android13-5-10
+    - build-android13-5-15
+    - build-android14-5-15
+    - build-android14-6-1
+    - build-android15-6-6
+    - build-android16-6-12
+
+    env:
+      GH_TOKEN: ${{ github.token }}
+      RELEASE_CONFIG: .github/config/release.json
+
+    steps:
+    - name: Checkout code
+      uses: actions/checkout@v5
+
+    - name: Load Release Config
+      id: release_meta
+      run: |
+        set -euo pipefail
+
+        release_title=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print(data["release"]["title"])' "$RELEASE_CONFIG")
+        echo "release_title=$release_title" >> "$GITHUB_OUTPUT"
+
+    - name: Extract KernelSU Version Info
+      id: ksu_version
+      env:
+        RELEASE_CONFIG_PATH: ${{ env.RELEASE_CONFIG }}
+      run: |
+        set -euo pipefail
+
+        # Extract KernelSU commit and branch from release config
+        KSUN_COMMIT=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print(data["kernelsu"]["dev"])' "$RELEASE_CONFIG_PATH")
+        KSUN_BRANCH=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print("dev")' "$RELEASE_CONFIG_PATH")
+
+        # Clone KernelSU-Next on the specified branch
+        echo "Cloning KernelSU-Next from branch: $KSUN_BRANCH"
+        git clone --depth=1 --branch "$KSUN_BRANCH" https://github.com/KernelSU-Next/KernelSU-Next.git /tmp/kernelsu-next
+
+        cd /tmp/kernelsu-next
+
+        # Checkout the specific commit
+        echo "Checking out commit: $KSUN_COMMIT"
+        git fetch --depth=50 origin "$KSUN_COMMIT"
+        git checkout "$KSUN_COMMIT"
+
+        # Extract version info
+        COMMITS_COUNT=$(git rev-list --count HEAD)
+        BASE_VERSION=30000
+        KSU_VERSION=$(expr $COMMITS_COUNT "+" $BASE_VERSION)
+
+        # Extract git tag
+        KSU_GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "no-tag")
+
+        MANAGER_RUN_ID=$(curl -fsSL "https://api.github.com/repos/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml/runs?head_sha=${KSUN_COMMIT}" | jq -r '.workflow_runs[0].id // empty')
+        if [[ -n "${MANAGER_RUN_ID:-}" ]]; then
+          KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/runs/${MANAGER_RUN_ID}"
+        else
+          KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml"
+        fi
+
+        echo "Commits count: $COMMITS_COUNT"
+        echo "KSU Version: $KSU_VERSION"
+        echo "KSU Git Tag: $KSU_GIT_TAG"
+        echo "KSU Manager: $KSU_MANAGER"
+
+        # Export as environment for next step
+        echo "KSUN_BRANCH=$KSUN_BRANCH" >> $GITHUB_ENV
+        echo "KSUN_COMMIT=$KSUN_COMMIT" >> $GITHUB_ENV
+        echo "KSU_COMMITS_COUNT=$COMMITS_COUNT" >> $GITHUB_ENV
+        echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
+        echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
+        echo "KSU_MANAGER=$KSU_MANAGER" >> $GITHUB_ENV
+
+    - name: Set release body
+      run: |
+        set -e
+
+        RELEASE_CONFIG_PATH="$RELEASE_CONFIG"
+        : > release_body.md
+
+        python3 .github/scripts/render_release_body.py "$RELEASE_CONFIG_PATH" > release_body.md
+
+    - name: Publish release notes preview
+      run: |
+        {
+          echo "## Release Notes Preview"
+          echo
+          cat release_body.md
+        } >> "$GITHUB_STEP_SUMMARY"
+
   release:
     runs-on: ubuntu-latest
-    if: ${{ github.event_name == 'workflow_dispatch' && inputs.release_type != 'Actions' }}
+    if: ${{ github.event_name == 'workflow_dispatch' && (inputs.release_type == 'Pre-Release' || inputs.release_type == 'Release') }}
     permissions:
       contents: write
     needs:
@@ -306,8 +403,8 @@ jobs:
         set -euo pipefail
 
         # Extract KernelSU commit and branch from release config
-        KSUN_COMMIT=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print(data["components"]["kernelsu"]["commit"])' "$RELEASE_CONFIG_PATH")
-        KSUN_BRANCH=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print(data["components"]["kernelsu"]["branch"])' "$RELEASE_CONFIG_PATH")
+        KSUN_COMMIT=$(python3 -c 'import json,sys;from pathlib import Path;data=json.loads(Path(sys.argv[1]).read_text());print(data["kernelsu"]["dev"])' "$RELEASE_CONFIG_PATH")
+        KSUN_BRANCH=$(python3 -c 'print("dev")')
 
         # Clone KernelSU-Next on the specified branch
         echo "Cloning KernelSU-Next from branch: $KSUN_BRANCH"
@@ -328,9 +425,17 @@ jobs:
         # Extract git tag
         KSU_GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "no-tag")
 
+        MANAGER_RUN_ID=$(curl -fsSL "https://api.github.com/repos/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml/runs?head_sha=${KSUN_COMMIT}" | jq -r '.workflow_runs[0].id // empty')
+        if [[ -n "${MANAGER_RUN_ID:-}" ]]; then
+          KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/runs/${MANAGER_RUN_ID}"
+        else
+          KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml"
+        fi
+
         echo "Commits count: $COMMITS_COUNT"
         echo "KSU Version: $KSU_VERSION"
         echo "KSU Git Tag: $KSU_GIT_TAG"
+        echo "KSU Manager: $KSU_MANAGER"
 
         # Export as environment for next step
         echo "KSUN_BRANCH=$KSUN_BRANCH" >> $GITHUB_ENV
@@ -338,6 +443,7 @@ jobs:
         echo "KSU_COMMITS_COUNT=$COMMITS_COUNT" >> $GITHUB_ENV
         echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
         echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
+        echo "KSU_MANAGER=$KSU_MANAGER" >> $GITHUB_ENV
 
     - name: Set release body
       run: |
@@ -348,25 +454,12 @@ jobs:
 
         python3 .github/scripts/render_release_body.py "$RELEASE_CONFIG_PATH" > release_body.md
 
-    - name: Workflow Summary
-      if: ${{ always() }}
+    - name: Publish release notes preview
       run: |
-        set -e
-
-        AK3_COMMIT="gki-2.0"
-        PATCHES_COMMIT="main"
-        BBG_COMMIT="main"
-
-        short() { echo "${1:0:8}"; }
-
         {
-          echo "## 📦 Components"
-          echo "| Component | Branch / Tag | Commit / Version |"
-          echo "|---|---|---|"
-          echo "| KernelSU-Next | ${KSUN_BRANCH:-dev} | $(short "${KSUN_COMMIT}") / ${KSU_GIT_TAG:-no-tag} / ${KSU_VERSION:-unknown} |"
-          echo "| AnyKernel3 | gki-2.0 | $(short "$AK3_COMMIT") |"
-          echo "| Kernel Patches | main | $(short "$PATCHES_COMMIT") |"
-          echo "| BBG | main | $(short "$BBG_COMMIT") |"
+          echo "## Release Notes Preview"
+          echo
+          cat release_body.md
         } >> "$GITHUB_STEP_SUMMARY"
 
     - name: Download AnyKernel3 Artifacts
@@ -376,13 +469,6 @@ jobs:
         pattern: '*-AnyKernel3'
         merge-multiple: false
 
-    - name: Download Boot Image Artifacts
-      uses: actions/download-artifact@v7
-      with:
-        path: release-assets
-        pattern: '*-BootImages'
-        merge-multiple: false
-
     - name: Zip AnyKernel3 for Release
       run: |
         set -e