mirror of
https://github.com/Dichgrem/GKI-build.git
synced 2025-12-18 14:42:00 -05:00
refactor:upload
This commit is contained in:
46
.github/workflows/build-gki-kernel.yml
vendored
46
.github/workflows/build-gki-kernel.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Build Android GKI Kernel
|
name: Build Ace3Pro Kernel
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -102,13 +102,6 @@ jobs:
|
|||||||
# 设置 KERNEL_DIR 环境变量
|
# 设置 KERNEL_DIR 环境变量
|
||||||
echo "KERNEL_DIR=android_kernel_oneplus_sm8650" >> $GITHUB_ENV
|
echo "KERNEL_DIR=android_kernel_oneplus_sm8650" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Show final WORKDIR layout
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
cd "$WORKDIR"
|
|
||||||
echo "Final layout under $WORKDIR:"
|
|
||||||
ls -la
|
|
||||||
|
|
||||||
- name: Copy and configure kernel config
|
- name: Copy and configure kernel config
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -169,6 +162,8 @@ jobs:
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "❌ 未知的 root_solution: ${{ github.event.inputs.root_solution }}" >&2
|
echo "❌ 未知的 root_solution: ${{ github.event.inputs.root_solution }}" >&2
|
||||||
|
# 默认值,避免未定义时报错
|
||||||
|
echo "ROOT_SUFFIX=_NoRoot" >> $GITHUB_ENV
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -197,7 +192,7 @@ jobs:
|
|||||||
|
|
||||||
echo "✅ Susfs patch step finished"
|
echo "✅ Susfs patch step finished"
|
||||||
else
|
else
|
||||||
echo "⚠️ Susfs patches skipped"
|
echo "ℹ️ Susfs patches skipped"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -238,7 +233,7 @@ jobs:
|
|||||||
# 清理输出目录
|
# 清理输出目录
|
||||||
rm -rf "$OUT" && mkdir -p "$OUT"
|
rm -rf "$OUT" && mkdir -p "$OUT"
|
||||||
|
|
||||||
# 1) 生成 defconfig
|
# 生成 defconfig
|
||||||
echo "=== make O=${OUT} ${KERNEL_DEFCONFIG} ==="
|
echo "=== make O=${OUT} ${KERNEL_DEFCONFIG} ==="
|
||||||
make O=${OUT} ARCH=${ARCH} ${KERNEL_DEFCONFIG}
|
make O=${OUT} ARCH=${ARCH} ${KERNEL_DEFCONFIG}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@@ -246,7 +241,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 2) 处理 LTO (none/thin/full)
|
# 处理 LTO (none/thin/full)
|
||||||
if [ "${LTO}" = "none" ] || [ "${LTO}" = "thin" ] || [ "${LTO}" = "full" ]; then
|
if [ "${LTO}" = "none" ] || [ "${LTO}" = "thin" ] || [ "${LTO}" = "full" ]; then
|
||||||
echo "Applying LTO=${LTO} to ${OUT}/.config"
|
echo "Applying LTO=${LTO} to ${OUT}/.config"
|
||||||
if [ "${LTO}" = "none" ]; then
|
if [ "${LTO}" = "none" ]; then
|
||||||
@@ -262,7 +257,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 3) 构建参数
|
# 构建参数
|
||||||
TH_COUNT=$(nproc)
|
TH_COUNT=$(nproc)
|
||||||
echo "Using ${TH_COUNT} parallel jobs"
|
echo "Using ${TH_COUNT} parallel jobs"
|
||||||
DEF_ARGS="O=${OUT} \
|
DEF_ARGS="O=${OUT} \
|
||||||
@@ -352,22 +347,21 @@ jobs:
|
|||||||
echo "=== 新刷机包信息 ==="
|
echo "=== 新刷机包信息 ==="
|
||||||
zipinfo $NEW_ZIP
|
zipinfo $NEW_ZIP
|
||||||
|
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: kernel-build-${{ github.run_number }}
|
name: kernel-build-${{ github.run_number }}${{ env.ROOT_SUFFIX }}
|
||||||
path: |
|
path: |
|
||||||
# 内核 Image
|
${{ github.workspace }}/kernel/${{ env.KERNEL_DIR }}/out/arch/arm64/boot/Image*
|
||||||
${{ github.workspace }}/kernel/${{ env.KERNEL_DIR }}/out/arch/arm64/boot/Image*
|
${{ github.workspace }}/kernel/${{ env.KERNEL_DIR }}/out/arch/arm64/boot/dts/*/*.dtb
|
||||||
# Device Tree Blob
|
${{ github.workspace }}/kernel/${{ env.KERNEL_DIR }}/out/error.log
|
||||||
${{ github.workspace }}/kernel/${{ env.KERNEL_DIR }}/out/arch/arm64/boot/dts/*/*.dtb
|
${{ github.workspace }}/kernel/${{ env.KERNEL_DIR }}/out/.config
|
||||||
# 编译日志
|
${{ github.workspace }}/kernel/output/kernel_info.txt
|
||||||
${{ github.workspace }}/kernel/${{ env.KERNEL_DIR }}/out/error.log
|
|
||||||
# 最终配置文件
|
- name: Upload AnyKernel3 package
|
||||||
${{ github.workspace }}/kernel/${{ env.KERNEL_DIR }}/out/.config
|
uses: actions/upload-artifact@v4
|
||||||
# 替换后的 anykernel3.zip
|
if: always()
|
||||||
${{ github.workspace }}/anykernel3-${{ github.run_number }}.zip
|
with:
|
||||||
# Kernel 信息文件
|
name: anykernel3-${{ github.run_number }}${{ env.ROOT_SUFFIX }}
|
||||||
${{ github.workspace }}/kernel/output/kernel_info.txt
|
path: ${{ github.workspace }}/anykernel3-${{ github.run_number }}.zip
|
||||||
Reference in New Issue
Block a user