Skip to content

Commit

Permalink
Merge pull request #1 from cd-Crypton/main
Browse files Browse the repository at this point in the history
Reworking workflow config.
  • Loading branch information
carlodandan authored May 27, 2024
2 parents 67b0f03 + 59b312f commit 95b8b6a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 23 deletions.
61 changes: 40 additions & 21 deletions .github/workflows/kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,31 @@ on:
KERNEL_TREE:
description: 'Kernel tree URL'
required: true
default: 'https://github.com/cd-Crypton/android_kernel_realme_sm6225'
default: 'https://github.com/carlodandan/android_kernel_realme_sm6225'
KERNEL_BRANCH:
description: 'Kernel tree Branch'
required: true
default: 'android13-staging'
default: 'lineage-21'
KERNEL_DEFCONFIG:
description: 'Kernel defconfig'
required: true
default: 'vendor/bengal-perf_defconfig'
default: 'vendor/sm6225-perf_defconfig'
KERNEL_IMAGE_NAME:
description: 'Kernel image name'
required: true
default: 'Image.gz'
LLVM_IAS:
description: 'Use Integrated Assembler?'
required: true
type: choice
default: 'LLVM_IAS=1'
options:
- LLVM_IAS=1
- LLVM_IAS=0
EXTRA_CMDS:
description: '(Optional) Extra command separated by a space to be passed directly to make (leave blank if not using).'
type: string
required: false

jobs:
build:
Expand All @@ -33,41 +45,47 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Packages
run: |
sudo apt-get update
sudo apt-get install git ccache automake flex lzop bison gperf build-essential zip curl zlib1g-dev g++-multilib libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven libssl-dev pwgen libswitch-perl policycoreutils minicom libxml-sax-base-perl libxml-simple-perl bc libc6-dev-i386 lib32ncurses5-dev libx11-dev lib32z-dev libgl1-mesa-dev xsltproc unzip device-tree-compiler python2 python3 device-tree-compiler
sudo apt-get install bison flex rsync bison device-tree-compiler bc cpio -y
- name: Setup Proton
run: |
mkdir -p android && cd android
git config --global advice.detachedHead false
git clone --depth=1 https://github.com/kdrag0n/proton-clang -b ${{ github.event.inputs.PROTON_RELEASE }} ./toolchains/proton-clang
git clone --depth=1 https://github.com/kdrag0n/proton-clang -b ${{ inputs.PROTON_RELEASE }} ./toolchains/proton-clang
- name: Clone Kernel Tree
run: |
cd android
git clone --depth=1 ${{ github.event.inputs.KERNEL_TREE }} -b ${{ github.event.inputs.KERNEL_BRANCH }} ./kernel
git clone --depth=1 ${{ inputs.KERNEL_TREE }} -b ${{ inputs.KERNEL_BRANCH }} ./kernel
- name: Set Properties
run: |
echo "MAKE=$(cat make.txt)" >> $GITHUB_ENV
echo "ADD=$(cat add.txt)" >> $GITHUB_ENV
echo "BUILD_DATE=$(TZ=Asia/Manila date +%Y%m%d)" >> $GITHUB_ENV
- name: Build Kernel
run: |
PATH="${GITHUB_WORKSPACE}/android/toolchains/proton-clang/bin:/bin:$PATH"
cd android/kernel
${{ env.MAKE }} ${{ env.ADD }} ${{ github.event.inputs.KERNEL_DEFCONFIG }}
${{ env.MAKE }} ${{ env.ADD }} -j"$(nproc --all)"
export PATH="${GITHUB_WORKSPACE}/android/toolchains/proton-clang/bin:$PATH"
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
export CROSS_COMPILE_COMPAT=arm-linux-gnueabi-
if [ -z ${{ inputs.EXTRA_CMDS }} ]; then
make -j$(nproc --all) CC=clang O=out LD=ld.lld LLVM=1 ${{ inputs.LLVM_IAS }} ${{ inputs.KERNEL_DEFCONFIG }}
make -j$(nproc --all) CC=clang O=out LD=ld.lld LLVM=1 ${{ inputs.LLVM_IAS }}
else
make -j$(nproc --all) CC=clang O=out LD=ld.lld LLVM=1 ${{ inputs.LLVM_IAS }} ${{ inputs.EXTRA_CMDS }} ${{ inputs.KERNEL_DEFCONFIG }}
make -j$(nproc --all) CC=clang O=out LD=ld.lld LLVM=1 ${{ inputs.LLVM_IAS }} ${{ inputs.EXTRA_CMDS }}
fi
- name: Check Kernel
run: |
cd android
if [ -f kernel/out/arch/arm64/boot/${{ github.event.inputs.KERNEL_IMAGE_NAME }} ]; then
if [ -f kernel/out/arch/arm64/boot/${{ inputs.KERNEL_IMAGE_NAME }} ]; then
echo "KERNEL_IS_OK=true" >> $GITHUB_ENV
echo "KERNEL_VERSION=$(cat kernel/out/include/config/kernel.release)" >> $GITHUB_ENV
else
Expand All @@ -80,21 +98,22 @@ jobs:
run: |
cd android
git clone --depth=1 https://github.com/cd-Crypton/AnyKernel3.git -b FOR-ALL
cd kernel/out/arch/arm64/boot && cp -r ${{ github.event.inputs.KERNEL_IMAGE_NAME }} ${GITHUB_WORKSPACE}/android/AnyKernel3
cd ${GITHUB_WORKSPACE}/android/AnyKernel3
zip -r9 UPDATE-AnyKernel3-${{ env.BUILD_DATE }}.zip * -x .git README.md *placeholder
cp -nf kernel/out/arch/arm64/boot/${{ inputs.KERNEL_IMAGE_NAME }} ${GITHUB_WORKSPACE}/android/AnyKernel3
cp -nf $(find kernel/out -name '*.ko') ${GITHUB_WORKSPACE}/android/AnyKernel3/modules/system/lib/modules/
cd AnyKernel3/
zip -r9 UPDATE-AnyKernel3-${{ env.BUILD_DATE }}-proton.zip * -x .git README.md *placeholder
- name: Upload to Release
if: env.KERNEL_IS_OK == 'true'
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
android/kernel/out/arch/arm64/boot/${{ github.event.inputs.KERNEL_IMAGE_NAME }}
android/AnyKernel3/UPDATE-AnyKernel3-${{ env.BUILD_DATE }}.zip
android/kernel/out/arch/arm64/boot/${{ inputs.KERNEL_IMAGE_NAME }}
android/AnyKernel3/UPDATE-AnyKernel3-${{ env.BUILD_DATE }}-proton.zip
name: Proton Kernel Build | ${{ env.KERNEL_VERSION }} | ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body: |
### Notes
* Kernel were built/compiled using proton-clang.
* Kernel were built/compiled using [proton-clang](https://github.com/kdrag0n/proton-clang/tree/${{ inputs.PROTON_RELEASE }}).
* Test at your own risk.
* Use kernel flasher or any custom recoveries to flash the compressed kernel zip file.
* Use kernel flasher or any custom recoveries to flash the compressed kernel zip file.
1 change: 0 additions & 1 deletion add.txt

This file was deleted.

1 change: 0 additions & 1 deletion make.txt

This file was deleted.

0 comments on commit 95b8b6a

Please sign in to comment.