mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-07 23:15:52 +01:00
Create android_build.yml
This commit is contained in:
parent
866e47a9b7
commit
72655dfce9
42
.github/workflows/android_build.yml
vendored
Normal file
42
.github/workflows/android_build.yml
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
name: Android NDK Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master", "main" ] # 当你提交代码到这些分支时触发
|
||||
workflow_dispatch: # 允许你在 Actions 页面手动点击运行
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Setup Android NDK
|
||||
uses: nttld/setup-ndk@v1
|
||||
id: setup-ndk
|
||||
with:
|
||||
ndk-version: r26b # 建议使用稳定版本
|
||||
|
||||
- name: Build with CMake
|
||||
run: |
|
||||
mkdir -p build && cd build
|
||||
cmake .. \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
|
||||
-DANDROID_ABI=arm64-v8a \
|
||||
-DANDROID_PLATFORM=android-24 \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: JKMenu-Library
|
||||
path: build/*.so # 这里的路径根据你 CMakeLists.txt 生成的输出位置调整
|
||||
Loading…
x
Reference in New Issue
Block a user