Ver Fonte

ci(build): refactor artifact naming logic in workflow

Move sublevel preparation logic to the beginning of the job to avoid duplication and improve maintainability. The change ensures consistent artifact naming while reducing redundant code.
TheWildJames há 11 meses atrás
pai
commit
4fae508213
1 ficheiros alterados com 6 adições e 13 exclusões
  1. 6 13
      .github/workflows/build.yml

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

@@ -413,7 +413,12 @@ jobs:
       - name: Set file name
         run: |
           # Set artifact name base for consistent naming
-          ARTIFACT_BASE="WKSU-${{ env.KSUVER }}-${{ matrix.apply_susfs_v1_5_9 && 'SUSFS_v1.5.9' || 'SUSFS_v1.5.12' }}-${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ env.ACTUAL_SUBLEVEL || inputs.sub_level }}-${{ inputs.os_patch_level }}-${{ matrix.apply_module_check_bypass && 'Module_Check_Bypass' || 'Normal' }}"
+          # Prepare sublevel for naming
+          SUBLEVEL_FOR_NAME="${{ inputs.sub_level }}"
+          if [ -n "$ACTUAL_SUBLEVEL" ]; then
+            SUBLEVEL_FOR_NAME="$ACTUAL_SUBLEVEL"
+          fi
+          ARTIFACT_BASE="WKSU-${{ env.KSUVER }}-${{ matrix.apply_susfs_v1_5_9 && 'SUSFS_v1.5.9' || 'SUSFS_v1.5.12' }}-${{ inputs.android_version }}-${{ inputs.kernel_version }}.${SUBLEVEL_FOR_NAME}-${{ inputs.os_patch_level }}-${{ matrix.apply_module_check_bypass && 'Module_Check_Bypass' || 'Normal' }}"
           echo "ARTIFACT_BASE=$ARTIFACT_BASE" >> $GITHUB_ENV
           echo "FILE_NAME=$ARTIFACT_BASE" >> $GITHUB_ENV
 
@@ -465,12 +470,6 @@ jobs:
           echo "Changing to configuration directory: $CONFIG..."
           cd bootimgs
           
-          # Prepare sublevel for naming
-          SUBLEVEL_FOR_NAME="${{ inputs.sub_level }}"
-          if [ -n "$ACTUAL_SUBLEVEL" ]; then
-            SUBLEVEL_FOR_NAME="$ACTUAL_SUBLEVEL"
-          fi
-          
           GKI_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-"${{ inputs.os_patch_level }}"_r1.zip
           FALLBACK_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-2023-01_r1.zip
           
@@ -516,12 +515,6 @@ jobs:
         if: ${{ inputs.android_version == 'android13' || inputs.android_version == 'android14' || inputs.android_version == 'android15' }}
         run: |
           cd bootimgs
-
-          # Prepare sublevel for naming
-          SUBLEVEL_FOR_NAME="${{ inputs.sub_level }}"
-          if [ -n "$ACTUAL_SUBLEVEL" ]; then
-            SUBLEVEL_FOR_NAME="$ACTUAL_SUBLEVEL"
-          fi
           
           echo "Building boot.img"
           $MKBOOTIMG --header_version 4 --kernel Image --output boot.img