mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add GitHub action to build Tonlib for Android OS (#517)
* GitHub action to build native-lib (tonlibjson) JNI library for Android (x86, x86_64, armeabi-v7a, arm64-v8a); Cleanup fossil actions; * update actions/checkout to v3 * update actions/checkout to v3 * silent removal of TonApi.java * remove *.debug files * minor fix * strip files; add README.md * put back ninja * correct spelling * correct README.md * fix README.md
This commit is contained in:
parent
0ddf2a7f9f
commit
b2ddaa08d5
3 changed files with 105 additions and 2 deletions
56
.github/workflows/tonlib-android-jni.yml
vendored
Normal file
56
.github/workflows/tonlib-android-jni.yml
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
name: Tonlib Android JNI
|
||||
|
||||
on: [push,workflow_dispatch,workflow_call]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
|
||||
- name: Install libraries
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y build-essential git make cmake clang libgflags-dev zlib1g-dev libssl-dev libreadline-dev libmicrohttpd-dev pkg-config libgsl-dev python3 python3-dev ninja-build
|
||||
|
||||
- name: Configure & Build
|
||||
run: |
|
||||
wget https://dl.google.com/android/repository/android-ndk-r25b-linux.zip
|
||||
unzip android-ndk-r25b-linux.zip
|
||||
export JAVA_AWT_LIBRARY=NotNeeded
|
||||
export JAVA_JVM_LIBRARY=NotNeeded
|
||||
export JAVA_INCLUDE_PATH=${JAVA_HOME}/include
|
||||
export JAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include
|
||||
export JAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux
|
||||
|
||||
export ANDROID_NDK_ROOT=$(pwd)/android-ndk-r25b
|
||||
export OPENSSL_DIR=$(pwd)/example/android/third_party/crypto
|
||||
|
||||
rm -rf example/android/src/drinkless/org/ton/TonApi.java
|
||||
cd example/android/
|
||||
cmake -GNinja -DTON_ONLY_TONLIB=ON .
|
||||
ninja prepare_cross_compiling
|
||||
rm CMakeCache.txt
|
||||
./build-all.sh
|
||||
../../android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip libs/x86/libnative-lib.so
|
||||
../../android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip libs/x86_64/libnative-lib.so
|
||||
../../android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip libs/armeabi-v7a/libnative-lib.so
|
||||
../../android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip libs/arm64-v8a/libnative-lib.so
|
||||
find . -name "*.debug" -type f -delete
|
||||
|
||||
- name: Find & copy binaries
|
||||
run: |
|
||||
mkdir -p artifacts/tonlib-android-jni
|
||||
cp example/android/src/drinkless/org/ton/TonApi.java artifacts/tonlib-android-jni/
|
||||
cp -R example/android/libs/* artifacts/tonlib-android-jni/
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: Tonlib JNI libraries for Android
|
||||
path: artifacts
|
Loading…
Add table
Add a link
Reference in a new issue