Skip to content

Kernel Build 5.15

Kernel Build 5.15 #51

Workflow file for this run

name: Kernel Build 5.15
on:
workflow_dispatch:
inputs:
KERNEL_REPO:
description: 'KERNEL_REPO'
required: true
default: 'https://github.com/zainarbani/kernel-5.15'
BUILD_SCRIPT_REPO:
description: 'BUILD_SCRIPT_REPO'
required: true
default: 'https://github.com/zainarbani/kernel_build_script'
BUILD_SCRIPT_BRANCH:
description: 'BUILD_SCRIPT_BRANCH'
required: true
default: 'a54x'
jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
runs-on: buildjet-8vcpu-ubuntu-2204
permissions:
contents: write
strategy:
matrix:
branches: ['main', 'ksu-next-sus', 'main-oc', 'ksu-next-sus-oc']
outputs:
CLANG_VER: ${{ steps.build_kernel.outputs.CLANG_VER }}
KERNEL_VER: ${{ steps.build_kernel.outputs.KERNEL_VER }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Prepare Environment
run: |
mkdir -p ${{ github.workspace }}/builds/${{ matrix.branches }}
sudo apt update
sudo apt install -y libelf-dev dwarves
- name: Sync Kernel
run: |
cd ${{ github.workspace }}/builds/${{ matrix.branches }}
KERNEL_BRANCH=${{ matrix.branches }}
git clone --depth=1 -b "${KERNEL_BRANCH/-oc/}" ${{ github.event.inputs.KERNEL_REPO }} kernel
cd kernel
git clone --depth=1 -b ${{ github.event.inputs.BUILD_SCRIPT_BRANCH }} ${{ github.event.inputs.BUILD_SCRIPT_REPO }} kernel_build
- name: Build Kernel
id: build_kernel
run: |
cd ${{ github.workspace }}/builds/${{ matrix.branches }}/kernel
chmod +x kernel_build/build.sh
if [[ ${{ matrix.branches }} == *"-oc"* ]]; then
./kernel_build/build.sh oc
else
./kernel_build/build.sh
fi
KERNEL_VER=$(make kernelversion)
CLANG_VER=$(../toolchain/clang/bin/clang --version | head -n 1 | perl -pe 's/\(http.*?\)//gs' | sed -e 's/ */ /g')
echo "KERNEL_VER=${KERNEL_VER}" >> $GITHUB_OUTPUT
echo "CLANG_VER=${CLANG_VER}" >> $GITHUB_OUTPUT
- name: Prepare Artifacts
run: |
cd ${{ github.workspace }}/builds/${{ matrix.branches }}/kernel/kernel_build
if [[ ${{ matrix.branches }} == "main-oc" ]]; then
mv Kernel_a54x.tar Exynoobs_a54x-oc.tar
mv Kernel_a54x.zip Exynoobs_a54x-oc.zip
elif [[ ${{ matrix.branches }} == "main" ]]; then
mv Kernel_a54x.tar Exynoobs_a54x.tar
mv Kernel_a54x.zip Exynoobs_a54x.zip
else
mv Kernel_a54x.tar Exynoobs_a54x-${{ matrix.branches }}.tar
mv Kernel_a54x.zip Exynoobs_a54x-${{ matrix.branches }}.zip
fi
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: kernel-builds-${{ matrix.branches }}
retention-days: 0
path: |
${{ github.workspace }}/builds/${{ matrix.branches }}/kernel/kernel_build/*.tar
${{ github.workspace }}/builds/${{ matrix.branches }}/kernel/kernel_build/*.zip
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Gather Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Generate Release
run: |
export TZ="Asia/Jakarta"
BUILD_DATE=$(date "+%Y%m%d%H%M")
echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV
echo "BUILD_REL=${{ github.event.inputs.BUILD_SCRIPT_BRANCH }}_${BUILD_DATE}" >> $GITHUB_ENV
{
echo "**Build Info**"
echo ""
echo "**Device:** ${{ github.event.inputs.BUILD_SCRIPT_BRANCH }}"
echo "**Kernel Source:** ${{ github.event.inputs.KERNEL_REPO }}"
echo "**Kernel Version:** ${{ needs.build.outputs.KERNEL_VER }}"
echo "**Clang Version:** ${{ needs.build.outputs.CLANG_VER }}"
echo "**Notes:**"
echo " - vendor_boot included"
echo ""
echo "---"
} > release.md
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: artifacts/**
name: ${{ env.BUILD_REL }}
tag_name: ${{ env.BUILD_REL }}
body_path: release.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete Artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: kernel-builds-*
failOnError: false
- name: Update Telegram
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.CHAT_ID }}
token: ${{ secrets.BOT_TOKEN }}
format: html
disable_web_page_preview: true
message: |
<b>Exynoobs Kernel Update</b>
<b>Build Date:</b> ${{ env.BUILD_DATE }}
<b>Device:</b> ${{ github.event.inputs.BUILD_SCRIPT_BRANCH }}
<b>Kernel:</b> ${{ needs.build.outputs.KERNEL_VER }}
<b>Clang:</b> ${{ needs.build.outputs.CLANG_VER }}
<b><a href="https://github.com/${{ github.repository }}/releases/tag/${{ env.BUILD_REL }}">Download</a></b>