Skip to content

xanmod main kernel deb #4

xanmod main kernel deb

xanmod main kernel deb #4

Workflow file for this run

name: xanmod main kernel deb
on:
workflow_dispatch:
schedule:
- cron: 0 23 * * 1
env:
TZ: Asia/Shanghai
jobs:
Build:
runs-on: ubuntu-22.04
steps:
- name: Check Xanmod Version
run: |
echo "CPU物理数量: $(cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l)"
echo "CPU核心数量: $(nproc)"
echo -e "CPU型号信息:$(cat /proc/cpuinfo | grep -m1 name | awk -F: '{print $2}')\n"
echo "已安装内存详细信息:"
echo -e "$(sudo lshw -short -C memory | grep GiB)\n"
echo "硬盘数量: $(ls /dev/sd* | grep -v [1-9] | wc -l)" && df -hT && date
set -ex
curl -L "https://dl.xanmod.org/changelog/?C=M;O=D" > /dev/shm/changelog
kernel_ver=$(grep "/</a>" /dev/shm/changelog | head -n 1)
[ -z "${kernel_ver}" ] && (cat /dev/shm/changelog; curl -L "https://xanmod.key2p.com/?version=all" > /dev/shm/changelog ) || true
kernel_ver=$(grep "/</a>" /dev/shm/changelog | head -n 1)
[ -z "${kernel_ver}" ] && (cat /dev/shm/changelog; exit 1)
kernel_regex='"([0-9.]+)/"'
[[ $kernel_ver =~ $kernel_regex ]] && export KERNEL_BASE_VER=${BASH_REMATCH[1]}
[ -z "${KERNEL_BASE_VER}" ] && echo "invalid kernel version ${KERNEL_BASE_VER}, exit" && exit 1
curl -L "https://dl.xanmod.org/changelog/${KERNEL_BASE_VER}/?C=M;O=D" > /dev/shm/changelog
xanmod_ver=$(grep ChangeLog /dev/shm/changelog | head -n 1)
[ -z "${xanmod_ver}" ] && (cat /dev/shm/changelog; curl -L "https://xanmod.key2p.com/?version=${KERNEL_BASE_VER}" > /dev/shm/changelog) || true
xanmod_ver=$(grep ChangeLog /dev/shm/changelog | head -n 1)
[ -z "${xanmod_ver}" ] && (cat /dev/shm/changelog; exit 1)
xanmod_regex='ChangeLog-([0-9.]+)-'
[[ $xanmod_ver =~ $xanmod_regex ]] && echo "XANMOD_PATCH_VER=${BASH_REMATCH[1]}" >> $GITHUB_ENV
echo "KERNEL_BASE_VER=${KERNEL_BASE_VER}" >> $GITHUB_ENV
echo "KERNEL_BASE_URL=https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${KERNEL_BASE_VER}.tar.xz" >> $GITHUB_ENV
- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
[ -z "${KERNEL_BASE_VER}" ] && echo "invalid kernel version ${KERNEL_BASE_VER}, exit" && exit 1
[ -z "${XANMOD_PATCH_VER}" ] && echo "invalid xanmod version ${XANMOD_PATCH_VER}, exit" && exit 1
echo "XANMOD_PATCH=https://sourceforge.net/projects/xanmod/files/releases/edge/${XANMOD_PATCH_VER}-xanmod1/patch-${XANMOD_PATCH_VER}-xanmod1.xz/download" >> $GITHUB_ENV
docker rmi $(docker images -q)
sudo rm -rf /usr/share/dotnet /etc/apt/sources.list.d /usr/local/lib/android $AGENT_TOOLSDIRECTORY
sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* powershell openjdk* mongodb* moby* || true
sudo -E systemctl daemon-reload
sudo -E apt-get -y autoremove --purge
sudo -E apt-get -y clean && ls -al /usr/bin/
sudo timedatectl set-timezone "$TZ"
- name: Combine Disks
uses: easimon/maximize-build-space@master
with:
swap-size-mb: 1024
temp-reserve-mb: 100
root-reserve-mb: 1024
- name: Checkout
uses: actions/checkout@main
- name: Clone Source Code
run: |
df -hT $GITHUB_WORKSPACE
mkdir -p build || true
echo "WORK_DIR=$PWD" >> $GITHUB_ENV
- name: Compile Firmware
id: compile
run: |
sudo -E bash $GITHUB_WORKSPACE/build_xanmod_docker.sh
export PATH="/opt/llvm19_krl/llvm-19.1.4-x86_64/bin/:$PATH"
cd $WORK_DIR
bash $GITHUB_WORKSPACE/build_xanmod_kernel.sh
mkdir -p $WORK_DIR/debs || true
mv -f $WORK_DIR/*.deb $WORK_DIR/debs/
echo "DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
echo "FILE_DATE=$(date +"%Y.%m.%d")" >> $GITHUB_ENV
cd $WORK_DIR/debs/
echo "FIRMWARE_PATH=$PWD" >> $GITHUB_ENV
- name: Check Space Usage
if: (!cancelled())
run: df -hT
- name: Upload Firmware To Release
if: steps.compile.outputs.status == 'success'
uses: ncipollo/release-action@v1
with:
name: R${{ env.DATE }} for ${{ env.KERNEL_BASE_VER }}
allowUpdates: true
tag: ${{ env.KERNEL_BASE_VER }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ${{ env.FIRMWARE_PATH }}/*
body: |
**This is XanMod Kernel for ${{ env.KERNEL_BASE_VER }}**
### 📒 固件信息(x86_64版本)
- ⚽ 固件源码: ${{ env.XANMOD_PATCH }}
- 💝 源码分支: ${{ env.KERNEL_BASE_VER }}
- 🚀 内核版本: ${{ env.XANMOD_PATCH_VER }}