Sfoglia il codice sorgente

ci: remove parse-kernel-version action; normalize version inputs and filenames

TheWildJames 4 mesi fa
parent
commit
4d91c1f939

+ 5 - 2
.github/actions/apply-device-patches/action.yml

@@ -1,6 +1,9 @@
 name: 'Apply Device-Specific Patches'
 description: 'Apply WiFi/Bluetooth fixes for Samsung and Xiaomi 6.6 GKI devices'
 inputs:
+  version:
+    description: 'Kernel config version (e.g., android15-6.6)'
+    required: true
   kernel_version:
     description: 'Kernel version (e.g., 6.6)'
     required: true
@@ -9,7 +12,7 @@ runs:
   using: "composite"
   steps:
     - name: Fix WiFi and Bluetooth on Samsung 6.6 GKI Devices
-      if: ${{ inputs.kernel_version == '6.6' }}
+      if: ${{ inputs.version == 'android15-6.6' }}
       shell: bash
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
@@ -27,7 +30,7 @@ runs:
         echo "obj-y += min_kdp.o" >> drivers/Makefile
 
     - name: Fix WiFi and Bluetooth on Xiaomi 6.6 GKI Devices
-      if: ${{ inputs.kernel_version == '6.6' }}
+      if: ${{ inputs.version == 'android15-6.6' }}
       shell: bash
       working-directory: ${{ github.workspace }}/kernel/common
       run: |

+ 9 - 2
.github/actions/apply-kernel-branding/action.yml

@@ -10,6 +10,9 @@ inputs:
   android_version:
     description: 'Android version (e.g., android14)'
     required: true
+  version:
+    description: 'Combined version (e.g., android14-6.1)'
+    required: true
   sublevel:
     description: 'Sublevel of kernel version (e.g., 1)'
     required: true
@@ -26,11 +29,15 @@ runs:
 
         DEFCONFIG="${{ github.workspace }}/kernel/common/arch/arm64/configs/gki_defconfig"
 
+        VERSION="${{ inputs.version }}"
+        ANDROID_PART=$(echo "$VERSION" | cut -d- -f1)
+        KERNEL_PART=$(echo "$VERSION" | cut -d- -f2)
+
         if [ "${{ inputs.variant }}" == "Wild" ]; then
           tac scripts/setlocalversion | awk '!seen && /^echo / {seen=1; next} 1' | tac > scripts/setlocalversion.tmp
           mv scripts/setlocalversion.tmp scripts/setlocalversion
-          if [[ ${{ inputs.kernel_version }} == "6.6" || ${{ inputs.kernel_version }} == "6.12" ]]; then
-            KERNEL_STRING="${{ inputs.kernel_version }}.${{ inputs.sublevel }}-${{ inputs.android_version }}"
+          if [[ "$KERNEL_PART" == "6.6" || "$KERNEL_PART" == "6.12" ]]; then
+            KERNEL_STRING="$KERNEL_PART.${{ inputs.sublevel }}-$ANDROID_PART"
             echo "echo \"$KERNEL_STRING-Wild\"" >> scripts/setlocalversion
           else
             echo 'echo "-Wild"' >> scripts/setlocalversion

+ 10 - 7
.github/actions/cache-setup/action.yml

@@ -1,6 +1,9 @@
 name: 'Setup Cache'
 description: 'Sets up ccache and Bazel remote cache configuration for the build environment'
 inputs:
+  version:
+    description: 'Kernel config version (e.g., android14-6.1)'
+    required: true
   kernel_version:
     description: 'Kernel version (e.g., 6.1)'
     required: true
@@ -17,9 +20,9 @@ runs:
     - name: Setup ccache
       shell: bash
       if: |
-        (inputs.kernel_version == '5.10' && inputs.android_version == 'android12') ||
-        (inputs.kernel_version == '5.10' && inputs.android_version == 'android13') || 
-        (inputs.kernel_version == '5.15' && inputs.android_version == 'android13')
+        inputs.version == 'android12-5.10' ||
+        inputs.version == 'android13-5.10' ||
+        inputs.version == 'android13-5.15'
       working-directory: ${{ github.workspace }}
       run: |
         set -euo pipefail
