Merge branch 'tiann:main' into main #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Kernel - Android 13 | |
on: | |
push: | |
branches: ["main", "ci"] | |
paths: | |
- ".github/workflows/build-kernel-a13.yml" | |
- ".github/workflows/gki-kernel.yml" | |
- ".github/scripts/build_a13.sh" | |
- "kernel/**" | |
pull_request: | |
branches: ["main"] | |
paths: | |
- ".github/workflows/build-kernel-a13.yml" | |
- ".github/workflows/gki-kernel.yml" | |
- ".github/scripts/build-a13.sh" | |
- "kernel/**" | |
workflow_call: | |
jobs: | |
build-kernel: | |
if: github.event_name != 'pull_request' | |
strategy: | |
matrix: | |
include: | |
- version: "5.10" | |
sub_level: 107 | |
os_patch_level: 2022-11 | |
- version: "5.10" | |
sub_level: 149 | |
os_patch_level: 2023-01 | |
- version: "5.10" | |
sub_level: 157 | |
os_patch_level: 2023-03 | |
- version: "5.10" | |
sub_level: 168 | |
os_patch_level: 2023-05 | |
- version: "5.10" | |
sub_level: 177 | |
os_patch_level: 2023-06 | |
- version: "5.10" | |
sub_level: 186 | |
os_patch_level: 2023-08 | |
- version: "5.10" | |
sub_level: 186 | |
os_patch_level: 2023-09 | |
- version: "5.15" | |
sub_level: 41 | |
os_patch_level: 2022-11 | |
- version: "5.15" | |
sub_level: 74 | |
os_patch_level: 2023-01 | |
- version: "5.15" | |
sub_level: 78 | |
os_patch_level: 2023-03 | |
- version: "5.15" | |
sub_level: 94 | |
os_patch_level: 2023-05 | |
- version: "5.15" | |
sub_level: 104 | |
os_patch_level: 2023-07 | |
- version: "5.15" | |
sub_level: 119 | |
os_patch_level: 2023-09 | |
uses: ./.github/workflows/gki-kernel.yml | |
secrets: inherit | |
with: | |
version: android13-${{ matrix.version }} | |
version_name: android13-${{ matrix.version }}.${{ matrix.sub_level }} | |
tag: android13-${{ matrix.version }}-${{ matrix.os_patch_level }} | |
os_patch_level: ${{ matrix.os_patch_level }} | |
patch_path: ${{ matrix.version }} | |
upload-artifacts: | |
needs: build-kernel | |
runs-on: ubuntu-latest | |
if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' || github.ref == 'refs/heads/ci' }} | |
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@v4 | |
with: | |
path: KernelSU | |
fetch-depth: 0 | |
- name: List artifacts | |
run: | | |
tree | |
- name: Download prebuilt toolchain | |
run: | | |
AOSP_MIRROR=https://android.googlesource.com | |
BRANCH=main-kernel-build-2023 | |
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/[email protected] | |
- 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) + 10200)) | |
echo "VERSION: $VERSION" | |
cd - | |
bash $GITHUB_WORKSPACE/KernelSU/.github/scripts/build_a13.sh | |
- name: Display structure of boot files | |
run: ls -R | |
- name: Upload images artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: boot-images-android13 | |
path: Image-android13*/*.img.gz | |
check-build-kernel: | |
if: github.event_name == 'pull_request' | |
strategy: | |
matrix: | |
include: | |
- version: "5.10" | |
sub_level: 187 | |
os_patch_level: 2023-08 | |
- version: "5.15" | |
sub_level: 119 | |
os_patch_level: 2023-09 | |
uses: ./.github/workflows/gki-kernel.yml | |
with: | |
version: android13-${{ matrix.version }} | |
version_name: android13-${{ matrix.version }}.${{ matrix.sub_level }} | |
tag: android13-${{ matrix.version }}-${{ matrix.os_patch_level }} | |
patch_path: ${{ matrix.version }} |