|
|
@@ -0,0 +1,77 @@
|
|
|
+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
|
|
|
+ sub_level:
|
|
|
+ description: 'Kernel sublevel'
|
|
|
+ required: true
|
|
|
+ os_patch_level:
|
|
|
+ description: 'OS patch level (e.g., 2024-01)'
|
|
|
+ required: true
|
|
|
+ kernel_root:
|
|
|
+ description: 'Path to kernel root directory'
|
|
|
+ required: true
|
|
|
+
|
|
|
+outputs:
|
|
|
+ kernel_root:
|
|
|
+ description: 'Path to the synced kernel root'
|
|
|
+ value: ${{ steps.setup.outputs.kernel_root }}
|
|
|
+ deprecated_branch:
|
|
|
+ description: 'Whether the branch is deprecated'
|
|
|
+ value: ${{ steps.sync.outputs.deprecated }}
|
|
|
+
|
|
|
+runs:
|
|
|
+ using: composite
|
|
|
+ steps:
|
|
|
+ - name: Setup Kernel Root Directory
|
|
|
+ id: setup
|
|
|
+ shell: bash
|
|
|
+ run: |
|
|
|
+ KERNEL_ROOT="${{ inputs.kernel_root }}"
|
|
|
+ mkdir -p "$KERNEL_ROOT"
|
|
|
+ echo "kernel_root=$KERNEL_ROOT" >> $GITHUB_OUTPUT
|
|
|
+ echo "✓ Created kernel root directory: $KERNEL_ROOT"
|
|
|
+
|
|
|
+ - name: Initialize and Sync Kernel Repository
|
|
|
+ id: sync
|
|
|
+ shell: bash
|
|
|
+ working-directory: ${{ inputs.kernel_root }}
|
|
|
+ run: |
|
|
|
+ FORMATTED_BRANCH="${{ inputs.android_version }}-${{ inputs.kernel_version }}-${{ inputs.os_patch_level }}"
|
|
|
+
|
|
|
+ echo "========================================"
|
|
|
+ echo " Initializing Kernel Repository"
|
|
|
+ echo "========================================"
|
|
|
+ echo "Branch: common-${FORMATTED_BRANCH}"
|
|
|
+ echo "========================================"
|
|
|
+
|
|
|
+ repo init -u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} --depth=1
|
|
|
+
|
|
|
+ # Check if branch is deprecated
|
|
|
+ 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
|
|
|
+
|
|
|
+ echo "========================================"
|
|
|
+ echo " Syncing Kernel Source"
|
|
|
+ echo "========================================"
|
|
|
+
|
|
|
+ repo --trace sync -c -j$(nproc --all) --fail-fast --no-tags --force-sync --no-clone-bundle
|
|
|
+
|
|
|
+ echo "========================================"
|
|
|
+ echo " ✓ Kernel Source Synced Successfully"
|
|
|
+ echo "========================================"
|