@@ -95,10 +98,10 @@ runs:
     - name: Setup Bazel Cache
       shell: bash
       if: |
-        (inputs.kernel_version == '5.15' && inputs.android_version == 'android14') ||
-        (inputs.kernel_version == '6.1' && inputs.android_version == 'android14') ||
-        (inputs.kernel_version == '6.6' && inputs.android_version == 'android15') ||
-        (inputs.kernel_version == '6.12' && inputs.android_version == 'android16')
+        inputs.version == 'android14-5.15' ||
+        inputs.version == 'android14-6.1' ||
+        inputs.version == 'android15-6.6' ||
+        inputs.version == 'android16-6.12'
       working-directory: ${{ github.workspace }}
       run: |
         set -euo pipefail

+ 12 - 2
.github/actions/download-kernel/action.yml

@@ -8,6 +8,9 @@ inputs:
   kernel_version:
     description: 'Kernel version (e.g., 5.15, 6.1)'
     required: true
+  version:
+    description: 'Combined version (e.g., android14-6.1)'
+    required: true
   os_patch_level:
     description: 'OS patch level (e.g., 2024-01)'
     required: true
@@ -31,7 +34,11 @@ runs:
       run: |
         set -euo pipefail
 
-        FORMATTED_BRANCH="${{ inputs.android_version }}-${{ inputs.kernel_version }}-${{ inputs.os_patch_level }}"
+        # Derive android and kernel from combined version when available
+        VERSION="${{ inputs.version }}"
+        ANDROID_PART=$(echo "$VERSION" | cut -d- -f1)
+        KERNEL_PART=$(echo "$VERSION" | cut -d- -f2)
+        FORMATTED_BRANCH="${ANDROID_PART}-${KERNEL_PART}-${{ inputs.os_patch_level }}"
 
         init_repo() {
           repo init -u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} --depth=1 || { echo "ERROR: repo init failed" >&2; return 1; }
@@ -84,7 +91,10 @@ runs:
       working-directory: ${{ github.workspace }}/kernel
       run: |
         set -euo pipefail
-        FORMATTED_BRANCH="${{ inputs.android_version }}-${{ inputs.kernel_version }}-${{ inputs.os_patch_level }}"
+        VERSION="${{ inputs.version }}"
+        ANDROID_PART=$(echo "$VERSION" | cut -d- -f1)
+        KERNEL_PART=$(echo "$VERSION" | cut -d- -f2)
+        FORMATTED_BRANCH="${ANDROID_PART}-${KERNEL_PART}-${{ inputs.os_patch_level }}"
         MAIN_MANIFEST_URL="https://android.googlesource.com/kernel/manifest/+/refs/heads/common-${FORMATTED_BRANCH}/default.xml?format=TEXT"
         DEPRECATED_MANIFEST_URL="https://android.googlesource.com/kernel/manifest/+/refs/heads/deprecated/common-${FORMATTED_BRANCH}/default.xml?format=TEXT"
         echo "Trying to fetch manifest from $MAIN_MANIFEST_URL"

+ 8 - 5
.github/actions/droidspaces/action.yml

@@ -1,6 +1,9 @@
 name: Setup Droidspaces-OSS
 description: Clone and apply Droidspaces-OSS patches with version-specific fixes
 inputs:
+  version:
+    description: 'Kernel config version (e.g., android15-6.6)'
+    required: true
   android_version:
     description: 'Android version (e.g., android15)'
     required: true
@@ -27,18 +30,18 @@ runs:
       shell: bash
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
-        if [ "${{ inputs.kernel_version }}" == "6.12" ]; then
+        if [ "${{ inputs.version }}" == "android16-6.12" ]; then
           cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/kernel-6.12/001.GKI-6.12-or-above-fix_sysvipc_kabi.patch ./
           patch -p1 < 001.GKI-6.12-or-above-fix_sysvipc_kabi.patch
