Przeglądaj źródła

feat(ci): add Wild variant to build matrix and branding logic

Add a new 'Wild' variant to the GitHub Actions build matrix and update the kernel branding action to handle it. The action now conditionally modifies the kernel version string and configuration based on the variant input, ensuring the 'Wild' branding is applied correctly for the new build type.
TheWildJames 4 miesięcy temu
rodzic
commit
d15a8d3795

+ 33 - 4
.github/actions/apply-kernel-branding/action.yml

@@ -1,5 +1,15 @@
 name: 'Apply Kernel Branding & Timestamp'
 name: 'Apply Kernel Branding & Timestamp'
 description: 'Apply Wild kernel branding to kernel version string'
 description: 'Apply Wild kernel branding to kernel version string'
+inputs:
+  variant:
+    description: 'Variant of kernel to apply branding to'
+    required: true
+  kernel_version:
+    description: 'Kernel version (e.g., 6.1)'
+    required: true
+  android_version:
+    description: 'Android version (e.g., android14)'
+    required: true
 
 
 runs:
 runs:
   using: "composite"
   using: "composite"
@@ -13,17 +23,27 @@ runs:
 
 
         DEFCONFIG="${GITHUB_WORKSPACE}/kernel/common/arch/arm64/configs/gki_defconfig"
         DEFCONFIG="${GITHUB_WORKSPACE}/kernel/common/arch/arm64/configs/gki_defconfig"
 
 
-        if grep -q '^CONFIG_LOCALVERSION=' "$DEFCONFIG"; then
-          LOCALVERSION_VALUE="$(grep -m1 '^CONFIG_LOCALVERSION=' "$DEFCONFIG" | sed -E 's/^CONFIG_LOCALVERSION="?([^"]*)"?$/\1/')"
-          echo "CONFIG_LOCALVERSION=\"${LOCALVERSION_VALUE}-Wild\"" >> "$CONFIG_FRAGMENT"
+        if [ "${{ inputs.variant }}" = "Wild" ]; then
+          sed -i '${/^echo /d;}' scripts/setlocalversion
+          if [ "${{ inputs.kernel_version }}" -gt "6.6" ]; then
+            echo 'echo "${KERNELVERSION}-Wild"'
+          else
+            echo 'echo "-Wild"'
+          fi
         else
         else
-          echo 'CONFIG_LOCALVERSION="-Wild"' >> "$CONFIG_FRAGMENT"
+          if grep -q '^CONFIG_LOCALVERSION=' "$DEFCONFIG"; then
+            LOCALVERSION_VALUE="$(grep -m1 '^CONFIG_LOCALVERSION=' "$DEFCONFIG" | sed -E 's/^CONFIG_LOCALVERSION="?([^"]*)"?$/\1/')"
+           echo "CONFIG_LOCALVERSION=\"${LOCALVERSION_VALUE}-Wild\"" >> "$CONFIG_FRAGMENT"
+          else
+            echo 'CONFIG_LOCALVERSION="-Wild"' >> "$CONFIG_FRAGMENT"
+          fi
         fi
         fi
 
 
         : > .scmversion
         : > .scmversion
 
 
         echo "Getting last commit timestamp from kernel source..."
         echo "Getting last commit timestamp from kernel source..."
 
 
+
         COMMIT_TIMESTAMP=$(git log -1 --format=%ct 2>/dev/null || echo "$(date +%s)")
         COMMIT_TIMESTAMP=$(git log -1 --format=%ct 2>/dev/null || echo "$(date +%s)")
         KERNEL_BUILD_DATE=$(date -u)
         KERNEL_BUILD_DATE=$(date -u)
 
 
@@ -32,3 +52,12 @@ runs:
         
         
         export KBUILD_BUILD_TIMESTAMP="$KERNEL_BUILD_DATE"
         export KBUILD_BUILD_TIMESTAMP="$KERNEL_BUILD_DATE"
         echo "KBUILD_BUILD_TIMESTAMP=$KERNEL_BUILD_DATE" >> $GITHUB_ENV
         echo "KBUILD_BUILD_TIMESTAMP=$KERNEL_BUILD_DATE" >> $GITHUB_ENV
+
+    - name: Apply Kernel Configuration
+      if: "${{ inputs.variant }}" == "Wild"
+      shell: bash
+      run: |
+        cat >> "${{ github.workspace }}/wild_gki.fragment" << 'EOF'
+        CONFIG_LOCALVERSION=""
+        # CONFIG_LOCALVERSION_AUTO is not set
+        EOF

+ 0 - 1
.github/actions/misc/action.yml

@@ -25,5 +25,4 @@ runs:
         CONFIG_KALLSYMS_ALL=y
         CONFIG_KALLSYMS_ALL=y
 
 
         # CONFIG_TRIM_UNUSED_KSYMS is not set
         # CONFIG_TRIM_UNUSED_KSYMS is not set
-        CONFIG_MODULE_SIG_PROTECT_LIST=""
         EOF
         EOF

+ 6 - 2
.github/workflows/build.yml

@@ -34,7 +34,7 @@ jobs:
     strategy:
     strategy:
       fail-fast: false
       fail-fast: false
       matrix:
       matrix:
-        variant: ['Normal', 'Bypass']
+        variant: ['Normal', 'Bypass', 'Wild']
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     timeout-minutes: 60
     timeout-minutes: 60
 
 
@@ -164,7 +164,11 @@ jobs:
 
 
     - name: Apply Kernel Branding
     - name: Apply Kernel Branding
       uses: ./.github/actions/apply-kernel-branding
       uses: ./.github/actions/apply-kernel-branding
-      
+      with:
+        variant: ${{ matrix.variant }}
+        kernel_version: ${{ steps.parse.outputs.kernel_version }}
+        android_version: ${{ steps.parse.outputs.android_version }}
+
     - name: Remove Protected Exports
     - name: Remove Protected Exports
       uses: ./.github/actions/remove-protected-exports
       uses: ./.github/actions/remove-protected-exports
 
 

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+OnePlus_KernelSU_SUSFS/
+6.12/