diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d67a6d8..d8ea593 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,8 @@ on: push env: LIB_NAME: libImagineBreaker + PATH_TO_CODE_FOLDER: natives/src/main/c + CODE_FILE: zone_rong_imaginebreaker_ImagineBreaker PATH_TO_CODE: natives/src/main/c/zone_rong_imaginebreaker_ImagineBreaker PATH_TO_CODE_WIN: natives\src\main\c\zone_rong_imaginebreaker_ImagineBreaker @@ -100,3 +102,37 @@ jobs: name: native path: output/ + android_compile: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Make Directory + run: mkdir output + + - name: Install NDK + uses: nttld/setup-ndk@v1 + with: + ndk-version: r25c + + - name: Create Android MakeFile + uses: DamianReeves/write-file-action@master + with: + path: ${{ env.PATH_TO_CODE_FOLDER }}/Android.mk + write-mode: overwrite + contents: | + LOCAL_PATH := $(call my-dir) + include $(CLEAR_VARS) + LOCAL_MODULE := ImagineBreaker_android_arm64 + LOCAL_SRC_FILES := ${{ env.CODE_FILE }}.c + include $(BUILD_SHARED_LIBRARY) + + - name: Compile and Link + run: cd ${{ env.PATH_TO_CODE_FOLDER }} && ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk APP_PLATFORM=android-21 APP_ABI=arm64-v8a + + - name: Upload Natives + uses: actions/upload-artifact@v3 + with: + name: native + path: output/