-        elif [ "${{ inputs.kernel_version }}" == "6.6" ] || [ "${{ inputs.kernel_version }}" == "6.1" ]; then
+        elif [ "${{ inputs.version }}" == "android15-6.6" ] || [ "${{ inputs.version }}" == "android14-6.1" ]; then
           #curl -L https://raw.githubusercontent.com/ravindu644/Droidspaces-OSS/main/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_1_2_3.patch
           #curl -L https://raw.githubusercontent.com/ravindu644/Droidspaces-OSS/main/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_3_4_5.patch
           cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch ./
           patch -p1 < 001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch
-        elif [ "${{ inputs.kernel_version }}" == "5.15" ]; then
+        elif [ "${{ inputs.version }}" == "android14-5.15" ]; then
           cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch ./
           patch -p1 < 001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch
-        elif [ "${{ inputs.kernel_version }}" == "5.10" ]; then
+        elif [ "${{ inputs.version }}" == "android12-5.10" ] || [ "${{ inputs.version }}" == "android13-5.10" ] || [ "${{ inputs.version }}" == "android13-5.15" ]; then
           cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch ./
           patch -p1 < 001.GKI-below-6.12-fix_sysvipc_kabi_6_7_8.patch
           cp ${{ github.workspace }}/Droidspaces-OSS/Documentation/resources/kernel-patches/GKI/below-kernel-6.12/002.5.10_or_lower_use_android_abi_padding_for_posix_mqueue.patch ./
@@ -59,7 +62,7 @@ runs:
 
     - name: Fix 5.10
       shell: bash
-      if: inputs.kernel_version == '5.10' && inputs.android_version == 'android12'
+      if: inputs.version == 'android12-5.10'
       working-directory: ${{ github.workspace }}/kernel
       run: |
         sed -i '/#ifdef CONFIG_PID_NS/,/#else/s/static inline struct pid_namespace \*get_pid_ns(struct pid_namespace \*ns)/extern struct pid_namespace *get_pid_ns(struct pid_namespace *ns);/' common/include/linux/pid_namespace.h

+ 4 - 6
.github/actions/extract-sublevel-file-name/action.yml

@@ -13,9 +13,6 @@ inputs:
   variant:
     required: true
     type: string
-  config_variant:
-    required: false
-    type: string
   sublevel:
     required: true
     type: string
@@ -41,9 +38,10 @@ runs:
           fi
         fi
 
-        FILE_NAME="${{ inputs.kernel_version }}.${SUBLEVEL}-${{ inputs.android_version }}-${{ inputs.os_patch_level }}-${{ inputs.variant }}"
-        if [ -n "${{ inputs.config_variant || '' }}" ]; then
-          FILE_NAME="${FILE_NAME}-${{ inputs.config_variant }}"
+        FILE_NAME="${{ inputs.kernel_version }}.${SUBLEVEL}-${{ inputs.android_version }}-${{ inputs.os_patch_level }}"
+        # Append variant only when it's provided and not the default 'Normal'
+        if [ -n "${{ inputs.variant }}" ] && [ "${{ inputs.variant }}" != "Normal" ]; then
+          FILE_NAME="${FILE_NAME}-${{ inputs.variant }}"
         fi
 
         echo "SUBLEVEL=$SUBLEVEL" >> "$GITHUB_ENV"

+ 8 - 5
.github/actions/kernel-fixes/action.yml

@@ -1,6 +1,9 @@
 name: 'Kernel Fixes'
 description: 'Applies compatibility fixes based on android/kernel/sublevel'
 inputs:
+  version:
+    required: true
+    type: string
   android_version:
     required: true
     type: string
@@ -39,9 +42,9 @@ runs:
             MAKEFILE_FIXED="false"
           fi
           echo "MAKEFILE_FIXED=$MAKEFILE_FIXED" >> $GITHUB_ENV
