Files
cocos4/.github/workflows/native-compile-linux.yml
T
2022-06-09 09:22:14 +08:00

55 lines
2.0 KiB
YAML

name: <Native> Linux
on: [pull_request]
jobs:
compile_linux:
name: "Linux-Ubuntu"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download external libraries
shell: bash
run: |
EXT_VERSION=`node ./.github/workflows/get-native-external-version.js`
git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r21e
add-to-path: false
- name: Generate bindings
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
python3 -m pip install PyYAML==5.4.1 Cheetah3
python3 ./native/tools/tojs/genbindings.py
rm ./native/tools/tojs/userconf.ini
- name: Install dependencies
run: |
sudo apt install libx11-dev -y
sudo apt install libsndio-dev -y
sudo apt install ninja-build -y
- name: Compile
env:
COCOS_ENGINE_DEV: 1
run: |
NATIVE_ROOT=$GITHUB_WORKSPACE/native
echo "Compiling Linux ... "
cd $GITHUB_WORKSPACE/templates/linux
mkdir -p build-linux/proj
touch build-linux/proj/cfg.cmake
echo "set(CC_USE_VULKAN OFF)" >> build-linux/proj/cfg.cmake
echo "set(CC_USE_GLES2 OFF)" >> build-linux/proj/cfg.cmake
echo "set(CC_USE_GLES3 ON)" >> build-linux/proj/cfg.cmake
echo "set(CC_USE_METAL OFF)" >> build-linux/proj/cfg.cmake
echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-linux/proj/cfg.cmake
echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-linux/proj/cfg.cmake
echo "set(USE_PHYSICS_PHYSX OFF)" >> build-linux/proj/cfg.cmake
mkdir build-linux/assets
RES_DIR=$GITHUB_WORKSPACE/templates/linux/build-linux
cd build-linux
cmake ../ -GNinja -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$NATIVE_ROOT
set +e
cmake --build .