| 123456789101112131415161718192021222324252627282930313233343536373839 |
- name: 'Download Kernel Repository'
- description: 'Initialize and sync Android kernel source repository'
- inputs:
- android_version:
- description: 'Android version (e.g., android14)'
- required: true
- kernel_version:
- description: 'Kernel version (e.g., 5.15, 6.1)'
- required: true
- os_patch_level:
- description: 'OS patch level (e.g., 2024-01)'
- required: true
- outputs:
- deprecated_branch:
- description: 'Whether the branch is deprecated'
- value: ${{ steps.sync.outputs.deprecated }}
- runs:
- using: composite
- steps:
- - name: Initialize and Sync Kernel Repository
- id: sync
- shell: bash
- working-directory: ${{ github.workspace }}/kernel
- run: |
- FORMATTED_BRANCH="${{ inputs.android_version }}-${{ inputs.kernel_version }}-${{ inputs.os_patch_level }}"
- repo init -u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} --depth=1 --partial-clone --clone-filter=blob:limit=10M
- REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH})
- DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml
- DEPRECATED=false
- if grep -q deprecated <<< $REMOTE_BRANCH; then
- sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH
- echo "⚠ Note: Branch ${FORMATTED_BRANCH} is considered deprecated."
- DEPRECATED=true
- fi
- echo "deprecated=$DEPRECATED" >> $GITHUB_OUTPUT
- repo sync -c -j$(nproc --all) --fail-fast --no-tags --force-sync --no-clone-bundle
|