-          if [[ "${{ inputs.android_version }}" == "android13" && "${{ inputs.kernel_version }}" == "5.10" && "${{ inputs.sublevel }}" -le 186 ]] || \
-             [[ "${{ inputs.android_version }}" == "android13" && "${{ inputs.kernel_version }}" == "5.15" && "${{ inputs.sublevel }}" -le 119 ]] || \
-             [[ "${{ inputs.android_version }}" == "android14" && "${{ inputs.kernel_version }}" == "5.15" && "${{ inputs.sublevel }}" -le 110 ]]; then
+           if [[ "${{ inputs.version }}" == "android13-5.10" && "${{ inputs.sublevel }}" -le 186 ]] || \
+             [[ "${{ inputs.version }}" == "android13-5.15" && "${{ inputs.sublevel }}" -le 119 ]] || \
+             [[ "${{ inputs.version }}" == "android14-5.15" && "${{ inputs.sublevel }}" -le 110 ]]; then
             echo "[INFO] Applying parse-options.c fixes."
             sed -i '/char \*buf = NULL;/a int i;' tools/lib/subcmd/parse-options.c 2>/dev/null || true
             sed -i 's/for (int i = 0; subcommands\[i\]; i++) {/for (i = 0; subcommands[i]; i++) {/' tools/lib/subcmd/parse-options.c 2>/dev/null || true
@@ -57,7 +60,7 @@ runs:
 
     - name: 'Apply mmap.c fix for specific versions'
       shell: bash
-      if: ${{ inputs.kernel_version == '6.6' && inputs.android_version == 'android15' && inputs.sublevel <= '58' }}
+      if: ${{ inputs.version == 'android15-6.6' && inputs.sublevel <= '58' }}
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         echo "[INFO] Checking for android15 + kernel 6.6 include fix..."
@@ -76,7 +79,7 @@ runs:
 
     - name: 'Apply mmap.c fix for specific versions'
       shell: bash
-      if: ${{ (inputs.kernel_version == '5.10' && inputs.android_version == 'android12' && inputs.sublevel == 226) || (inputs.kernel_version == '5.10' && inputs.android_version == 'android13' && inputs.sublevel == 223) || (inputs.kernel_version == '5.15' && inputs.android_version == 'android13' && inputs.sublevel == 167)  || (inputs.kernel_version == '5.10' && inputs.android_version == 'android13' && inputs.sublevel == 223) || (inputs.kernel_version == '5.15' && inputs.android_version == 'android14' && inputs.sublevel == 167) }}
+      if: ${{ (inputs.version == 'android12-5.10' && inputs.sublevel == 226) || (inputs.version == 'android13-5.10' && inputs.sublevel == 223) || (inputs.version == 'android13-5.15' && inputs.sublevel == 167) || (inputs.version == 'android14-5.15' && inputs.sublevel == 167) }}
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         echo "[INFO] Applying mmap.c fix for specific version combo."

+ 8 - 5
.github/actions/misc/action.yml

@@ -1,6 +1,9 @@
 name: 'Setup Misc Configs'
 description: 'Set up kernel configuration fragment with miscellaneous options'
 inputs:
+  version:
+    description: 'Kernel config version (e.g., android14-6.12)'
+    required: true
   kernel_version:
     description: 'Kernel version (e.g., 6.1)'
     required: true
@@ -10,9 +13,9 @@ inputs:
   sublevel:
     description: 'Sublevel of kernel version (e.g., 1)'
     required: true
-  config_variant:
-    description: 'Optional config variant for extra edits'
-    required: false
+  variant:
+    description: 'Build variant (Normal, Bypass, Wild, boot-time)'
+    required: true
 
 runs:
   using: "composite"
@@ -37,7 +40,7 @@ runs:
 
     - name: Add RUST build configs
       shell: bash
