diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d693c43e..627d24a65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,6 +55,34 @@ jobs: with: path: ./build/plugin_luajit/**/* name: plugin_luajit + + ohos: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install NDK + run: | + cd ~ + cd ~ + curl -O https://repo.huaweicloud.com/harmonyos/os/4.1-Release/ohos-sdk-windows_linux-public.tar.gz + tar xvfz ohos-sdk-windows_linux-public.tar.gz + cd ohos-sdk/linux + unzip -o -d ./ native-linux-x64-4.1.7.5-Release.zip + - name: Build + run: | + cd build + ./make_ohos_lua54.sh + ./make_ohos_lua53.sh + - name: Upload + uses: actions/upload-artifact@v2 + with: + path: ./build/plugin_lua54/**/* + name: plugin_lua54 + - name: Upload53 + uses: actions/upload-artifact@v2 + with: + path: ./build/plugin_lua53/**/* + name: plugin_lua53 linux: runs-on: ubuntu-latest diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 29ebcb6ad..e7d37f870 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,6 +34,34 @@ jobs: with: path: ./build/plugin_lua53/**/* name: plugin_lua53 + + ohos: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install NDK + run: | + cd ~ + cd ~ + curl -O https://repo.huaweicloud.com/harmonyos/os/4.1-Release/ohos-sdk-windows_linux-public.tar.gz + tar xvfz ohos-sdk-windows_linux-public.tar.gz + cd ohos-sdk/linux + unzip -o -d ./ native-linux-x64-4.1.7.5-Release.zip + - name: Build + run: | + cd build + ./make_ohos_lua54.sh + ./make_ohos_lua53.sh + - name: Upload + uses: actions/upload-artifact@v2 + with: + path: ./build/plugin_lua54/**/* + name: plugin_lua54 + - name: Upload53 + uses: actions/upload-artifact@v2 + with: + path: ./build/plugin_lua53/**/* + name: plugin_lua53 android_luajit: runs-on: ubuntu-latest diff --git a/build/make_ohos_lua53.sh b/build/make_ohos_lua53.sh new file mode 100644 index 000000000..c34adb99d --- /dev/null +++ b/build/make_ohos_lua53.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ -n "$OHOS_NDK" ]; then + export NDK=${OHOS_NDK} +elif [ -n "$OHOS_NDK_HOME" ]; then + export NDK=${OHOS_NDK_HOME} +else + export NDK=~/ohos-sdk/linux/native +fi + +export PATH=${NDK}/build-tools/cmake/bin:$PATH + +function build() { + ABI=$1 + BUILD_PATH=build.OHOS.${ABI} + cmake -H. -DOHOS_STL=c++_shared -B${BUILD_PATH} -DOHOS_ARCH=${ABI} -DOHOS_PLATFORM=OHOS -DCMAKE_TOOLCHAIN_FILE=${NDK}/build/cmake/ohos.toolchain.cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON + cmake --build ${BUILD_PATH} --config Release + mkdir -p plugin_lua53/Plugins/OpenHarmony/libs/${ABI}/ + cp ${BUILD_PATH}/libxlua.so plugin_lua53/Plugins/OpenHarmony/libs/${ABI}/libxlua.so +} + +build armeabi-v7a +build arm64-v8a diff --git a/build/make_ohos_lua54.sh b/build/make_ohos_lua54.sh new file mode 100644 index 000000000..c68fc394a --- /dev/null +++ b/build/make_ohos_lua54.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ -n "$OHOS_NDK" ]; then + export NDK=${OHOS_NDK} +elif [ -n "$OHOS_NDK_HOME" ]; then + export NDK=${OHOS_NDK_HOME} +else + export NDK=~/ohos-sdk/linux/native +fi + +export PATH=${NDK}/build-tools/cmake/bin:$PATH + +function build() { + ABI=$1 + BUILD_PATH=build54.OHOS.${ABI} + cmake -H. -DLUA_VERSION=5.4.1 -DOHOS_STL=c++_shared -B${BUILD_PATH} -DOHOS_ARCH=${ABI} -DOHOS_PLATFORM=OHOS -DCMAKE_TOOLCHAIN_FILE=${NDK}/build/cmake/ohos.toolchain.cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON + cmake --build ${BUILD_PATH} --config Release + mkdir -p plugin_lua54/Plugins/OpenHarmony/libs/${ABI}/ + cp ${BUILD_PATH}/libxlua.so plugin_lua54/Plugins/OpenHarmony/libs/${ABI}/libxlua.so +} + +build armeabi-v7a +build arm64-v8a