|
| 1 | +name: Build Kernel - Android 15 |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: ["main", "ci", "checkci"] |
| 5 | + paths: |
| 6 | + - ".github/workflows/build-kernel-a15.yml" |
| 7 | + - ".github/workflows/gki-kernel.yml" |
| 8 | + - ".github/scripts/build_a13.sh" |
| 9 | + - "kernel/**" |
| 10 | + pull_request: |
| 11 | + branches: ["main"] |
| 12 | + paths: |
| 13 | + - ".github/workflows/build-kernel-a15.yml" |
| 14 | + - ".github/workflows/gki-kernel.yml" |
| 15 | + - ".github/scripts/build-a13.sh" |
| 16 | + - "kernel/**" |
| 17 | + workflow_call: |
| 18 | +jobs: |
| 19 | + build-kernel: |
| 20 | + if: github.event_name != 'pull_request' && github.ref != 'refs/heads/checkci' |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + include: |
| 24 | + - version: "6.6" |
| 25 | + sub_level: 30 |
| 26 | + os_patch_level: 2024-07 |
| 27 | + uses: ./.github/workflows/gki-kernel.yml |
| 28 | + secrets: inherit |
| 29 | + with: |
| 30 | + version: android15-${{ matrix.version }} |
| 31 | + version_name: android15-${{ matrix.version }}.${{ matrix.sub_level }} |
| 32 | + tag: android15-${{ matrix.version }}-${{ matrix.os_patch_level }} |
| 33 | + os_patch_level: ${{ matrix.os_patch_level }} |
| 34 | + patch_path: ${{ matrix.version }} |
| 35 | + |
| 36 | + upload-artifacts: |
| 37 | + needs: build-kernel |
| 38 | + runs-on: ubuntu-latest |
| 39 | + if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' || github.ref == 'refs/heads/ci' }} |
| 40 | + env: |
| 41 | + CHAT_ID: ${{ secrets.CHAT_ID }} |
| 42 | + BOT_TOKEN: ${{ secrets.BOT_TOKEN }} |
| 43 | + MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }} |
| 44 | + COMMIT_MESSAGE: ${{ github.event.head_commit.message }} |
| 45 | + COMMIT_URL: ${{ github.event.head_commit.url }} |
| 46 | + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 47 | + steps: |
| 48 | + - name: Download artifacts |
| 49 | + uses: actions/download-artifact@v4 |
| 50 | + |
| 51 | + - uses: actions/checkout@v4 |
| 52 | + with: |
| 53 | + path: KernelSU |
| 54 | + fetch-depth: 0 |
| 55 | + |
| 56 | + - name: List artifacts |
| 57 | + run: | |
| 58 | + tree |
| 59 | +
|
| 60 | + - name: Download prebuilt toolchain |
| 61 | + run: | |
| 62 | + AOSP_MIRROR=https://android.googlesource.com |
| 63 | + BRANCH=main-kernel-build-2024 |
| 64 | + git clone $AOSP_MIRROR/platform/prebuilts/build-tools -b $BRANCH --depth 1 build-tools |
| 65 | + git clone $AOSP_MIRROR/kernel/prebuilts/build-tools -b $BRANCH --depth 1 kernel-build-tools |
| 66 | + git clone $AOSP_MIRROR/platform/system/tools/mkbootimg -b $BRANCH --depth 1 |
| 67 | + pip3 install telethon |
| 68 | +
|
| 69 | + - name: Set boot sign key |
| 70 | + env: |
| 71 | + BOOT_SIGN_KEY: ${{ secrets.BOOT_SIGN_KEY }} |
| 72 | + run: | |
| 73 | + if [ ! -z "$BOOT_SIGN_KEY" ]; then |
| 74 | + echo "$BOOT_SIGN_KEY" > ./kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem |
| 75 | + fi |
| 76 | +
|
| 77 | + - name: Bot session cache |
| 78 | + id: bot_session_cache |
| 79 | + uses: actions/cache@v4 |
| 80 | + if: false |
| 81 | + with: |
| 82 | + path: scripts/ksubot.session |
| 83 | + key: ${{ runner.os }}-bot-session |
| 84 | + |
| 85 | + - name: Build boot images |
| 86 | + run: | |
| 87 | + export AVBTOOL=$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/bin/avbtool |
| 88 | + export GZIP=$GITHUB_WORKSPACE/build-tools/path/linux-x86/gzip |
| 89 | + export LZ4=$GITHUB_WORKSPACE/build-tools/path/linux-x86/lz4 |
| 90 | + export MKBOOTIMG=$GITHUB_WORKSPACE/mkbootimg/mkbootimg.py |
| 91 | + export UNPACK_BOOTIMG=$GITHUB_WORKSPACE/mkbootimg/unpack_bootimg.py |
| 92 | + cd $GITHUB_WORKSPACE/KernelSU |
| 93 | + export VERSION=$(($(git rev-list --count HEAD) + 10200)) |
| 94 | + echo "VERSION: $VERSION" |
| 95 | + cd - |
| 96 | + bash $GITHUB_WORKSPACE/KernelSU/.github/scripts/build_a13.sh |
| 97 | +
|
| 98 | + - name: Display structure of boot files |
| 99 | + run: ls -R |
| 100 | + |
| 101 | + - name: Upload images artifact |
| 102 | + uses: actions/upload-artifact@v4 |
| 103 | + with: |
| 104 | + name: boot-images-android15 |
| 105 | + path: Image-android15*/*.img.gz |
| 106 | + |
| 107 | + check-build-kernel: |
| 108 | + if: (github.event_name == 'pull_request' && !github.event.pull_request.draft) || github.ref == 'refs/heads/checkci' |
| 109 | + strategy: |
| 110 | + matrix: |
| 111 | + include: |
| 112 | + - version: "6.6" |
| 113 | + sub_level: 30 |
| 114 | + os_patch_level: 2024-07 |
| 115 | + uses: ./.github/workflows/gki-kernel.yml |
| 116 | + with: |
| 117 | + version: android15-${{ matrix.version }} |
| 118 | + version_name: android15-${{ matrix.version }}.${{ matrix.sub_level }} |
| 119 | + tag: android15-${{ matrix.version }}-${{ matrix.os_patch_level }} |
| 120 | + os_patch_level: ${{ matrix.os_patch_level }} |
| 121 | + patch_path: ${{ matrix.version }} |
0 commit comments