You've already forked KernelSU-Next
mirror of
https://github.com/KernelSU-Next/KernelSU-Next.git
synced 2025-08-27 23:46:34 +00:00
58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
name: Build ksuinit
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
target:
|
|
required: true
|
|
type: string
|
|
os:
|
|
required: false
|
|
type: string
|
|
default: ubuntu-latest
|
|
pack_lkm:
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
use_cache:
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ inputs.os }}
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Rust
|
|
run: |
|
|
rustup update stable
|
|
rustup target add aarch64-linux-android
|
|
|
|
- name: Set Rust & Android linker
|
|
run: |
|
|
TOOLCHAIN="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64"
|
|
if [ ! -d "$TOOLCHAIN" ]; then
|
|
echo "Android NDK not found at $ANDROID_NDK"
|
|
exit 1
|
|
fi
|
|
echo "CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=$TOOLCHAIN/bin/aarch64-linux-android21-clang" >> $GITHUB_ENV
|
|
|
|
- name: Cache ksuinit
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: userspace/ksuinit
|
|
cache-targets: false
|
|
|
|
- name: Build ksuinit
|
|
run: |
|
|
cargo build --target ${{ inputs.target }} --release --manifest-path ./userspace/ksuinit/Cargo.toml
|
|
|
|
- name: Upload ksuinit artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ksuinit-${{ inputs.target }}
|
|
path: userspace/ksuinit/target/**/release/ksuinit
|