-      if: ${{ inputs.kernel_version == '6.12' && inputs.android_version == 'android16' && inputs.sublevel <= '38' }}
+      if: ${{ inputs.version == 'android16-6.12' && inputs.sublevel <= '38' }}
       run: |
         set -euo pipefail
         echo "Add Build based configs"
@@ -48,7 +51,7 @@ runs:
 
     - name: Add boot time build configs
       shell: bash
-      if: ${{ inputs.config_variant == 'boot-time' }}
+      if: ${{ inputs.variant == 'boot-time' }}
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         set -euo pipefail

+ 0 - 40
.github/actions/parse-kernel-version/action.yml

@@ -1,40 +0,0 @@
-name: 'Parse Kernel Version'
-description: 'Parses input kernel_version into kernel/android/patch parts and exports them'
-inputs:
-  kernel_version:
-    required: true
-    type: string
-outputs:
-  android_version:
-    value: ${{ steps.parse.outputs.android_version }}
-  kernel_version:
-    value: ${{ steps.parse.outputs.kernel_version }}
-  sub_level:
-    value: ${{ steps.parse.outputs.sub_level }}
-  os_patch_level:
-    value: ${{ steps.parse.outputs.os_patch_level }}
-
-runs:
-  using: composite
-  steps:
-    - id: parse
-      shell: bash
-      run: |
-        set -euo pipefail
-
-        INPUT_VERSION="${{ inputs.kernel_version }}"
-        IFS='-' read -r KERNEL_PART ANDROID_PART REST <<< "$INPUT_VERSION"
-        KERNEL_VERSION="${KERNEL_PART%.*}"
-        SUB_LEVEL="${KERNEL_PART##*.}"
-        ANDROID_VERSION="$ANDROID_PART"
-        OS_PATCH_LEVEL="$REST"
-
-        echo "ANDROID_VERSION=$ANDROID_VERSION" >> "$GITHUB_ENV"
-        echo "KERNEL_VERSION=$KERNEL_VERSION" >> "$GITHUB_ENV"
-        echo "SUB_LEVEL=$SUB_LEVEL" >> "$GITHUB_ENV"
-        echo "OS_PATCH_LEVEL=$OS_PATCH_LEVEL" >> "$GITHUB_ENV"
-
-        echo "android_version=$ANDROID_VERSION" >> "$GITHUB_OUTPUT"
-        echo "kernel_version=$KERNEL_VERSION" >> "$GITHUB_OUTPUT"
-        echo "sub_level=$SUB_LEVEL" >> "$GITHUB_OUTPUT"
-        echo "os_patch_level=$OS_PATCH_LEVEL" >> "$GITHUB_OUTPUT"

+ 23 - 20
.github/actions/susfs/action.yml

@@ -1,6 +1,9 @@
 name: Setup SUSFS
 description: Clone and apply SUSFS patches with version-specific fixes
 inputs:
+  version:
+    description: 'Kernel config version (e.g., android15-6.6)'
+    required: true
   android_version:
     description: 'Android version (e.g., android15)'
     required: true
@@ -22,7 +25,7 @@ runs:
       run: |
         set -euo pipefail
 
-        SUSFS_BRANCH="gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}"
+        SUSFS_BRANCH="gki-${{ inputs.version }}"
         SUSFS_REPO="https://gitlab.com/simonpunk/susfs4ksu.git"        
         COMMITS_JSON="${{ github.workspace }}/.github/config/commits.json"
 
@@ -66,11 +69,11 @@ runs:
         # Apply base SUSFS patches
         cp "${{ github.workspace }}/susfs4ksu/kernel_patches/fs/"* "${{ github.workspace }}/kernel/common/fs/"
         cp "${{ github.workspace }}/susfs4ksu/kernel_patches/include/linux/"* "${{ github.workspace }}/kernel/common/include/linux/"
-        cp ${{ github.workspace }}/susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch ./
+        cp ${{ github.workspace }}/susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ inputs.version }}.patch ./
 
     - name: Apply Android 12 5.10 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '5.10' && inputs.android_version == 'android12'
