2023-01-28 12:24:43 +08:00
|
|
|
name: Build Kernel - Android 12
|
|
|
|
on:
|
|
|
|
push:
|
2024-01-08 09:54:14 +08:00
|
|
|
branches: ["main", "ci", "checkci"]
|
2023-01-28 12:24:43 +08:00
|
|
|
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/**"
|
|
|
|
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-02-08 22:31:43 +08:00
|
|
|
workflow_call:
|
2023-01-28 12:24:43 +08:00
|
|
|
jobs:
|
|
|
|
build-kernel:
|
2024-01-08 09:54:14 +08:00
|
|
|
if: github.event_name != 'pull_request' && github.ref != 'refs/heads/checkci'
|
2023-01-28 12:24:43 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
2024-05-17 17:28:48 +08:00
|
|
|
- sub_level: 209
|
|
|
|
os_patch_level: 2024-05
|
2024-08-25 07:01:06 +03:00
|
|
|
- sub_level: 218
|
|
|
|
os_patch_level: 2024-08
|
2024-12-31 16:31:14 +08:00
|
|
|
- sub_level: 226
|
|
|
|
os_patch_level: 2024-11
|
2023-01-28 12:24:43 +08:00
|
|
|
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 }}
|
2023-01-29 13:00:47 +08:00
|
|
|
os_patch_level: ${{ matrix.os_patch_level }}
|
2023-01-28 12:24:43 +08:00
|
|
|
patch_path: "5.10"
|
2024-01-08 09:54:14 +08:00
|
|
|
|
2023-01-29 11:25:10 +08:00
|
|
|
upload-artifacts:
|
|
|
|
needs: build-kernel
|
|
|
|
runs-on: ubuntu-latest
|
2023-02-08 22:31:43 +08:00
|
|
|
if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' || github.ref == 'refs/heads/ci' }}
|
2023-01-29 11:25:10 +08:00
|
|
|
env:
|
|
|
|
CHAT_ID: ${{ secrets.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
|
2023-12-20 10:37:08 +09:00
|
|
|
uses: actions/download-artifact@v4
|
2023-01-29 11:25:10 +08:00
|
|
|
|
2023-09-07 22:24:01 +09:00
|
|
|
- uses: actions/checkout@v4
|
2023-01-29 11:25:10 +08:00
|
|
|
with:
|
|
|
|
path: KernelSU
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: List artifacts
|
|
|
|
run: |
|
|
|
|
tree
|
|
|
|
|
|
|
|
- name: Download prebuilt toolchain
|
|
|
|
run: |
|
|
|
|
AOSP_MIRROR=https://android.googlesource.com
|
2024-08-25 07:01:06 +03:00
|
|
|
BRANCH=main-kernel-build-2024
|
2023-01-29 11:25:10 +08:00
|
|
|
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
|
2024-05-25 06:07:52 +03:00
|
|
|
pip3 install telethon
|
2023-01-29 11:25:10 +08:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2023-10-25 11:32:46 +08:00
|
|
|
- name: Bot session cache
|
|
|
|
id: bot_session_cache
|
2024-03-20 07:52:34 +03:00
|
|
|
uses: actions/cache@v4
|
2024-03-19 13:32:29 +08:00
|
|
|
if: false
|
2023-10-25 11:32:46 +08:00
|
|
|
with:
|
|
|
|
path: scripts/ksubot.session
|
|
|
|
key: ${{ runner.os }}-bot-session
|
2023-01-29 11:25:10 +08:00
|
|
|
|
|
|
|
- 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
|
2023-02-08 22:31:43 +08:00
|
|
|
export VERSION=$(($(git rev-list --count HEAD) + 10200))
|
2023-01-29 11:25:10 +08:00
|
|
|
echo "VERSION: $VERSION"
|
|
|
|
cd -
|
|
|
|
bash $GITHUB_WORKSPACE/KernelSU/.github/scripts/build_a12.sh
|
|
|
|
|
2023-02-08 22:31:43 +08:00
|
|
|
- name: Display structure of boot files
|
|
|
|
run: ls -R
|
|
|
|
|
|
|
|
- name: Upload images artifact
|
2023-12-20 10:37:08 +09:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-02-08 22:31:43 +08:00
|
|
|
with:
|
|
|
|
name: boot-images-android12
|
2023-04-20 10:55:21 +08:00
|
|
|
path: Image-android12*/*.img.gz
|
2023-02-08 22:31:43 +08:00
|
|
|
|
2023-01-28 12:24:43 +08:00
|
|
|
check-build-kernel:
|
2024-01-08 09:54:14 +08:00
|
|
|
if: (github.event_name == 'pull_request' && !github.event.pull_request.draft) || github.ref == 'refs/heads/checkci'
|
2023-01-28 12:24:43 +08:00
|
|
|
uses: ./.github/workflows/gki-kernel.yml
|
|
|
|
with:
|
|
|
|
version: android12-5.10
|
2024-12-31 16:31:14 +08:00
|
|
|
version_name: android12-5.10.223
|
|
|
|
tag: android12-5.10-2024-11
|
|
|
|
os_patch_level: 2024-11
|
2024-03-15 18:53:24 +08:00
|
|
|
patch_path: "5.10"
|