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

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 11 месяцев назад
Родитель
Сommit
4fae508213
1 измененных файлов с 6 добавлено и 13 удалено
  1. 6 13
      .github/workflows/build.yml

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

@@ -413,7 +413,12 @@ jobs:
       - name: Set file name
       - name: Set file name
         run: |
         run: |
           # Set artifact name base for consistent naming
           # 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 "ARTIFACT_BASE=$ARTIFACT_BASE" >> $GITHUB_ENV
           echo "FILE_NAME=$ARTIFACT_BASE" >> $GITHUB_ENV
           echo "FILE_NAME=$ARTIFACT_BASE" >> $GITHUB_ENV
 
 
@@ -465,12 +470,6 @@ jobs:
           echo "Changing to configuration directory: $CONFIG..."
           echo "Changing to configuration directory: $CONFIG..."
           cd bootimgs
           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
           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
           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' }}
         if: ${{ inputs.android_version == 'android13' || inputs.android_version == 'android14' || inputs.android_version == 'android15' }}
         run: |
         run: |
           cd bootimgs
           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"
           echo "Building boot.img"
           $MKBOOTIMG --header_version 4 --kernel Image --output boot.img
           $MKBOOTIMG --header_version 4 --kernel Image --output boot.img