2023-01-28 12:24:43 +08:00
|
|
|
name: Build Kernel - Android 12
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ["main", "ci"]
|
|
|
|
paths:
|
|
|
|
- ".github/workflows/build-kernel-a12.yml"
|
|
|
|
- ".github/workflows/gki-kernel.yml"
|
2023-01-29 11:25:10 +08:00
|
|
|
- ".github/scripts/build_a12.sh"
|
2023-01-28 12:24:43 +08:00
|
|
|
- "kernel/**"
|
2023-01-29 11:25:10 +08:00
|
|
|
- "userspace/ksud/**"
|
2023-01-28 12:24:43 +08:00
|
|
|
pull_request:
|
|
|
|
branches: ["main"]
|
|
|
|
paths:
|
|
|
|
- ".github/workflows/build-kernel-a12.yml"
|
|
|
|
- ".github/workflows/gki-kernel.yml"
|
2023-01-29 11:25:10 +08:00
|
|
|
- ".github/scripts/build-a12.sh"
|
2023-01-28 12:24:43 +08:00
|
|
|
- "kernel/**"
|
2023-01-29 11:25:10 +08:00
|
|
|
- "userspace/ksud/**"
|
2023-01-28 12:24:43 +08:00
|
|
|
jobs:
|
|
|
|
build-ksud:
|
|
|
|
uses: ./.github/workflows/ksud.yml
|
|
|
|
with:
|
|
|
|
target: aarch64-linux-android
|
|
|
|
build-kernel:
|
|
|
|
needs: build-ksud
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- sub_level: 66
|
|
|
|
os_patch_level: 2021-11
|
|
|
|
- sub_level: 81
|
|
|
|
os_patch_level: 2022-03
|
|
|
|
- sub_level: 101
|
|
|
|
os_patch_level: 2022-05
|
|
|
|
- sub_level: 110
|
|
|
|
os_patch_level: 2022-07
|
|
|
|
- sub_level: 136
|
|
|
|
os_patch_level: 2022-11
|
|
|
|
uses: ./.github/workflows/gki-kernel.yml
|
|
|
|
secrets: inherit
|
|
|
|
with:
|
|
|
|
version: android12-5.10
|
|
|
|
version_name: android12-5.10.${{ matrix.sub_level }}
|
|
|
|
tag: android12-5.10-${{ matrix.os_patch_level }}
|
|
|
|
patch_path: "5.10"
|
2023-01-29 11:25:10 +08:00
|
|
|
upload-artifacts:
|
|
|
|
needs: build-kernel
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' }}
|
|
|
|
env:
|
|
|
|
CHAT_ID: ${{ secrets.CHAT_ID }}
|
|
|
|
CACHE_CHAT_ID: ${{ secrets.CACHE_CHAT_ID }}
|
|
|
|
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
|
|
|
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
|
|
|
|
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
|
|
|
COMMIT_URL: ${{ github.event.head_commit.url }}
|
|
|
|
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
|
|
steps:
|
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: KernelSU
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: List artifacts
|
|
|
|
run: |
|
|
|
|
tree
|
|
|
|
|
|
|
|
- name: Download prebuilt toolchain
|
|
|
|
run: |
|
|
|
|
AOSP_MIRROR=https://android.googlesource.com
|
|
|
|
BRANCH=master-kernel-build-2022
|
|
|
|
git clone $AOSP_MIRROR/platform/prebuilts/build-tools -b $BRANCH --depth 1 build-tools
|
|
|
|
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
|
|
|
|
pip3 install python-telegram-bot
|
|
|
|
|
|
|
|
- name: Set boot sign key
|
|
|
|
env:
|
|
|
|
BOOT_SIGN_KEY: ${{ secrets.BOOT_SIGN_KEY }}
|
|
|
|
run: |
|
|
|
|
if [ ! -z "$BOOT_SIGN_KEY" ]; then
|
|
|
|
echo "$BOOT_SIGN_KEY" > ./kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Setup mutex for uploading
|
|
|
|
uses: ben-z/gh-action-mutex@v1.0-alpha-7
|
|
|
|
|
|
|
|
- name: Build boot images
|
|
|
|
run: |
|
|
|
|
export AVBTOOL=$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/bin/avbtool
|
|
|
|
export GZIP=$GITHUB_WORKSPACE/build-tools/path/linux-x86/gzip
|
|
|
|
export LZ4=$GITHUB_WORKSPACE/build-tools/path/linux-x86/lz4
|
|
|
|
export MKBOOTIMG=$GITHUB_WORKSPACE/mkbootimg/mkbootimg.py
|
|
|
|
export UNPACK_BOOTIMG=$GITHUB_WORKSPACE/mkbootimg/unpack_bootimg.py
|
|
|
|
cd $GITHUB_WORKSPACE/KernelSU
|
|
|
|
export VERSION=$(git rev-list --count HEAD)
|
|
|
|
echo "VERSION: $VERSION"
|
|
|
|
cd -
|
|
|
|
bash $GITHUB_WORKSPACE/KernelSU/.github/scripts/build_a12.sh
|
|
|
|
|
2023-01-28 12:24:43 +08:00
|
|
|
check-build-kernel:
|
|
|
|
needs: build-ksud
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
uses: ./.github/workflows/gki-kernel.yml
|
|
|
|
with:
|
|
|
|
version: android12-5.10
|
|
|
|
version_name: android12-5.10.101
|
|
|
|
tag: android12-5.10-2022-05
|
|
|
|
patch_path: "5.10"
|