Skip to content

Update blank.yml

Update blank.yml #2

Workflow file for this run

name: Kernel Build and Release
on:
push:
branches:
- main
env:
ROOT_DIR_PREFIX: "OP12-A15"
BRANCH: "android14-6.1"
REPO_NAME: "cabagekiller/KSU-SUSFS"
GITHUB_TOKEN: ${{ secrets.SUSFS_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Free disk space
run: |
sudo apt-get update -qq
sudo apt-get install -qq curl
curl -fsSL https://raw.githubusercontent.com/kou/arrow/e49d8ae15583ceff03237571569099a6ad62be32/ci/scripts/util_free_space.sh | bash
- name: Add 16GB Swap Space
run: |
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
free -h
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 1
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.x'
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq -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 git repo
- name: Install and update repo tool
uses: actions/cache@v3
with:
path: /usr/bin/repo
key: repo-tool
- name: Download repo tool (if not cached)
if: steps.cache-repo.outputs.cache-hit != 'true'
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: |
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
git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android14-6.1
git clone https://github.com/TheWildJames/kernel_patches.git
- name: Get the kernel
run: |
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 SUSFS
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
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/
cp ../../susfs4ksu/kernel_patches/include/linux/susfs_def.h ./common/include/linux/
cd ./KernelSU/
patch -p1 < 10_enable_susfs_for_ksu.patch || true
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
sed -i '/obj-$(CONFIG_KSU_SUSFS_SUS_SU) += sus_su.o/d' ./fs/Makefile
cd ..
- 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
- name: Configure Kernel
run: |
cd ./builds/${ROOT_DIR}/oneplus12_v/kernel_platform
cat <<EOF >> ./common/arch/arm64/configs/gki_defconfig
CONFIG_KSU=y
CONFIG_KSU_SUSFS=y
CONFIG_KSU_SUSFS_SUS_PATH=y
CONFIG_KSU_SUSFS_SUS_MOUNT=y
CONFIG_KSU_SUSFS_SUS_KSTAT=y
CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y
CONFIG_KSU_SUSFS_TRY_UMOUNT=y
CONFIG_KSU_SUSFS_SPOOF_UNAME=y
CONFIG_KSU_SUSFS_ENABLE_LOG=y
CONFIG_KSU_SUSFS_OPEN_REDIRECT=y
CONFIG_KSU_SUSFS_SUS_SU=y
EOF
sed -i '2s/check_defconfig//' ./common/build.config.gki
- name: Check Disk Space Before Build
run: df -h
- name: Build Kernel with Debugging
run: |
cd ./builds/${ROOT_DIR}/oneplus12_v
./kernel_platform/build_with_bazel.py -t pineapple gki --verbose_failures --config=stamp --user_kmi_symbol_lists=//msm-kernel:android/abi_gki_aarch64_qcom --ignore_missing_projects
- name: Check Disk Space After Build
run: df -h
- name: Create ZIP Package
id: create-zip-package # Give this step an ID so it can be referenced later
run: |
cd ./builds/${ROOT_DIR}/AnyKernel3
ZIP_NAME="Anykernel3-OP-A15-android14-6.1-KernelSU-SUSFS-$(date +'%Y-%m-%d-%H-%M-%S').zip"
echo "Creating zip file $ZIP_NAME..."
zip -r "../$ZIP_NAME" ./*
ls -lh "../$ZIP_NAME"
echo "zip_name=$ZIP_NAME" >> $GITHUB_ENV # Use GITHUB_ENV to persist the variable across steps
- name: Publish Release
run: |
cd ./builds/${ROOT_DIR}
echo "ZIP_NAME: ${{ env.zip_name }}" # Corrected: Use the environment variable from GITHUB_ENV
ZIP_FILE_PATH="$GITHUB_WORKSPACE/builds/${ROOT_DIR}/${{ env.zip_name }}"
echo "ZIP_FILE_PATH: $ZIP_FILE_PATH" # Debugging the path
gh release create "v${BRANCH}-$(date +'%Y.%m.%d-%H%M%S')" "$ZIP_FILE_PATH" \
--repo "$REPO_NAME" \
--title "OP12 A15 $BRANCH With KernelSU & SUSFS" \
--notes "Kernel release"
env:
GITHUB_TOKEN: ${{ secrets.SUSFS_TOKEN }}