name: 'Setup Build Environment' description: 'Clones dependencies and exports mkbootimg/avbtool paths' inputs: version: description: 'Kernel config version (e.g., android12-5.10)' required: true sublevel: description: 'Kernel sublevel' required: true runs: using: composite steps: - shell: bash run: | set -euo pipefail git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" mkdir -p "${{ github.workspace }}/kernel" mkdir -p "${{ github.workspace }}/git-repo" # Retry transient network errors (up to 5 attempts, 5s backoff). retry() { local n=0 until [ "$n" -ge 5 ]; do "$@" && return 0 n=$((n+1)) echo "retry $n/5 failed for: $*" sleep 5 done return 1 } retry curl -L https://storage.googleapis.com/git-repo-downloads/repo -o "${{ github.workspace }}/git-repo/repo" chmod +x "${{ github.workspace }}/git-repo/repo" echo "${{ github.workspace }}/git-repo" >> "$GITHUB_PATH" if [ -d "${{ github.workspace }}/kernel_patches" ]; then rm -rf "${{ github.workspace }}/kernel_patches"; fi retry git clone https://github.com/WildKernels/kernel_patches.git "${{ github.workspace }}/kernel_patches" if [ -d "${{ github.workspace }}/AnyKernel3" ]; then rm -rf "${{ github.workspace }}/AnyKernel3"; fi retry git clone https://github.com/WildKernels/AnyKernel3.git -b gki-2.0 "${{ github.workspace }}/AnyKernel3" - name: Install build deps for BTF generation (android12-5.10) shell: bash if: ${{ inputs.version == 'android12-5.10' }} run: | set -euo pipefail sudo apt-get update -qq sudo apt-get install -y -qq dwarves libelf-dev