+      if: inputs.version == 'android12-5.10'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         if [ "${{ inputs.sublevel }}" -le "43" ]; then
@@ -86,7 +89,7 @@ runs:
 
     - name: Apply Android 13 5.10 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '5.10' && inputs.android_version == 'android13'
+      if: inputs.version == 'android13-5.10'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         echo "Applying Android 13 5.10 SUSFS fixes"
@@ -99,7 +102,7 @@ runs:
 
     - name: Apply Android 13 5.15 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '5.15' && inputs.android_version == 'android13'
+      if: inputs.version == 'android13-5.15'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         echo "Applying Android 13 5.15 SUSFS fixes"
@@ -118,7 +121,7 @@ runs:
 
     - name: Apply Android 14 6.1 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '6.1' && inputs.android_version == 'android14'
+      if: inputs.version == 'android14-6.1'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         if [ "${{ inputs.sublevel }}" -le "25" ]; then
@@ -136,7 +139,7 @@ runs:
 
     - name: Apply Android 15 6.6 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '6.6' && inputs.android_version == 'android15'
+      if: inputs.version == 'android15-6.6'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         echo "Applying 6.6 SUSFS fixes"
@@ -157,7 +160,7 @@ runs:
 
     - name: Apply Android 16 6.12 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '6.12' && inputs.android_version == 'android16'
+      if: inputs.version == 'android16-6.12'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         echo "Applying 6.12 SUSFS fixes"
@@ -174,11 +177,11 @@ runs:
       shell: bash
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
-        patch -p1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
+        patch -p1 < 50_add_susfs_in_gki-${{ inputs.version }}.patch || true
 
     - name: Revert Android 12 5.10 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '5.10' && inputs.android_version == 'android12'
+      if: inputs.version == 'android12-5.10'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         if [ "${{ inputs.sublevel }}" -le "43" ]; then
@@ -194,7 +197,7 @@ runs:
 
     - name: Revert Android 13 5.10 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '5.10' && inputs.android_version == 'android13'
+      if: inputs.version == 'android13-5.10'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         if [ "${{ inputs.sublevel }}" -le "107" ]; then
@@ -206,7 +209,7 @@ runs:
 
     - name: Revert Android 13 5.15 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '5.15' && inputs.android_version == 'android13'
+      if: inputs.version == 'android13-5.15'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         if [ "${{ inputs.sublevel }}" -le "41" ]; then
@@ -226,7 +229,7 @@ runs:
 
     - name: Revert Android 14 6.1 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '6.1' && inputs.android_version == 'android14'
+      if: inputs.version == 'android14-6.1'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         if [ "${{ inputs.sublevel }}" -le "25" ]; then
@@ -243,7 +246,7 @@ runs:
 
     - name: Revert Android 15 6.6 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '6.6' && inputs.android_version == 'android15'
+      if: inputs.version == 'android15-6.6'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         echo "Reverting 6.6 Fake Patches"
@@ -259,7 +262,7 @@ runs:
 
     - name: Revert Android 16 6.12 Fake Patches
       shell: bash
-      if: inputs.kernel_version == '6.12' && inputs.android_version == 'android16'
+      if: inputs.version == 'android16-6.12'
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         echo "Reverting 6.12 Fake Patches"
@@ -278,15 +281,15 @@ runs:
       working-directory: ${{ github.workspace }}/kernel/common
       run: |
         SHOW_PAD_FIX=0
-        if [[ "${{ inputs.android_version }}" = "android12" && "${{ inputs.kernel_version }}" = "5.10" && "${{ inputs.sublevel }}" -le 209 ]]; then
+        if [[ "${{ inputs.version }}" = "android12-5.10" && "${{ inputs.sublevel }}" -le 209 ]]; then
           SHOW_PAD_FIX=1
