cache-dependencies.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. name: Download Build Dependencies
  2. permissions:
  3. contents: read
  4. actions: write
  5. on:
  6. workflow_call:
  7. outputs:
  8. dependencies-ready:
  9. description: "Dependencies are downloaded and uploaded"
  10. value: ${{ jobs.download-dependencies.outputs.status }}
  11. jobs:
  12. download-dependencies:
  13. name: Download Dependencies
  14. runs-on: ubuntu-latest
  15. timeout-minutes: 20
  16. outputs:
  17. status: ${{ steps.summary.outputs.status }}
  18. steps:
  19. - name: Download Summary Start
  20. run: |
  21. echo "========================================"
  22. echo " Downloading Build Dependencies "
  23. echo "========================================"
  24. echo "Started at: $(date)"
  25. - name: Clone AnyKernel3
  26. run: |
  27. git clone https://github.com/WildKernels/AnyKernel3.git -b gki-2.0 --depth=1
  28. echo "AnyKernel3 commit: $(cd AnyKernel3 && git rev-parse --short HEAD)"
  29. - name: Clone Kernel Patches
  30. run: |
  31. git clone https://github.com/WildKernels/kernel_patches.git --depth=1
  32. echo "Kernel Patches commit: $(cd kernel_patches && git rev-parse --short HEAD)"
  33. - name: Clone All SUSFS Branches
  34. run: |
  35. mkdir -p susfs_cache
  36. # List of all SUSFS branches we support
  37. BRANCHES=(
  38. "gki-android12-5.10"
  39. "gki-android13-5.10"
  40. "gki-android13-5.15"
  41. "gki-android14-5.15"
  42. "gki-android14-6.1"
  43. "gki-android15-6.6"
  44. "gki-android16-6.12"
  45. )
  46. for BRANCH in "${BRANCHES[@]}"; do
  47. echo "Cloning SUSFS branch: $BRANCH"
  48. git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "$BRANCH" --depth=1 "susfs_cache/$BRANCH" || {
  49. echo "Warning: Failed to clone branch $BRANCH (may not exist yet)"
  50. continue
  51. }
  52. COMMIT=$(cd "susfs_cache/$BRANCH" && git rev-parse --short HEAD 2>/dev/null || echo "N/A")
  53. echo " └─ Commit: $COMMIT"
  54. done
  55. BRANCH_COUNT=$(ls -d susfs_cache/* 2>/dev/null | wc -l)
  56. echo "SUSFS branches downloaded: $BRANCH_COUNT"
  57. - name: Download Git Repo Tool
  58. run: |
  59. mkdir -p git-repo
  60. curl -L https://storage.googleapis.com/git-repo-downloads/repo -o git-repo/repo
  61. chmod 0755 git-repo/repo
  62. echo "Git repo tool downloaded"
  63. - name: Upload AnyKernel3 Artifact
  64. uses: actions/upload-artifact@v4
  65. with:
  66. name: anykernel3
  67. path: AnyKernel3/
  68. retention-days: 1
  69. compression-level: 6
  70. - name: Upload Kernel Patches Artifact
  71. uses: actions/upload-artifact@v4
  72. with:
  73. name: kernel-patches
  74. path: kernel_patches/
  75. retention-days: 1
  76. compression-level: 6
  77. - name: Upload SUSFS Cache Artifact
  78. uses: actions/upload-artifact@v4
  79. with:
  80. name: susfs-cache
  81. path: susfs_cache/
  82. retention-days: 1
  83. compression-level: 6
  84. - name: Upload Git Repo Tool Artifact
  85. uses: actions/upload-artifact@v4
  86. with:
  87. name: git-repo-tool
  88. path: git-repo/
  89. retention-days: 1
  90. compression-level: 0
  91. - name: Download Summary End
  92. id: summary
  93. run: |
  94. echo "========================================"
  95. echo " Dependencies Download Complete "
  96. echo "========================================"
  97. echo "AnyKernel3 : ✓ Uploaded as artifact"
  98. echo "Kernel Patches : ✓ Uploaded as artifact"
  99. echo "SUSFS Branches : ✓ Uploaded as artifact"
  100. echo "Git Repo Tool : ✓ Uploaded as artifact"
  101. echo "========================================"
  102. echo "Completed at: $(date)"
  103. echo "status=success" >> $GITHUB_OUTPUT