Skip to content

Commit cd5bd1b

Browse files
authored
refactor: flat artifacts via archive:false, skip-decompress, parse zip names (#136)
Changes in action.yml: - Create Kernel ZIP: mv metadata txt from ARTIFACTS_FOLDER to AK3_FOLDER before zip creation so it's included in AK3 zip - find -delete: removed obsolete txt exclusion - Upload Artifacts: name set to ZIP_NAME, path changed to exact zip file, added archive: false to prevent container wrapping - Final Build Summary: added Artifact Name row to both GITHUB_STEP_SUMMARY and summary.txt Changes in build-kernel-release.yml: -Download Artifacts: replaced download-artifact v4 with v8 using merge-multiple and skip-decompress to get all files flat -matrix.json path updated from build-matrix/matrix.json to matrix.json (flat) -Release notes loop: replaced txt-based parsing with zip filename parsing -Upload assets loop: simplified from /.zip to *.zip flat -Release summary: Kernels count and Assets loop updated to use flat *.zip pattern with maxdepth 1
1 parent 31d7b18 commit cd5bd1b

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

.github/actions/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,7 @@ runs:
16031603
fi
16041604
16051605
cp "$IMAGE_PATH" "$AK3_FOLDER/Image"
1606+
mv "${ARTIFACTS_FOLDER}/${OP_MODEL}_${OP_OS_VERSION}.txt" "$AK3_FOLDER/"
16061607
cd "$AK3_FOLDER"
16071608
16081609
if [ "${{ env.OP_SUSFS }}" = true ]; then
@@ -1624,7 +1625,7 @@ runs:
16241625
16251626
mv "$ZIP_NAME" "$ARTIFACTS_FOLDER/"
16261627
1627-
find "$ARTIFACTS_FOLDER" -maxdepth 1 -type f ! -name "$ZIP_NAME" ! -name "${OP_MODEL}_${OP_OS_VERSION}.txt" -delete
1628+
find "$ARTIFACTS_FOLDER" -maxdepth 1 -type f ! -name "$ZIP_NAME" -delete
16281629
16291630
ZIP_SIZE=$(stat -c%s "$ARTIFACTS_FOLDER/$ZIP_NAME")
16301631
ZIP_SHA256=$(sha256sum "$ARTIFACTS_FOLDER/$ZIP_NAME" | awk '{print $1}')
@@ -1690,6 +1691,7 @@ runs:
16901691
else
16911692
echo "ccache: Disabled (clean build)"
16921693
fi
1694+
echo "Artifact Name: ${{ env.ZIP_NAME }}"
16931695
} | tee summary.txt
16941696
16951697
{
@@ -1759,13 +1761,15 @@ runs:
17591761
echo "| **Image SHA256** | \`${{ steps.collect_stats.outputs.image_sha256 }}\` |"
17601762
echo "| **Warnings** | ${{ steps.collect_stats.outputs.warnings_count }} |"
17611763
echo "| **Compiler** | \`${CLANG_VERSION:-unknown}\` |"
1764+
echo "| **Artifact Name** | \`${{ env.ZIP_NAME }}\` |"
17621765
} >> "$GITHUB_STEP_SUMMARY"
17631766
17641767
- name: Upload Artifacts
17651768
if: success() && steps.create_zip.conclusion == 'success'
17661769
uses: actions/upload-artifact@v7
17671770
with:
1768-
name: kernel-${{ inputs.ksu_type }}-${{ env.CONFIG }}_${{ env.OP_OS_VERSION }}
1769-
path: ${{ env.ARTIFACTS_FOLDER }}/
1771+
name: ${{ env.ZIP_NAME }}
1772+
path: ${{ env.ARTIFACTS_FOLDER }}/${{ env.ZIP_NAME }}
1773+
archive: false
17701774
compression-level: 0
17711775
retention-days: 90

.github/workflows/build-kernel-release.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,11 @@ jobs:
560560
git push origin $NEW_TAG
561561
562562
- name: 📥 Download Artifacts
563-
uses: actions/download-artifact@v4
563+
uses: actions/download-artifact@v8
564564
with:
565565
path: ./downloaded-artifacts
566+
merge-multiple: true
567+
skip-decompress: true
566568

567569
- name: 📝 Generate Device List and Final Release Notes
568570
id: generate-notes
@@ -572,17 +574,24 @@ jobs:
572574
# Collect build metadata
573575
declare -A device_info
574576
575-
JSON_BUILD_DATA=$(jq -c '.' ./downloaded-artifacts/build-matrix/matrix.json)
577+
JSON_BUILD_DATA=$(jq -c '.' ./downloaded-artifacts/matrix.json)
576578
577-
for file in $(find downloaded-artifacts -name "*.txt" -type f | sort); do
579+
for file in $(find downloaded-artifacts -maxdepth 1 -name "*.zip" -type f | sort); do
578580
if [ -f "$file" ]; then
579-
full_model=$(basename "$file" .txt)
580-
model=$(echo "$full_model" | sed -E 's/_[^_]*$//')
581-
kernel_version=$(sed -n '1p' "$file")
582-
os_version=$(sed -n '2p' "$file")
583-
ksu_type=$(sed -n '3p' "$file")
584-
ksu_ver=$(sed -n '4p' "$file")
585-
susfs_ver=$(sed -n '5p' "$file")
581+
zipname=$(basename "$file" .zip)
582+
rest="${zipname#AK3_}"
583+
IFS='_' read -ra parts <<< "$rest"
584+
model="${parts[0]}"
585+
os_version="${parts[1]}"
586+
kernel_version="${parts[2]}"
587+
ksu_type="${parts[3]}"
588+
ksu_ver="${parts[4]}"
589+
if [ "${parts[5]:-}" = "SuSFS" ]; then
590+
susfs_ver="${parts[6]:-unknown}"
591+
else
592+
susfs_ver="none"
593+
fi
594+
full_model="${model}_${os_version}"
586595
device_info["$full_model"]="$model|$os_version|$kernel_version|$ksu_type|$ksu_ver|$susfs_ver"
587596
fi
588597
done
@@ -860,7 +869,7 @@ jobs:
860869
861870
- name: 📤 Upload Release Assets Dynamically
862871
run: |
863-
for file in ./downloaded-artifacts/*/*.zip; do
872+
for file in ./downloaded-artifacts/*.zip; do
864873
if [ -f "$file" ]; then
865874
echo "Uploading $file..."
866875
gh release upload "${{ env.NEW_TAG }}" "$file" --clobber
@@ -877,12 +886,12 @@ jobs:
877886
## 🎉 Release Created Successfully
878887
879888
**Tag:** [\`${{ env.NEW_TAG }}\`](${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ env.NEW_TAG }})
880-
**Kernels:** $(find ./downloaded-artifacts -name "*.zip" | wc -l)
889+
**Kernels:** $(find ./downloaded-artifacts -maxdepth 1 -name "*.zip" -type f | wc -l)
881890
882891
### 📦 Assets
883892
EOF
884893
885-
for zip in ./downloaded-artifacts/*/*.zip; do
894+
for zip in ./downloaded-artifacts/*.zip; do
886895
if [ -f "$zip" ]; then
887896
name=$(basename "$zip")
888897
size=$(stat -c%s "$zip")

0 commit comments

Comments
 (0)