-        elif [[ "${{ inputs.android_version }}" = "android13" && "${{ inputs.kernel_version }}" = "5.10" && "${{ inputs.sublevel }}" -le 209 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
+        elif [[ "${{ inputs.version }}" = "android13-5.10" && "${{ inputs.sublevel }}" -le 209 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
           SHOW_PAD_FIX=1
-        elif [[ "${{ inputs.android_version }}" = "android13" && "${{ inputs.kernel_version }}" = "5.15" && "${{ inputs.sublevel }}" -le 148 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
+        elif [[ "${{ inputs.version }}" = "android13-5.15" && "${{ inputs.sublevel }}" -le 148 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
           SHOW_PAD_FIX=1
-        elif [[ "${{ inputs.android_version }}" = "android14" && "${{ inputs.kernel_version }}" = "5.15" && "${{ inputs.sublevel }}" -le 148 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
+        elif [[ "${{ inputs.version }}" = "android14-5.15" && "${{ inputs.sublevel }}" -le 148 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
           SHOW_PAD_FIX=1
-        elif [[ "${{ inputs.android_version }}" = "android14" && "${{ inputs.kernel_version }}" = "6.1" && "${{ inputs.sublevel }}" -le 75 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
+        elif [[ "${{ inputs.version }}" = "android14-6.1" && "${{ inputs.sublevel }}" -le 75 && "${{ inputs.os_patch_level }}" != "2024-05" ]]; then
           SHOW_PAD_FIX=1
         fi
 

+ 14 - 8
.github/workflows/build.yml

@@ -6,6 +6,9 @@ permissions:
 on:
   workflow_call:
     inputs:
+      version:
+        required: true
+        type: string
       android_version:
         required: true
         type: string
@@ -21,9 +24,6 @@ on:
       variant:
         required: false
         type: string
-      config_variant:
-        required: false
-        type: string
       feature_set:
         required: true
         type: string
@@ -33,7 +33,7 @@ on:
 
 jobs:
   build-gki:
-    name: "${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sublevel }}-${{ inputs.os_patch_level }} (${{ inputs.variant }} / ${{ inputs.config_variant || 'base' }})"
+    name: "${{ inputs.kernel_version }}.${{ inputs.sublevel }}-${{ inputs.android_version }}-${{ inputs.os_patch_level }} (${{ inputs.variant }})"
     runs-on: ubuntu-latest
     timeout-minutes: 60
 
@@ -70,6 +70,7 @@ jobs:
     - name: Download Kernel Repository
       uses: ./.github/actions/download-kernel
       with:
+        version: ${{ inputs.version }}
         android_version: ${{ inputs.android_version }}
         kernel_version: ${{ inputs.kernel_version }}
         os_patch_level: ${{ inputs.os_patch_level }}
@@ -84,11 +85,11 @@ jobs:
         sublevel: ${{ inputs.sublevel }}
         os_patch_level: ${{ inputs.os_patch_level }}
         variant: ${{ inputs.variant }}
-        config_variant: ${{ inputs.config_variant }}
 
     - name: Kernel Fixes
       uses: ./.github/actions/kernel-fixes
       with:
+        version: ${{ inputs.version }}
         android_version: ${{ inputs.android_version }}
         kernel_version: ${{ inputs.kernel_version }}
         sublevel: ${{ steps.extract.outputs.sublevel }}
@@ -102,6 +103,7 @@ jobs:
       if: contains(inputs.feature_set, 'SUSFS') || inputs.feature_set == 'FULL'
       uses: ./.github/actions/susfs
       with:
+        version: ${{ inputs.version }}
         android_version: ${{ inputs.android_version }}
         kernel_version: ${{ inputs.kernel_version }}
         os_patch_level: ${{ inputs.os_patch_level }}
@@ -122,15 +124,17 @@ jobs:
       if: contains(inputs.feature_set, 'DS') || inputs.feature_set == 'FULL'
       uses: ./.github/actions/droidspaces
       with:
+        version: ${{ inputs.version }}
         kernel_version: ${{ inputs.kernel_version }}
 
     - name: Setup Misc Configs
       uses: ./.github/actions/misc
       with:
+        version: ${{ inputs.version }}
         kernel_version: ${{ inputs.kernel_version }}
         android_version: ${{ inputs.android_version }}
         sublevel: ${{ steps.extract.outputs.sublevel }}
-        config_variant: ${{ inputs.config_variant }}
+        variant: ${{ inputs.variant }}
 
     - name: Apply Module Check Bypass
       if: ${{ inputs.variant == 'Bypass' }}
@@ -141,6 +145,7 @@ jobs:
     - name: Apply Device-Specific Patches
       uses: ./.github/actions/apply-device-patches
       with:
+        version: ${{ inputs.version }}
         kernel_version: ${{ inputs.kernel_version }}
 
     - name: Apply ABI Compare Bypass
@@ -194,8 +199,9 @@ jobs:
     - name: 'Setup Cache and Build Environment'
       uses: ./.github/actions/cache-setup
       with:
-        android_version: ${{ steps.parse.outputs.android_version }}
-        kernel_version: ${{ steps.parse.outputs.kernel_version }}
+        version: ${{ inputs.version }}
+        android_version: ${{ inputs.android_version }}
+        kernel_version: ${{ inputs.kernel_version }}
         sublevel: ${{ steps.extract.outputs.sublevel }}
 
     - name: Restore build caches (ccache, bazel, bazel-disk, lto)

+ 10 - 10
.github/workflows/prepare.yml

@@ -48,12 +48,10 @@ jobs:
             VARIANTS=$(jq -cn --arg v "${{ inputs.variant }}" '[$v]')
           fi
 
-          # Build { "include": [ {kernel_version:..., variant: ...}, ... ] }
+          # Build { "include": [ {android_version:..., kernel_version:..., sublevel:..., os_patch_level:..., variant: ...}, ... ] }
           FINAL=$(jq -cn \
             --argjson cfg "$CONFIG_JSON" \
             --argjson variants "$VARIANTS" '
-            def dedup($items): reduce $items[] as $item ([]; if any(.[]; . == $item) then . else . + [$item] end);
-
             ($cfg.version | split("-")) as $version_parts
             | {
               include: (
@@ -61,6 +59,7 @@ jobs:
                   $cfg.include[] as $item
                   | $variants[] as $build_variant
                   | {
+                      version: $cfg.version,
                       android_version: $version_parts[0],
                       kernel_version: $version_parts[1],
                       sublevel: $item.sublevel,
@@ -69,17 +68,18 @@ jobs:
                     }
                 ]
                 + [
-                  $cfg.include[]
-                  | select(.variant != null)
+                  $cfg.include[] as $item
+                  | select($item.variant != null)
                   | {
+                      version: $cfg.version,
                       android_version: $version_parts[0],
                       kernel_version: $version_parts[1],
-                      sublevel: .sublevel,
-                      os_patch_level: .date,
-                      variant: "Normal",
-                      config_variant: .variant
+                      sublevel: $item.sublevel,
+                      os_patch_level: $item.date,
+                      variant: $item.variant
                     }
                 ]
+                | unique_by([.android_version, .kernel_version, .sublevel, .os_patch_level, .variant])
               )
             }')
 
@@ -92,12 +92,12 @@ jobs:
       matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
     uses: ./.github/workflows/build.yml
     with:
+      version: ${{ matrix.version }}
       android_version: ${{ matrix.android_version }}
       kernel_version: ${{ matrix.kernel_version }}
       sublevel: ${{ matrix.sublevel }}
       os_patch_level: ${{ matrix.os_patch_level }}
       variant: ${{ matrix.variant }}
-      config_variant: ${{ matrix.config_variant || '' }}
       feature_set: ${{ inputs.feature_set }}
       use_repo: ${{ inputs.use_repo }}
     secrets: inherit