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

Optimize artifact zipping: Upload AnyKernel3 directories and create ZIPs in release workflow

- Modified build.yml to upload AnyKernel3 directory instead of pre-zipped files
- Updated main.yml to create ZIP files from directories during release upload
- Prevents double-zipping issue where downloaded artifacts were compressed twice
TheWildJames 11 месяцев назад
Родитель
Сommit
ffe86498d5
2 измененных файлов с 15 добавлено и 19 удалено
  1. 3 14
      .github/workflows/build.yml
  2. 12 5
      .github/workflows/main.yml

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

@@ -405,7 +405,7 @@ jobs:
             tools/bazel build --config=fast --lto=thin //common:kernel_aarch64_dist || exit 1
           fi
 
-      - name: Create AK3 ZIP
+      - name: Prepare AnyKernel3
         run: |
           # Copy Image from normal build locations
           if [ -f "./$CONFIG/out/${{ inputs.android_version }}-${{ inputs.kernel_version }}/dist/Image" ]; then
@@ -417,17 +417,6 @@ jobs:
             exit 1
           fi
 
-          cd AnyKernel3
-          
-          # Use actual sublevel for LTS builds if available
-          SUBLEVEL_FOR_NAME="${{ inputs.sub_level }}"
-          if [ -n "$ACTUAL_SUBLEVEL" ]; then
-            SUBLEVEL_FOR_NAME="$ACTUAL_SUBLEVEL"
-          fi
-          
-          ZIP_NAME="WKSU-$KSUVER-${{ inputs.android_version }}-${{ inputs.kernel_version }}.$SUBLEVEL_FOR_NAME-${{ inputs.os_patch_level }}-${{ matrix.apply_module_check_bypass && 'Module_Check_Bypass' || 'Normal' }}-AnyKernel3.zip"
-          zip -r "../$ZIP_NAME" ./*
-
       - name: Create Bootimgs Folder and Copy Images for Android 12/13
         if: ${{ inputs.android_version == 'android12' || inputs.android_version == 'android13' }}
         run: |
@@ -537,11 +526,11 @@ jobs:
           $AVBTOOL add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key $BOOT_SIGN_KEY_PATH
           cp ./boot-lz4.img ../WKSU-$KSUVER-${{ inputs.android_version }}-${{ inputs.kernel_version }}.$SUBLEVEL_FOR_NAME-${{ inputs.os_patch_level }}-${{ matrix.apply_module_check_bypass && 'Module_Check_Bypass' || 'Normal' }}-boot-lz4.img
           
-      - name: Upload AnyKernel3 ZIP
+      - name: Upload AnyKernel3 Files
         uses: actions/upload-artifact@v4
         with:
           name: WKSU-${{ env.KSUVER }}-${{ 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' }}-AnyKernel3
-          path: "*.zip"
+          path: AnyKernel3/
           compression-level: 0
 
       - name: Upload Patch Rejects (if any)

+ 12 - 5
.github/workflows/main.yml

@@ -206,12 +206,19 @@ jobs:
       - name: Upload Release Assets
         if: inputs.release_type != 'Actions'
         run: |
-          for file in ./downloaded-artifacts/*/*; do
-            if [ -d "$file" ]; then
-              continue
+          for dir in ./downloaded-artifacts/*/; do
+            if [ -d "$dir" ]; then
+              # Get the directory name without path
+              dirname=$(basename "$dir")
+              
+              # Create ZIP from AnyKernel3 directory
+              cd "$dir"
+              zip -r "../../${dirname}.zip" ./*
+              cd - > /dev/null
+              
+              echo "Created and uploading ${dirname}.zip..."
+              gh release upload ${{ env.NEW_TAG }} "${dirname}.zip"
             fi
-            echo "Uploading $file..."
-            gh release upload ${{ env.NEW_TAG }} "$file"
           done
 
       - name: Display Files Uploaded