Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
box

GitHub Action

Android Kernel Action

v0.3.0 Pre-release

Android Kernel Action

box

Android Kernel Action

Build android kernel with GitHub Action

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Android Kernel Action

uses: lemniskett/android-kernel-actions@v0.3.0

Learn more about this action in lemniskett/android-kernel-actions

Choose a version

Android Kernel Actions

Shell check

Builds Android kernel from the kernel repository.

Action Vars

Inputs

Input Description
arch Specify what Architecture target to use, currently only supports arm64
compiler Specify which toochain to use
defconfig Specify what defconfig command used to generate .config file
image Specify what is the final build file, usually it's Image.gz-dtb or Image-dtb

Environment Variables

Variable Description
NAME Specify the name of the release file, defaults to the name of the repository
KERNEL_PATH Specify the path of the kernel source, defaults to .
ZIPPER_PATH Specify the path of the zip template, defaults to zipper

Outputs

Output Description
elapsed_time Time elapsed from building the kernel in seconds, excluding zipping and downloading toolchains
outfile Path to the final build file
hash Kernel commit hash

Getting the build

Use other action to actually get the file, for example, with ncipollo/release-action:

- name: Release build
  uses: ncipollo/release-action@v1
  with:
    artifacts: ${{ steps.<step id>.outputs.outfile }}
    token: ${{ secrets.GITHUB_TOKEN }}

Or with appleboy/telegram-action:

- name: Release build
  uses: appleboy/telegram-action@master
  with:
    to: ${{ secrets.CHANNEL_ID }}
    token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
    message: ${{ github.repository }} on ${{ github.sha }} is built!
    document: ${{ steps.<step id>.outputs.outfile }}

Available toolchains

If you want to compile with Clang and LLVM without any of GNU's binutils, make sure your kernel source already supports LLVM options, otherwise compilation may fails. In that case, use clang toolchain with /binutils.

ARM64

Ubuntu's GCC

  • gcc/7
  • gcc/8
  • gcc/9
  • gcc/10

Ubuntu's Clang

  • clang/6.0, clang/6.0/binutils
  • clang/7, clang/7/binutils
  • clang/8, clang/8/binutils
  • clang/9, clang/9/binutils
  • clang/10, clang/10/binutils
  • clang/11, clang/11/binutils
  • proton-clang/<branch, commit hash or tag>, proton-clang/<branch, commit hash or tag>/binutils

Example : proton-clang/master, proton-clang/09fb113/binutils

  • aosp-clang/<branch>/<clang version>, aosp-clang/<branch>/<clang version>/binutils

Example : aosp-clang/master/clang-r416183b, aosp-clang/android11-release/clang-r365631c/binutils

Example usage

name: Build on Tag

on:
  push:
    tags: '*'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout kernel source
      uses: actions/checkout@v2

    - name: Checkout zipper
      uses: actions/checkout@v2
      with:
        repository: lemniskett/AnyKernel3
        path: zipper

    - name: Android kernel build
      uses: lemniskett/android-kernel-actions@master
      id: build
      env:
        NAME: Dark-Ages-Último
      with:
        arch: arm64
        compiler: gcc/10
        defconfig: vince_defconfig
        image: Image.gz-dtb

    - name: Release build
      uses: ncipollo/release-action@v1
      with:
        artifacts: ${{ steps.build.outputs.outfile }}
        token: ${{ secrets.GITHUB_TOKEN }}

Troubleshooting

Error codes

  • 1: Packages fails to install
  • 2: .config fails to be generated
  • 3: Build fails
  • 100: Unsupported usage
  • 127: Unexpected error