Skip to content

Commit

Permalink
Update blank.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
cabagekiller authored Jan 6, 2025
1 parent 39e6947 commit f2d9c5d
Showing 1 changed file with 60 additions and 44 deletions.
104 changes: 60 additions & 44 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,29 @@ name: Build and Release Kernel
on:
push:
branches:
- main
- main # Trigger the workflow on pushes to the main branch

env:
ROOT_DIR_PREFIX: "OP12-A15"
BRANCH: "android14-6.1"
REPO_NAME: "Cabagekiller/OnePlus_KernelSU_SUSFS"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_NAME: "Cabagekiller/OnePlus_KernelSU_SUSFS"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1 # Fetch only the latest commit

- name: Free disk space
run: curl -fsSL https://raw.githubusercontent.com/kou/arrow/e49d8ae15583ceff03237571569099a6ad62be32/ci/scripts/util_free_space.sh | bash
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt-get clean
docker rmi $(docker images -q)
df -h
- name: Add 16GB Swap Space
run: |
Expand All @@ -26,10 +35,6 @@ jobs:
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
free -h
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -38,66 +43,71 @@ jobs:

- name: Install dependencies
run: |
set -e
sudo apt-get update
sudo apt-get install -y zip bc bison flex g++-multilib \
gcc-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev \
libx11-dev lib32z1-dev libgl1-mesa-glx \
libxml2-utils xsltproc unzip gh
gcc-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev \
libx11-dev lib32z1-dev libgl1-mesa-glx \
libxml2-utils xsltproc unzip gh
- name: Install and update repo tool
run: |
sudo wget -O /usr/bin/repo https://storage.googleapis.com/git-repo-downloads/repo
sudo chmod a+x /usr/bin/repo
- name: Set up directories
run: |
set -e
mkdir -p ./builds
cd ./builds
export ROOT_DIR="${ROOT_DIR_PREFIX}-$(date +'%Y-%m-%d-%I-%M-%p')-release"
mkdir -p "$ROOT_DIR"
- name: Clone repositories
run: |
cd ./builds/${ROOT_DIR}
git clone https://github.com/TheWildJames/AnyKernel3.git -b $BRANCH
- name: Get the kernel
run: |
set -e
cd ./builds/${ROOT_DIR}
mkdir oneplus12_v && cd oneplus12_v
repo init -u https://github.com/OnePlusOSS/kernel_manifest.git -b oneplus/sm8650 -m oneplus12_v.xml --depth=1
repo sync -j$(nproc) -f
rm -rf ./kernel_platform/common/android/abi_gki_protected_exports_*
- name: Add KernelSU
run: |
cd ./builds/${ROOT_DIR}/oneplus12_v/kernel_platform
curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU-Next/next/kernel/setup.sh" | bash -s next-susfs
- name: Set KSU_GIT_VERSION
run: |
cd ./builds/${ROOT_DIR}/oneplus12_v/kernel_platform
export KSU_GIT_VERSION=$(git rev-parse HEAD)
echo "KSU_GIT_VERSION=$KSU_GIT_VERSION" >> $GITHUB_ENV
#add susfs
echo "adding susfs"
cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/
cp ../../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-6.1.patch ./common/
cp ../../susfs4ksu/kernel_patches/fs/susfs.c ./common/fs/
cp ../../susfs4ksu/kernel_patches/include/linux/susfs.h ./common/include/linux/
cd ./KernelSU-Next/
patch -p1 < 10_enable_susfs_for_ksu.patch
cd ../common
patch -p1 < 50_add_susfs_in_gki-android14-6.1.patch || true
cp ../../kernel_patches/69_hide_stuff.patch ./
patch -p1 -F 3 < 69_hide_stuff.patch || true
sed -i '/obj-\$(CONFIG_KSU_SUSFS_SUS_SU) += sus_su.o/d' ./fs/Makefile
cd ..
cp ../kernel_patches/selinux.c_fix.patch ./
patch -p1 -F 3 < selinux.c_fix.patch
cp ../kernel_patches/apk_sign.c_fix.patch ./
patch -p1 -F 3 < apk_sign.c_fix.patch
cp ../kernel_patches/Makefile_fix.patch ./
patch -p1 --fuzz=3 < ./Makefile_fix.patch
- name: Add SUSFS
run: |
cd ./builds/${ROOT_DIR}/oneplus12_v/kernel_platform
echo "adding susfs"
cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/
cp ../../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-6.1.patch ./common/
cp ../../susfs4ksu/kernel_patches/fs/susfs.c ./common/fs/
cp ../../susfs4ksu/kernel_patches/include/linux/susfs.h ./common/include/linux/
cd ./KernelSU-Next/
patch -p1 < 10_enable_susfs_for_ksu.patch
cd ../common
patch -p1 < 50_add_susfs_in_gki-android14-6.1.patch || true
cp ../../kernel_patches/69_hide_stuff.patch ./
patch -p1 -F 3 < 69_hide_stuff.patch || true
sed -i '/obj-$(CONFIG_KSU_SUSFS_SUS_SU) += sus_su.o/d' ./fs/Makefile
cd ..
cp ../kernel_patches/selinux.c_fix.patch ./
patch -p1 -F 3 < selinux.c_fix.patch
cp ../kernel_patches/apk_sign.c_fix.patch ./
patch -p1 -F 3 < apk_sign.c_fix.patch
cp ../kernel_patches/Makefile_fix.patch ./
patch -p1 --fuzz=3 < ./Makefile_fix.patch
- name: Configure Kernel
run: |
Expand All @@ -114,6 +124,7 @@ patch -p1 --fuzz=3 < ./Makefile_fix.patch
echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig
echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig
sed -i '2s/check_defconfig//' ./common/build.config.gki
- name: Disable Kernel Debug Config
run: |
cd ./builds/${ROOT_DIR}/oneplus12_v/kernel_platform
Expand All @@ -123,6 +134,7 @@ patch -p1 --fuzz=3 < ./Makefile_fix.patch
sed -i '/CONFIG_DEBUG_FS/d' ./common/arch/arm64/configs/gki_defconfig
sed -i '/CONFIG_DEBUG_SECTION_MISMATCH/d' ./common/arch/arm64/configs/gki_defconfig
echo "# Kernel debugging disabled for production build" >> ./common/arch/arm64/configs/gki_defconfig
- name: Verify repo sync and check kernel platform directory
run: |
cd ./builds/${ROOT_DIR}/oneplus12_v
Expand All @@ -132,25 +144,29 @@ patch -p1 --fuzz=3 < ./Makefile_fix.patch
fi
echo "Directory kernel_platform exists. Listing contents..."
ls -R ./kernel_platform
- name: Build Kernel
run: |
set -e
cd ./builds/${ROOT_DIR}/oneplus12_v
./kernel_platform/build_with_bazel.py -t pineapple gki --jobs=4
- name: Copy Kernel Image
run: |
cp ./builds/${ROOT_DIR}/oneplus12_v/kernel_platform/out/dist/Image ./builds/${ROOT_DIR}/AnyKernel3/Image
- name: Create ZIP Package
run: |
cd ./builds/${ROOT_DIR}/AnyKernel3
ZIP_NAME="Anykernel3-OP-A15-${BRANCH}-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip"
zip -r "../$ZIP_NAME" ./*
ls -lh "../$ZIP_NAME"
- name: Publish Release
run: |
cd ./builds/${ROOT_DIR}
gh release create "v$(date +'%Y.%m.%d-%H%M%S')" "$ZIP_NAME" \
--repo "$REPO_NAME" \
--title "OP12 A15 $BRANCH With KernelSUnext & SUSFS" \
--notes "Kernel release"
uses: softprops/action-gh-release@v1
with:
files: ./builds/${ROOT_DIR}/$ZIP_NAME
tag_name: "v$(date +'%Y.%m.%d-%H%M%S')"
name: "OP12 A15 $BRANCH With KernelSUnext & SUSFS"
body: "Kernel release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f2d9c5d

Please sign in to comment.