build.yml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. name: Kernel Build Process
  2. permissions:
  3. contents: write
  4. actions: write
  5. on:
  6. workflow_call:
  7. inputs:
  8. kernel_version:
  9. required: true
  10. type: string
  11. variant:
  12. required: false
  13. type: string
  14. ksu_commit:
  15. required: false
  16. type: string
  17. anykernel_commit:
  18. required: false
  19. type: string
  20. patches_commit:
  21. required: false
  22. type: string
  23. susfs_commit:
  24. required: false
  25. type: string
  26. feature_set:
  27. required: true
  28. type: string
  29. jobs:
  30. build-gki:
  31. name: "${{ inputs.kernel_version }}${{ inputs.variant && format('-{0}', inputs.variant) || '' }}"
  32. runs-on: ubuntu-latest
  33. timeout-minutes: 60
  34. steps:
  35. - name: Checkout Repository
  36. uses: actions/checkout@v4
  37. - name: Parse kernel version
  38. id: parse
  39. run: |
  40. # Parse version string.
  41. # Format: [KERNEL_VERSION].[SUBLEVEL]-[ANDROID_VERSION]-[PATCH_LEVEL]
  42. # Example 1: 5.10.198-android12-2024-01 -> K=5.10, S=198, A=android12, P=2024-01
  43. # Example 2: 5.10.X-android12-lts -> K=5.10, S=X, A=android12, P=lts
  44. INPUT_VERSION="${{ inputs.kernel_version }}"
  45. # Split by hyphens
  46. IFS='-' read -r KERNEL_PART ANDROID_PART REST <<< "$INPUT_VERSION"
  47. # Extract Kernel Version and Sublevel
  48. KERNEL_VERSION="${KERNEL_PART%.*}"
  49. SUB_LEVEL="${KERNEL_PART##*.}"
  50. # Extract Android Version
  51. ANDROID_VERSION="$ANDROID_PART"
  52. # Everything after the android version is the patch level
  53. OS_PATCH_LEVEL="$REST"
  54. # Special handling for "X" sublevel (LTS builds)
  55. if [[ "$SUB_LEVEL" == "X" ]]; then
  56. echo "Detected LTS build with wildcard sublevel"
  57. fi
  58. echo "Parsed: KERNEL=$KERNEL_VERSION, SUB=$SUB_LEVEL, ANDROID=$ANDROID_VERSION, PATCH=$OS_PATCH_LEVEL"
  59. # Set environment variables for subsequent steps and shell scripts
  60. echo "ANDROID_VERSION=$ANDROID_VERSION" >> "$GITHUB_ENV"
  61. echo "KERNEL_VERSION=$KERNEL_VERSION" >> "$GITHUB_ENV"
  62. echo "SUB_LEVEL=$SUB_LEVEL" >> "$GITHUB_ENV"
  63. echo "OS_PATCH_LEVEL=$OS_PATCH_LEVEL" >> "$GITHUB_ENV"
  64. # Set step outputs for immediate YAML context access (avoids validation warnings)
  65. echo "android_version=$ANDROID_VERSION" >> $GITHUB_OUTPUT
  66. echo "kernel_version=$KERNEL_VERSION" >> $GITHUB_OUTPUT
  67. echo "sub_level=$SUB_LEVEL" >> $GITHUB_OUTPUT
  68. echo "os_patch_level=$OS_PATCH_LEVEL" >> $GITHUB_OUTPUT
  69. - name: Install linker tools
  70. if: steps.parse.outputs.kernel_version == '5.10'
  71. run: |
  72. sudo apt-get update
  73. sudo apt-get install -y binutils lld
  74. echo "ld.lld --version" # Log verification
  75. - name: Free Disk Space
  76. if: true
  77. uses: endersonmenezes/free-disk-space@v3 # Use @main for latest, @v3 for stable
  78. with:
  79. remove_android: true
  80. remove_dotnet: true
  81. remove_haskell: true
  82. remove_tool_cache: true
  83. remove_swap: true
  84. remove_packages: "azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox postgresql* temurin-* *llvm* mysql* dotnet-sdk-*"
  85. remove_packages_one_command: true
  86. remove_folders: "/usr/share/swift /usr/share/miniconda /usr/share/az* /usr/local/lib/node_modules /usr/local/share/chromium /usr/local/share/powershell /usr/local/julia /usr/local/aws-cli /usr/local/aws-sam-cli /usr/share/gradle"
  87. rm_cmd: "rmz" # Use 'rmz' for faster deletion (default: 'rm')
  88. rmz_version: "3.1.1" # Required when rm_cmd is 'rmz'
  89. testing: false
  90. - name: Setup Build Environment
  91. run: |
  92. mkdir -p "$GITHUB_WORKSPACE/kernel"
  93. mkdir -p "$GITHUB_WORKSPACE/git-repo"
  94. curl -L https://storage.googleapis.com/git-repo-downloads/repo -o "$GITHUB_WORKSPACE/git-repo/repo"
  95. chmod +x "$GITHUB_WORKSPACE/git-repo/repo"
  96. echo "$GITHUB_WORKSPACE/git-repo" >> "$GITHUB_PATH"
  97. # Clone patches if commit is provided
  98. if [ -n "${{ inputs.patches_commit }}" ]; then
  99. echo "Cloning Kernel Patches at commit ${{ inputs.patches_commit }}"
  100. if [ -d "$GITHUB_WORKSPACE/kernel_patches" ]; then rm -rf "$GITHUB_WORKSPACE/kernel_patches"; fi
  101. git clone https://github.com/WildKernels/kernel_patches.git "$GITHUB_WORKSPACE/kernel_patches"
  102. cd "$GITHUB_WORKSPACE/kernel_patches"
  103. git checkout "${{ inputs.patches_commit }}"
  104. cd "$GITHUB_WORKSPACE"
  105. else
  106. git clone https://github.com/WildKernels/kernel_patches.git "$GITHUB_WORKSPACE/kernel_patches"
  107. fi
  108. # Use specific commit if provided
  109. if [ -n "${{ inputs.anykernel_commit }}" ]; then
  110. echo "Cloning AnyKernel3 at commit ${{ inputs.anykernel_commit }}"
  111. if [ -d "$GITHUB_WORKSPACE/AnyKernel3" ]; then rm -rf "$GITHUB_WORKSPACE/AnyKernel3"; fi
  112. git clone https://github.com/WildKernels/AnyKernel3.git "$GITHUB_WORKSPACE/AnyKernel3"
  113. cd "$GITHUB_WORKSPACE/AnyKernel3"
  114. git checkout "${{ inputs.anykernel_commit }}"
  115. cd "$GITHUB_WORKSPACE"
  116. elif [ ! -d "$GITHUB_WORKSPACE/AnyKernel3" ]; then
  117. # Fallback if not downloaded
  118. git clone https://github.com/WildKernels/AnyKernel3.git -b gki-2.0 "$GITHUB_WORKSPACE/AnyKernel3"
  119. fi
  120. - name: Download Kernel Repository
  121. uses: ./.github/actions/download-kernel
  122. with:
  123. android_version: ${{ steps.parse.outputs.android_version }}
  124. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  125. os_patch_level: ${{ steps.parse.outputs.os_patch_level }}
  126. - name: Extract Sublevel and Set File Name
  127. id: extract
  128. run: |
  129. SUBLEVEL="$SUB_LEVEL"
  130. if [[ -f "$GITHUB_WORKSPACE/kernel/common/Makefile" ]]; then
  131. EXTRACTED=$(grep '^SUBLEVEL = ' "$GITHUB_WORKSPACE/kernel/common/Makefile" | awk '{print $3}')
  132. [[ -n "$EXTRACTED" ]] && SUBLEVEL="$EXTRACTED"
  133. fi
  134. FILE_NAME="$KERNEL_VERSION.$SUBLEVEL-$ANDROID_VERSION-$OS_PATCH_LEVEL${{ inputs.variant && format('-{0}', inputs.variant) || '' }}"
  135. echo "SUBLEVEL=$SUBLEVEL" >> $GITHUB_ENV
  136. echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV
  137. # Set step outputs for parse-time YAML context access
  138. echo "file_name=$FILE_NAME" >> $GITHUB_OUTPUT
  139. echo "sublevel=$SUBLEVEL" >> $GITHUB_OUTPUT
  140. - name: Apply glibc 2.38 Compatibility Fix
  141. if: false
  142. run: |
  143. # Use SUBLEVEL for LTS builds, otherwise use the input sub_level
  144. if [[ "$ANDROID_VERSION" == "android13" && "$KERNEL_VERSION" == "5.10" && $SUBLEVEL -le 186 ]] ||
  145. [[ "$ANDROID_VERSION" == "android13" && "$KERNEL_VERSION" == "5.15" && $SUBLEVEL -le 119 ]] ||
  146. [[ "$ANDROID_VERSION" == "android14" && "$KERNEL_VERSION" == "5.15" && $SUBLEVEL -le 110 ]] ||
  147. [[ "$ANDROID_VERSION" == "android14" && "$KERNEL_VERSION" == "6.1" && $SUBLEVEL -le 43 ]]; then
  148. GLIBC_VERSION=$(ldd --version 2>/dev/null | head -n 1 | awk '{print $NF}')
  149. if [ "$(printf '%s\n' "2.38" "$GLIBC_VERSION" | sort -V | head -n1)" = "2.38" ]; then
  150. cd "$GITHUB_WORKSPACE/kernel/common"
  151. sed -i '/\$(Q)\$(MAKE) -C \$(SUBCMD_SRC) OUTPUT=\$(abspath \$(dir \$@))\/ \$(abspath \$@)/s//$(Q)$(MAKE) -C $(SUBCMD_SRC) EXTRA_CFLAGS="$(CFLAGS)" OUTPUT=$(abspath $(dir $@))\/ $(abspath $@)/' tools/bpf/resolve_btfids/Makefile 2>/dev/null || true
  152. if [[ "$ANDROID_VERSION" == "android13" && "$KERNEL_VERSION" == "5.10" && $SUBLEVEL -le 186 ]] ||
  153. [[ "$ANDROID_VERSION" == "android13" && "$KERNEL_VERSION" == "5.15" && $SUBLEVEL -le 119 ]] ||
  154. [[ "$ANDROID_VERSION" == "android14" && "$KERNEL_VERSION" == "5.15" && $SUBLEVEL -le 110 ]]; then
  155. sed -i '/char \*buf = NULL;/a int i;' tools/lib/subcmd/parse-options.c 2>/dev/null || true
  156. sed -i 's/for (int i = 0; subcommands\[i\]; i++) {/for (i = 0; subcommands[i]; i++) {/' tools/lib/subcmd/parse-options.c 2>/dev/null || true
  157. sed -i '/if (subcommands) {/a int i;' tools/lib/subcmd/parse-options.c 2>/dev/null || true
  158. sed -i 's/for (int i = 0; subcommands\[i\]; i++)/for (i = 0; subcommands[i]; i++)/' tools/lib/subcmd/parse-options.c 2>/dev/null || true
  159. fi
  160. fi
  161. fi
  162. - name: Fix Less Than 6.6.50 Builds
  163. if: ${{ steps.parse.outputs.android_version == 'android15' && steps.parse.outputs.kernel_version == '6.6' }} && false
  164. working-directory: ${{ github.workspace }}/kernel/common
  165. run: |
  166. if ! grep -qxF '#include <trace/hooks/fs.h>' ./fs/namespace.c; then
  167. sed -i '/#include <trace\/hooks\/blk.h>/a #include <trace\/hooks\/fs.h>' ./fs/namespace.c
  168. fi
  169. - name: Setup Wild KSU
  170. if: contains(inputs.feature_set, 'WKSU')
  171. uses: ./.github/actions/wksu
  172. with:
  173. ksu_commit: ${{ inputs.ksu_commit }}
  174. - name: Setup SUSFS
  175. if: contains(inputs.feature_set, 'SUSFS')
  176. uses: ./.github/actions/susfs
  177. with:
  178. android_version: ${{ steps.parse.outputs.android_version }}
  179. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  180. os_patch_level: ${{ steps.parse.outputs.os_patch_level }}
  181. sublevel: ${{ steps.extract.outputs.sublevel }}
  182. susfs_commit: ${{ inputs.susfs_commit }}
  183. - name: Setup Baseband Guard
  184. if: contains(inputs.feature_set, 'BBG')
  185. uses: ./.github/actions/bbg
  186. - name: Apply Module Check Bypass
  187. if: ${{ inputs.variant == 'Bypass' || inputs.variant == 'Hakan' }}
  188. run: |
  189. if [[ "$KERNEL_VERSION" == "6.1" || "$KERNEL_VERSION" == "6.6" || "$KERNEL_VERSION" == "6.12" ]]; then
  190. TARGET_FILE="$GITHUB_WORKSPACE/kernel/common/kernel/module/version.c"
  191. else
  192. TARGET_FILE="$GITHUB_WORKSPACE/kernel/common/kernel/module.c"
  193. fi
  194. # Apply bypass patch to the target file
  195. sed -i '/bad_version:/{:a;n;/return 0;/{s/return 0;/return 1;/;b};ba}' "$TARGET_FILE"
  196. # Verify the bypass
  197. if grep -A 5 "bad_version:" "$TARGET_FILE" | grep -q "return 1;"; then
  198. echo "SUCCESS: Module check bypass verified in $TARGET_FILE"
  199. else
  200. echo "FAILED: Module check bypass not found in $TARGET_FILE"
  201. grep -A 5 "bad_version:" "$TARGET_FILE" || true
  202. exit 1
  203. fi
  204. - name: Apply Device-Specific Patches
  205. uses: ./.github/actions/apply-device-patches
  206. with:
  207. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  208. - name: Configure Kernel Options
  209. uses: ./.github/actions/configure-kernel
  210. - name: Setup Hakan
  211. if: ${{ inputs.variant == 'Hakan' }}
  212. uses: ./.github/actions/hakan
  213. - name: Setup vTomsonek
  214. if: ${{ inputs.variant == 'vTomsonek' }}
  215. uses: ./.github/actions/vtomsonek
  216. with:
  217. android_version: ${{ steps.parse.outputs.android_version }}
  218. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  219. sublevel: ${{ steps.parse.outputs.sub_level }}
  220. os_patch_level: ${{ steps.parse.outputs.os_patch_level }}
  221. - name: Apply ABI Compare Bypass
  222. if: false
  223. working-directory: ${{ github.workspace }}/kernel
  224. run: |
  225. # ABI compare bypass per kernel/android version
  226. # Edit each block as needed per version
  227. if [[ "$ANDROID_VERSION" == "android12" && "$KERNEL_VERSION" == "5.10" ]]; then
  228. sed -i 's/^\s*exit 1$/ echo "Who Cares? Bypassing Now!"/' build/abi/compare_to_symbol_list
  229. elif [[ "$ANDROID_VERSION" == "android13" && "$KERNEL_VERSION" == "5.10" ]]; then
  230. sed -i 's/^\s*exit 1$/ echo "Who Cares? Bypassing Now!"/' build/kernel/abi/compare_to_symbol_list
  231. elif [[ "$ANDROID_VERSION" == "android13" && "$KERNEL_VERSION" == "5.15" ]]; then
  232. sed -i 's/^\s*exit 1$/ echo "Who Cares? Bypassing Now!"/' build/kernel/abi/compare_to_symbol_list
  233. elif [[ "$ANDROID_VERSION" == "android14" && "$KERNEL_VERSION" == "5.15" ]]; then
  234. perl -i -pe 's/^(\s*)return 1$/$1print("Who Cares? Bypassing Now!")\n$1return 0/g if /if missing_symbols:/../return 1/' build/kernel/abi/check_buildtime_symbol_protection.py
  235. elif [[ "$ANDROID_VERSION" == "android14" && "$KERNEL_VERSION" == "6.1" ]]; then
  236. perl -i -pe 's/^(\s*)return 1$/$1print("Who Cares? Bypassing Now!")\n$1return 0/g if /if missing_symbols:/../return 1/' build/kernel/abi/check_buildtime_symbol_protection.py
  237. elif [[ "$ANDROID_VERSION" == "android15" && "$KERNEL_VERSION" == "6.6" ]]; then
  238. perl -i -pe 's/^(\s*)return 1$/$1print("Who Cares? Bypassing Now!")\n$1return 0/g if /if missing_symbols:/../return 1/' build/kernel/abi/check_buildtime_symbol_protection.py
  239. fi
  240. - name: Append ashmem exports if missing
  241. if: ${{ steps.parse.outputs.android_version == 'android16' && steps.parse.outputs.kernel_version == '6.12' && false }}
  242. working-directory: ${{ github.workspace }}/kernel
  243. run: |
  244. FILE=common/drivers/staging/android/ashmem.c
  245. if [[ -f "$FILE" ]] && ! grep -q 'is_ashmem_file' "$FILE"; then
  246. cat >>"$FILE" <<'EOF'
  247. bool is_ashmem_file(struct file *file) { return false; }
  248. int ashmem_area_name(struct file *file, char *name) { return 0; }
  249. long ashmem_area_size(struct file *file) { return 0; }
  250. struct file *ashmem_area_vmfile(struct file *file) { return NULL; }
  251. EXPORT_SYMBOL_GPL(is_ashmem_file);
  252. EXPORT_SYMBOL_GPL(ashmem_area_name);
  253. EXPORT_SYMBOL_GPL(ashmem_area_size);
  254. EXPORT_SYMBOL_GPL(ashmem_area_vmfile);
  255. EOF
  256. fi
  257. if [ -f common/drivers/android/binder/Makefile ]; then
  258. perl -i -0777 -pe 's/\$\(\s*CONFIG_ANDROID_BINDER_IPC_RUST\s*\)/m/' common/drivers/android/binder/Makefile
  259. #perl -i -ne 'print unless /CONFIG_ANDROID_BINDER_IPC_RUST_DUMMY/' common/drivers/android/binder/Makefile
  260. perl -i -pe 's/^rust_binder-\$\([^)]+\)\s*:=/rust_binder-y :=/' common/drivers/android/binder/Makefile
  261. cat common/drivers/android/Makefile
  262. cat common/drivers/android/binder/Makefile
  263. #perl -ni -e 'print unless /rust_toolchain\s*=\s*"\/\/build\/rust:linux_kernel_toolchain",/' common/BUILD.bazel
  264. #cat common/BUILD.bazel
  265. rustup set profile minimal
  266. rustup update nightly
  267. rustup default nightly
  268. rustup target add aarch64-unknown-none
  269. else
  270. perl -i -0777 -pe 's/\$\(\s*CONFIG_ANDROID_BINDER_IPC_RUST\s*\)/m/' common/drivers/android/Makefile
  271. cat common/drivers/android/Makefile
  272. fi
  273. - name: Apply Kernel Branding
  274. uses: ./.github/actions/apply-kernel-branding
  275. with:
  276. build_type: ${{ inputs.variant || 'Normal' }}
  277. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  278. - name: Clean Kernel Flags
  279. uses: ./.github/actions/clean-kernel-flags
  280. - name: Build Kernel
  281. working-directory: ${{ github.workspace }}/kernel
  282. run: |
  283. set -ex
  284. #make -C common mrproper
  285. if [ -f "build/build.sh" ]; then
  286. GKI_DEFCONFIG_FRAGMENT="$GITHUB_WORKSPACE/wild_gki.fragment" LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh || exit 1
  287. else
  288. # Copy fragment to kernel tree for bazel
  289. cp "$GITHUB_WORKSPACE/wild_gki.fragment" common/arch/arm64/configs/wild_gki.fragment
  290. if [[ "$ANDROID_VERSION" == "android14" ]]; then
  291. tools/bazel build --config=fast --lto=thin --defconfig_fragment=//common:arch/arm64/configs/wild_gki.fragment //common:kernel_aarch64_dist || exit 1
  292. else
  293. tools/bazel build --config=fast --lto=none --defconfig_fragment=//common:arch/arm64/configs/wild_gki.fragment //common:kernel_aarch64_dist || exit 1
  294. fi
  295. fi
  296. - name: Prepare AnyKernel3 Zip
  297. run: |
  298. # Copy Image from normal build locations
  299. if [ -f "$GITHUB_WORKSPACE/kernel/out/$ANDROID_VERSION-$KERNEL_VERSION/dist/Image" ]; then
  300. cp "$GITHUB_WORKSPACE/kernel/out/$ANDROID_VERSION-$KERNEL_VERSION/dist/Image" "$GITHUB_WORKSPACE/AnyKernel3/Image"
  301. elif [ -f "$GITHUB_WORKSPACE/kernel/bazel-bin/common/kernel_aarch64/Image" ]; then
  302. cp "$GITHUB_WORKSPACE/kernel/bazel-bin/common/kernel_aarch64/Image" "$GITHUB_WORKSPACE/AnyKernel3/Image"
  303. else
  304. echo "Error: Image file not found in any expected location"
  305. exit 1
  306. fi
  307. - name: Copy snd-aloop module
  308. if: ${{ inputs.variant == 'vTomsonek' }}
  309. run: |
  310. if [ "${{ inputs.variant }}" = "vTomsonek" ]; then
  311. sed -i 's|^do\.modules=.*|do.modules=1|' "$GITHUB_WORKSPACE/AnyKernel3/anykernel.sh"
  312. fi
  313. mkdir -p "$GITHUB_WORKSPACE/AnyKernel3/modules/data/adb/lkm"
  314. if [[ "$ANDROID_VERSION" == "android12" || "$ANDROID_VERSION" == "android13" ]]; then
  315. SRC_DIR="$GITHUB_WORKSPACE/kernel/out/$ANDROID_VERSION-$KERNEL_VERSION/dist"
  316. else
  317. SRC_DIR="$GITHUB_WORKSPACE/kernel/bazel-bin/common/kernel_aarch64"
  318. fi
  319. cp "$SRC_DIR/snd-aloop.ko" "$GITHUB_WORKSPACE/AnyKernel3/modules/data/adb/lkm/"
  320. cp "$SRC_DIR/g_audio.ko" "$GITHUB_WORKSPACE/AnyKernel3/modules/data/adb/lkm/"
  321. - name: Scan and collect patch rejects
  322. id: scan
  323. if: ${{ always() }}
  324. run: |
  325. set -e
  326. CONFIG_DIR="$GITHUB_WORKSPACE/kernel"
  327. REJECTS_DIR="$GITHUB_WORKSPACE/patch-rejects"
  328. mkdir -p "$REJECTS_DIR"
  329. # Find all .rej files under the configuration directory
  330. mapfile -t REJS < <(find "$CONFIG_DIR" -type f -name '*.rej')
  331. REJ_COUNT=${#REJS[@]}
  332. echo "Found $REJ_COUNT .rej files under $CONFIG_DIR"
  333. echo "REJ_COUNT=$REJ_COUNT" >> $GITHUB_ENV
  334. echo "rej_count=$REJ_COUNT" >> $GITHUB_OUTPUT
  335. if [ "$REJ_COUNT" -gt 0 ]; then
  336. for REJ in "${REJS[@]}"; do
  337. # Relative path from $CONFIG
  338. REL="${REJ#"$CONFIG_DIR"/}"
  339. DEST="$REJECTS_DIR/$REL"
  340. mkdir -p "$(dirname "$DEST")"
  341. cp "$REJ" "$DEST"
  342. # Copy the associated original file alongside the .rej
  343. ORIG="${REJ%.rej}"
  344. if [ -f "$ORIG" ]; then
  345. ORIG_DEST="$REJECTS_DIR/${REL%.rej}"
  346. mkdir -p "$(dirname "$ORIG_DEST")"
  347. cp "$ORIG" "$ORIG_DEST"
  348. fi
  349. echo "$REL" >> "$REJECTS_DIR/index.txt"
  350. done
  351. fi
  352. - name: Upload Artifacts
  353. uses: actions/upload-artifact@v4
  354. with:
  355. name: ${{ steps.extract.outputs.file_name }}-AnyKernel3
  356. path: ${{ github.workspace }}/AnyKernel3/**
  357. if-no-files-found: ignore
  358. compression-level: 9
  359. - name: Upload Rejects
  360. if: ${{ always() && inputs.variant != 'Bypass' && steps.scan.outputs.rej_count > 0 }}
  361. uses: actions/upload-artifact@v4
  362. with:
  363. name: ${{ steps.extract.outputs.file_name }}-Rejects
  364. path: patch-rejects/
  365. if-no-files-found: ignore
  366. compression-level: 9
  367. - name: Build Summary
  368. if: ${{ always() }}
  369. run: |
  370. # Kernel info
  371. echo "Android Version : $ANDROID_VERSION"
  372. echo "Kernel Version : $KERNEL_VERSION"
  373. echo "Sub Level : $SUB_LEVEL"
  374. echo "Sub level (Makefile): $SUBLEVEL"
  375. echo "Patch Level : $OS_PATCH_LEVEL"
  376. # Branch info
  377. echo "Repo Branch : common-$KERNEL_VERSION-$ANDROID_VERSION-$OS_PATCH_LEVEL || 'normal'"
  378. echo "Deprecated : $DEPRECATED_BRANCH"
  379. # Build info
  380. echo "Build Type : ${{ inputs.variant || 'Normal' }}"
  381. # Features info
  382. echo "Features : ${{ inputs.feature_set || 'None' }}"
  383. echo "WKSU Commit : ${{ inputs.ksu_commit || 'canary' }}"
  384. echo "WKSU Tag : $KSU_GIT_TAG"
  385. echo "WKSU Version : $KSU_VERSION"
  386. echo "BBG Commit : $BBG_COMMIT"
  387. echo "BBG Version : $BBG_VERSION"
  388. # Variant info
  389. echo "Variant : ${{ inputs.variant || 'Standard' }}"
  390. echo "Features : ${{ inputs.feature_set || 'None' }}"
  391. # End of workflow