name: 'Setup Build Environment' description: 'Clones dependencies and exports mkbootimg/avbtool paths' runs: using: composite steps: - shell: bash run: | set -euo pipefail mkdir -p "$GITHUB_WORKSPACE/kernel" mkdir -p "$GITHUB_WORKSPACE/git-repo" 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 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 git clone https://github.com/WildKernels/AnyKernel3.git -b gki-2.0 "$GITHUB_WORKSPACE/AnyKernel3" AOSP_MIRROR=https://android.googlesource.com BRANCH=main-kernel-2025 git clone $AOSP_MIRROR/kernel/prebuilts/build-tools -b $BRANCH --depth 1 kernel-build-tools git clone $AOSP_MIRROR/platform/system/tools/mkbootimg -b $BRANCH --depth 1 mkbootimg echo "AVBTOOL=$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/bin/avbtool" >> "$GITHUB_ENV" echo "MKBOOTIMG=$GITHUB_WORKSPACE/mkbootimg/mkbootimg.py" >> "$GITHUB_ENV" echo "UNPACK_BOOTIMG=$GITHUB_WORKSPACE/mkbootimg/unpack_bootimg.py" >> "$GITHUB_ENV" echo "BOOT_SIGN_KEY_PATH=$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem" >> "$GITHUB_ENV" mkdir -p "$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/share/avb" if [ -z "${BOOT_SIGN_KEY:-}" ]; then exit 1 fi KEY_PATH="$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem" printf '%s' "$BOOT_SIGN_KEY" > "$KEY_PATH" if ! head -n 1 "$KEY_PATH" | grep -q 'BEGIN'; then printf '%s' "$BOOT_SIGN_KEY" | base64 -d > "$KEY_PATH" fi chmod 600 "$KEY_PATH"