@@ -592,13 +592,96 @@ jobs:
592592 retention-days : 1
593593 if-no-files-found : warn
594594
595+ prepare_susfs :
596+ name : Prepare SUSFS archives (download once)
597+ needs : set-op-model
598+ if : ${{ needs.set-op-model.outputs.active_gki_keys != '' }}
599+ runs-on : ubuntu-latest
600+ steps :
601+ - name : Download active SUSFS archives once
602+ env :
603+ ACTIVE_GKI_KEYS : ${{ needs.set-op-model.outputs.active_gki_keys }}
604+ SUSFS_HASH_ANDROID12_5_10 : ${{ needs.set-op-model.outputs.susfs_hash_android12_5_10 }}
605+ SUSFS_HASH_ANDROID13_5_15 : ${{ needs.set-op-model.outputs.susfs_hash_android13_5_15 }}
606+ SUSFS_HASH_ANDROID14_6_1 : ${{ needs.set-op-model.outputs.susfs_hash_android14_6_1 }}
607+ SUSFS_HASH_ANDROID15_6_6 : ${{ needs.set-op-model.outputs.susfs_hash_android15_6_6 }}
608+ SUSFS_HASH_ANDROID16_6_12 : ${{ needs.set-op-model.outputs.susfs_hash_android16_6_12 }}
609+ run : |
610+ set -euo pipefail
611+ echo "::group::Download shared SUSFS archives"
612+ mkdir -p susfs-archives
613+
614+ declare -A hashes=(
615+ ["android12-5.10"]="$SUSFS_HASH_ANDROID12_5_10"
616+ ["android13-5.15"]="$SUSFS_HASH_ANDROID13_5_15"
617+ ["android14-6.1"]="$SUSFS_HASH_ANDROID14_6_1"
618+ ["android15-6.6"]="$SUSFS_HASH_ANDROID15_6_6"
619+ ["android16-6.12"]="$SUSFS_HASH_ANDROID16_6_12"
620+ )
621+ declare -A seen=()
622+
623+ IFS=',' read -ra active_keys <<< "$ACTIVE_GKI_KEYS"
624+ for key in "${active_keys[@]}"; do
625+ ref="${hashes[$key]:-unknown}"
626+ if [[ ! "$ref" =~ ^[0-9a-f]{40}$ ]]; then
627+ echo "::error::Invalid resolved SUSFS hash '$ref' for $key"
628+ exit 1
629+ fi
630+
631+ if [[ -n "${seen[$ref]:-}" ]]; then
632+ echo "ℹ️ $key reuses SUSFS $ref; skipping duplicate download"
633+ continue
634+ fi
635+ seen[$ref]=1
636+
637+ archive="susfs-archives/susfs4ksu-${ref}.tar.gz"
638+ tmp="${archive}.part"
639+ url="https://gitlab.com/api/v4/projects/simonpunk%2Fsusfs4ksu/repository/archive.tar.gz?sha=${ref}&include_lfs_blobs=false"
640+ ok=0
641+
642+ for attempt in 1 2 3 4 5 6; do
643+ rm -f "$tmp"
644+ if curl -LfsS --connect-timeout 30 --max-time 180 \
645+ -H "User-Agent: Mozilla/5.0" "$url" -o "$tmp" \
646+ && [ -s "$tmp" ] \
647+ && tar -tzf "$tmp" >/dev/null 2>&1; then
648+ mv "$tmp" "$archive"
649+ ok=1
650+ echo "✅ Downloaded $key SUSFS $ref"
651+ break
652+ fi
653+
654+ echo "::warning::SUSFS download failed for $key (attempt $attempt/6); backing off..."
655+ sleep $(( attempt * 5 + RANDOM % 6 ))
656+ done
657+
658+ if [ "$ok" != 1 ]; then
659+ rm -f "$tmp"
660+ echo "::error::Failed to download SUSFS archive for $key ($ref)"
661+ exit 1
662+ fi
663+ done
664+
665+ echo "Prepared $(find susfs-archives -maxdepth 1 -name 'susfs4ksu-*.tar.gz' -type f | wc -l) unique SUSFS archive(s)"
666+ echo "::endgroup::"
667+
668+ - name : Upload shared SUSFS archives
669+ uses : actions/upload-artifact@v4
670+ with :
671+ name : susfs-archives
672+ path : susfs-archives/*.tar.gz
673+ retention-days : 1
674+ compression-level : 0
675+ if-no-files-found : error
676+
595677 build :
596678 name : build (${{ matrix.model }}, ${{ matrix.soc }}, ${{ matrix.branch }}, ${{ matrix.manifest }}, ${{ matrix.android_version }}, ${{ matrix.kernel_version }}, ${{ matrix.os_version }}, ${{ matrix.ksu_type }})
597- needs : [set-op-model, mirror_toolchain, prepare_ccache]
679+ needs : [set-op-model, mirror_toolchain, prepare_ccache, prepare_susfs ]
598680 if : |
599681 !cancelled() &&
600682 needs.set-op-model.result == 'success' &&
601- (needs.mirror_toolchain.result == 'success' || needs.mirror_toolchain.result == 'skipped')
683+ (needs.mirror_toolchain.result == 'success' || needs.mirror_toolchain.result == 'skipped') &&
684+ (needs.prepare_susfs.result == 'success' || needs.prepare_susfs.result == 'skipped')
602685 runs-on : ubuntu-latest
603686 strategy :
604687 fail-fast : false
@@ -652,6 +735,22 @@ jobs:
652735 echo "[DEBUG] Ccache version : $(ccache --version | head -1)"
653736 echo "::endgroup::"
654737
738+ - name : Get shared SUSFS archives
739+ if : ${{ matrix.susfs }}
740+ uses : actions/download-artifact@v4
741+ with :
742+ name : susfs-archives
743+ path : susfs-archives
744+
745+ - name : Route SUSFS fetches to shared archive
746+ if : ${{ matrix.susfs }}
747+ shell : bash
748+ run : |
749+ set -euo pipefail
750+ chmod +x "$GITHUB_WORKSPACE/.github/scripts/susfs-archive-bin/aria2c"
751+ echo "$GITHUB_WORKSPACE/.github/scripts/susfs-archive-bin" >> "$GITHUB_PATH"
752+ echo "✅ SUSFS archive shim enabled for this matrix job"
753+
655754 - name : ♻️ Configure ccache (bounded)
656755 run : |
657756 echo "::group::Configure ccache environment"
@@ -900,16 +999,17 @@ jobs:
900999 merge-multiple : true
9011000 skip-decompress : true
9021001
903- - name : 🧹 Exclude ccache binary from release staging
1002+ - name : 🧹 Exclude build helper artifacts from release staging
9041003 run : |
905- # merge-multiple pulls every run artifact (including the shared
906- # ccache-binary) into ./downloaded-artifacts. The ccache binary is a
907- # build-time helper and must never become a release asset, so drop it
908- # before notes generation / asset upload. The ccache download-once
909- # mechanism (prepare_ccache job + ccache-binary artifact) is untouched.
1004+ # Shared build helpers must never become release assets. With
1005+ # skip-decompress=true, archived helpers are downloaded as <name>.zip.
9101006 find ./downloaded-artifacts -maxdepth 2 -type f -name ccache -delete
1007+ find ./downloaded-artifacts -maxdepth 2 -type f -name 'susfs4ksu-*.tar.gz' -delete
1008+ rm -f ./downloaded-artifacts/ccache-binary.zip
1009+ rm -f ./downloaded-artifacts/susfs-archives.zip
9111010 rm -rf ./downloaded-artifacts/ccache-binary
912- echo "✅ ccache binary excluded from release staging"
1011+ rm -rf ./downloaded-artifacts/susfs-archives
1012+ echo "✅ build helper artifacts excluded from release staging"
9131013
9141014 - name : 📝 Generate Device List and Final Release Notes
9151015 id : generate-notes
0 commit comments