Ver Fonte

feat(rejects): streamline reject artifact processing and summary reporting

TheWildJames há 3 meses atrás
pai
commit
1918d078fc
1 ficheiros alterados com 15 adições e 38 exclusões
  1. 15 38
      .github/workflows/main.yml

+ 15 - 38
.github/workflows/main.yml

@@ -154,53 +154,34 @@ jobs:
     - name: Process Reject Artifacts
       run: |
         mkdir -p aio-rejects
-        
+
         # Iterate over Rejects artifacts in downloaded-artifacts
         for dir in ./downloaded-artifacts/*-Rejects; do
-            # Ensure it is a directory
             [ -d "$dir" ] || continue
-            
+
             dirname=$(basename "$dir")
-            # Process each reject artifact
-            
-            # Get original name (remove -Rejects suffix)
             original_name=${dirname%-Rejects}
-            
+
             mkdir -p "aio-rejects/$original_name"
-            
-            # Check for patch-rejects folder (legacy structure) or direct contents
+
             if [ -d "$dir/patch-rejects" ]; then
-              # Legacy structure
-                cp -r "$dir/patch-rejects/." "aio-rejects/$original_name/"
+              cp -r "$dir/patch-rejects/." "aio-rejects/$original_name/"
             else
-              # Current structure
-                cp -r "$dir/." "aio-rejects/$original_name/"
+              cp -r "$dir/." "aio-rejects/$original_name/"
             fi
         done
-        
-        # Zip and upload if we found anything
-          KSUN_BRANCH="dev"
-            # Create a single zip of all rejects
-          if [ "${{ inputs.use_latest_commits }}" = "true" ]; then
-            echo "Cloning KernelSU-Next from full branch tip: $KSUN_BRANCH"
-            git clone --branch "$KSUN_BRANCH" https://github.com/KernelSU-Next/KernelSU-Next.git /tmp/kernelsu-next
-          else
-            echo "Cloning KernelSU-Next from branch: $KSUN_BRANCH"
-            git clone --depth=1 --branch "$KSUN_BRANCH" https://github.com/KernelSU-Next/KernelSU-Next.git /tmp/kernelsu-next
-          fi
+
+        if [ "$(ls -A aio-rejects)" ]; then
+            cd aio-rejects
+            zip -r -q -9 ../AIO-REJ.zip .
+            cd ..
         else
             echo "No rejects found to upload."
         fi
-          if [ "${{ inputs.use_latest_commits }}" = "true" ]; then
-            KSUN_COMMIT=$(git rev-parse HEAD)
-          else
-            KSUN_COMMIT=$(jq -er '.kernelsu.dev' "$COMMITS_JSON_PATH")
-
-            # Checkout the specific commit
-            echo "Checking out commit: $KSUN_COMMIT"
-            git fetch --depth=50 origin "$KSUN_COMMIT"
-            git checkout "$KSUN_COMMIT"
-          fi
+
+    - name: Rejects Summary
+      run: |
+        echo "Reject artifacts were collected locally only and are not uploaded." >> "$GITHUB_STEP_SUMMARY"
 
     - name: Upload AIO-REJ Artifact
       uses: actions/upload-artifact@v7
@@ -245,19 +226,16 @@ jobs:
         if [ "${{ inputs.use_latest_commits }}" = "true" ]; then
           KSUN_COMMIT=$(git rev-parse HEAD)
         else
-          # Extract KernelSU commit and branch from commits config
           KSUN_COMMIT=$(jq -er '.kernelsu.dev' "$COMMITS_JSON_PATH")
           echo "Checking out commit: $KSUN_COMMIT"
           git fetch --depth=50 origin "$KSUN_COMMIT"
           git checkout "$KSUN_COMMIT"
         fi
 
-        # Extract version info
         COMMITS_COUNT=$(git rev-list --count HEAD)
         BASE_VERSION=30000
         KSU_VERSION=$(expr $COMMITS_COUNT "+" $BASE_VERSION)
 
-        # Extract git tag
         KSU_GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "no-tag")
 
         MANAGER_RUN_ID=$(curl -fsSL "https://api.github.com/repos/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml/runs?head_sha=${KSUN_COMMIT}" | jq -r '.workflow_runs[0].id // empty')
@@ -272,7 +250,6 @@ jobs:
         echo "KSU Git Tag: $KSU_GIT_TAG"
         echo "KSU Manager: $KSU_MANAGER"
 
-        # Export as environment for next step
         echo "KSUN_BRANCH=$KSUN_BRANCH" >> $GITHUB_ENV
         echo "KSUN_COMMIT=$KSUN_COMMIT" >> $GITHUB_ENV
         echo "KSU_COMMITS_COUNT=$COMMITS_COUNT" >> $GITHUB_ENV