action.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. name: 'Download Kernel Repository'
  2. description: 'Initialize and sync Android kernel source repository'
  3. inputs:
  4. android_version:
  5. description: 'Android version (e.g., android14)'
  6. required: true
  7. kernel_version:
  8. description: 'Kernel version (e.g., 5.15, 6.1)'
  9. required: true
  10. os_patch_level:
  11. description: 'OS patch level (e.g., 2024-01)'
  12. required: true
  13. outputs:
  14. deprecated_branch:
  15. description: 'Whether the branch is deprecated'
  16. value: ${{ steps.sync.outputs.deprecated }}
  17. runs:
  18. using: composite
  19. steps:
  20. - name: Initialize and Sync Kernel Repository
  21. id: sync
  22. shell: bash
  23. working-directory: ${{ github.workspace }}/kernel
  24. run: |
  25. FORMATTED_BRANCH="${{ inputs.android_version }}-${{ inputs.kernel_version }}-${{ inputs.os_patch_level }}"
  26. repo init -u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} --depth=1 --partial-clone --clone-filter=blob:limit=10M
  27. REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH})
  28. DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml
  29. DEPRECATED=false
  30. if grep -q deprecated <<< $REMOTE_BRANCH; then
  31. sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH
  32. echo "⚠ Note: Branch ${FORMATTED_BRANCH} is considered deprecated."
  33. DEPRECATED=true
  34. fi
  35. echo "deprecated=$DEPRECATED" >> $GITHUB_OUTPUT
  36. repo sync -c -j$(nproc --all) --fail-fast --no-tags --force-sync --no-clone-bundle