From 3c5ee10731213825eef2d4940d33c4e8b97ce733 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 1 Mar 2022 10:34:56 +0800 Subject: [PATCH] [v3.6] Move native/external/config.json to native/external-config.json (#10207) * Move native/external/config.json to native/external-config.json * Update CI config. * Update native/utils/download-deps.js * Update native/tools/make-package/config.json * Remove native/.github --- .github/workflows/native-bindings.yml | 4 +- .../workflows/native-compile-platforms.yml | 18 +- .github/workflows/native-linter-android.yml | 3 +- .../.github/workflows/automation_labels.yml | 36 --- native/.github/workflows/bindings.yml | 55 ---- native/.github/workflows/clang-format.yml | 51 ---- .../.github/workflows/compile-platforms.yml | 265 ------------------ native/.github/workflows/filter_by_cdb.js | 29 -- native/.github/workflows/linter-android.yml | 96 ------- native/.github/workflows/mirror.yml | 17 -- native/.github/workflows/simulator.yml | 100 ------- native/.github/workflows/unit-test.yml | 39 --- native/download-deps.py | 8 +- .../config.json => external-config.json} | 0 native/tools/make-package/config.json | 2 +- native/utils/download-deps.js | 2 +- 16 files changed, 14 insertions(+), 711 deletions(-) delete mode 100644 native/.github/workflows/automation_labels.yml delete mode 100644 native/.github/workflows/bindings.yml delete mode 100644 native/.github/workflows/clang-format.yml delete mode 100644 native/.github/workflows/compile-platforms.yml delete mode 100644 native/.github/workflows/filter_by_cdb.js delete mode 100644 native/.github/workflows/linter-android.yml delete mode 100644 native/.github/workflows/mirror.yml delete mode 100644 native/.github/workflows/simulator.yml delete mode 100644 native/.github/workflows/unit-test.yml rename native/{external/config.json => external-config.json} (100%) diff --git a/.github/workflows/native-bindings.yml b/.github/workflows/native-bindings.yml index 9d73b8b8b0..2c8eb9c6e2 100644 --- a/.github/workflows/native-bindings.yml +++ b/.github/workflows/native-bindings.yml @@ -12,11 +12,9 @@ jobs: - uses: actions/checkout@v2 - name: Download external libraries run: | - EXT_VERSION=`grep version native/external/config.json |awk -F'"' '{print $4}'` - rm native/external/config.json + EXT_VERSION=`grep version native/external-config.json |awk -F'"' '{print $4}'` git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external rm -rf native/external/.git - git checkout HEAD native/external/config.json - name: Run genbindings.py run: | diff --git a/.github/workflows/native-compile-platforms.yml b/.github/workflows/native-compile-platforms.yml index a19808b212..353d3190e1 100644 --- a/.github/workflows/native-compile-platforms.yml +++ b/.github/workflows/native-compile-platforms.yml @@ -16,8 +16,7 @@ jobs: - name: Download external libraries shell: bash run: | - EXT_VERSION=`grep version native/external/config.json |awk -F'"' '{print $4}'` - rm native/external/config.json + EXT_VERSION=`grep version native/external-config.json |awk -F'"' '{print $4}'` git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - name: Install deps run: | @@ -62,8 +61,7 @@ jobs: - name: Download external libraries shell: bash run: | - EXT_VERSION=`grep version native/external/config.json |awk -F'"' '{print $4}'` - rm native/external/config.json + EXT_VERSION=`grep version native/external-config.json |awk -F'"' '{print $4}'` git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - name: Generate bindings run: | @@ -121,8 +119,7 @@ jobs: - name: Download external libraries shell: bash run: | - EXT_VERSION=`grep version native/external/config.json |awk -F'"' '{print $4}'` - rm native/external/config.json + EXT_VERSION=`grep version native/external-config.json |awk -F'"' '{print $4}'` git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - name: Generate bindings run: | @@ -173,8 +170,7 @@ jobs: - name: Download external libraries shell: bash run: | - EXT_VERSION=`grep version native/external/config.json |awk -F'"' '{print $4}'` - rm native/external/config.json + EXT_VERSION=`grep version native/external-config.json |awk -F'"' '{print $4}'` git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - name: Generate bindings run: | @@ -228,8 +224,7 @@ jobs: - name: Download external libraries shell: bash run: | - EXT_VERSION=`grep version native/external/config.json |awk -F'"' '{print $4}'` - rm native/external/config.json + EXT_VERSION=`grep version native/external-config.json |awk -F'"' '{print $4}'` git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - name: Generate bindings run: | @@ -286,8 +281,7 @@ jobs: - name: Download external libraries shell: bash run: | - EXT_VERSION=`grep version native/external/config.json |awk -F'"' '{print $4}'` - rm native/external/config.json + EXT_VERSION=`grep version native/external-config.json |awk -F'"' '{print $4}'` git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - name: Setup Emscripten run: | diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index 5864f18481..81c9de4151 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -26,8 +26,7 @@ jobs: python -m pip install PyYAML==5.4.1 Cheetah3 - name: Download external run: | - EXT_VERSION=`grep version native/external/config.json |awk -F'"' '{print $4}'` - rm native/external/config.json + EXT_VERSION=`grep version native/external-config.json |awk -F'"' '{print $4}'` git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - name: Generate bindings diff --git a/native/.github/workflows/automation_labels.yml b/native/.github/workflows/automation_labels.yml deleted file mode 100644 index e4b824864f..0000000000 --- a/native/.github/workflows/automation_labels.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: automation-labels - -on: - pull_request_target: - types: [opened] - -jobs: - automate-labels: - concurrency: - group: ${{ github.head_ref }} - cancel-in-progress: true - runs-on: ubuntu-latest - steps: - - name: Check organization - id: get_check_code - run: | - http_code=`curl -s --head -I -H "Authorization: token ${{ secrets.LABEl_TOKEN }}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/orgs/cocos-creator/members/${{ github.event.pull_request.user.login }} | awk '/HTTP/{print $2}'` - echo "::set-output name=http_code::${http_code}" - - name: Echo username organization - run: | - echo ${{ github.event.pull_request.user.login }} - echo ${{ steps.get_check_code.outputs.http_code }} - - name: Add contribution label - if: | - steps.get_check_code.outputs.http_code == 404 - uses: OperationsYU/labeler@master - with: - add-labels: "contribution" - - - name: assignment - if: | - steps.get_check_code.outputs.http_code == 404 - uses: OperationsYU/auto-assignment@v1 - with: - token: ${{ secrets.LABEl_TOKEN }} - users: '["minggo"]' diff --git a/native/.github/workflows/bindings.yml b/native/.github/workflows/bindings.yml deleted file mode 100644 index 0259b894ac..0000000000 --- a/native/.github/workflows/bindings.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: ๐Ÿ”ƒ Glue - -on: - pull_request_target: - types: [closed] - -jobs: - generate-jsb: - if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - run: | - EXT_VERSION=`grep version external/config.json |awk -F'"' '{print $4}'` - rm external/config.json - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external external - rm -rf external/.git - git checkout HEAD external/config.json - - - name: Run genbindings.py - run: | - python3 -m pip install PyYAML==5.4.1 Cheetah3 - python3 ./tools/tojs/genbindings.py - rm ./tools/tojs/userconf.ini - - - name: Create Pull Request - uses: fish9167/create-pull-request@v3 - with: - title: '[ci skip][AUTO]: Automated PR to genbindings' - body: | - Automated PR to genbindings - committer: cocos-robot - author: cocos-robot - commit-message: "[ci skip][AUTO]: Automated genbindings update: ${{ github.event.pull_request.head.sha }} (#${{ github.event.number }})" - token: ${{ secrets.PR_TOKEN }} - push-to-fork: cocos-robot/cocos2d-x-lite - branch: t/bot/genbindings - branch-suffix: short-commit-hash - delete-branch: true - milestone: 1 - - #- name: Make PR - # run: | - # cd tools/travis-scripts && bash generate-pr.sh - # env: - # TRAVIS_OS_NAME: linux - # TRAVIS_PULL_REQUEST: "false" - # TRAVIS_BRANCH: ${{github.base_ref}} - # TRAVIS_COMMIT: ${{github.sha}} - # TRAVIS_COMMIT_MESSAGE: ${{github.event.head_commit.message}} - # GH_EMAIL: cocos-robot@cocos.com - # GH_PASSWORD: ${{ secrets.PR_TOKEN }} - # GH_TOKEN: ${{ secrets.PR_TOKEN }} - # GH_USER: cocos-robot diff --git a/native/.github/workflows/clang-format.yml b/native/.github/workflows/clang-format.yml deleted file mode 100644 index d54df9f268..0000000000 --- a/native/.github/workflows/clang-format.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Apply clang format - -#on: [push, pull_request] -on: - pull_request_target: - types: [closed] - -jobs: - Clang-Format: - if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - token: ${{ github.token }} - ref: ${{ github.head_sha }} - - - id: get_change_files - uses: fish9167/file-changes-action@v1.2.3 - with: - output: ' ' - fileOutput: ' ' - - - name: Echo change files - run: | - cat $HOME/files.txt - mv $HOME/files.txt ${{github.workspace}}/files.txt - - - uses: fish9167/clang-format-lint-action@master - with: - exclude: .clang-format-ignore - extensions: 'c,h,hpp,cpp,cxx' - style: file - inplace: True - - - name: Create Pull Request - uses: fish9167/create-pull-request@v3 - with: - title: '[ci skip][AUTO]: Automated PR to fix formatting' - body: | - Automated PR to fix formatting - committer: cocos-robot - author: cocos-robot - commit-message: "[ci skip][AUTO]: Automated clang-format update: ${{ github.event.pull_request.head.sha }} (#${{ github.event.number }})" - token: ${{ secrets.PR_TOKEN }} - push-to-fork: cocos-robot/cocos2d-x-lite - branch: t/bot/fix-format - branch-suffix: short-commit-hash - delete-branch: true - milestone: 1 diff --git a/native/.github/workflows/compile-platforms.yml b/native/.github/workflows/compile-platforms.yml deleted file mode 100644 index d9c0291404..0000000000 --- a/native/.github/workflows/compile-platforms.yml +++ /dev/null @@ -1,265 +0,0 @@ -name: ๐Ÿ—๏ธ Compile - -on: [pull_request] - -jobs: - compile_windows: - # windows 2019, Visual Studio Enterprise 2019 - # windows 2016, Visual Studio Enterprise 2017 - #runs-on: windows-latest - # runs-on: windows-2019 - runs-on: windows-2016 - name: "Windows" - - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`grep version external/config.json |awk -F'"' '{print $4}'` - rm external/config.json - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external external - - name: Install deps - run: | - choco install --forcex86 vulkan-sdk - python -m pip install PyYAML==5.4.1 Cheetah3 - - name: Generate bindings - shell: bash - run: | - python -V - cd ./tools/tojs - echo "Create auto-generated jsbinding glue codes." - python ./genbindings.py - rm userconf.ini - - name: Compile win32 - shell: bash - env: - COCOS_ENGINE_DEV: 1 - run: | - cd $GITHUB_WORKSPACE/templates/windows - mkdir -p build-win32/proj - touch build-win32/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-win32/proj/cfg.cmake - echo "set(CC_USE_VULKAN ON)" >> build-win32/proj/cfg.cmake - echo "set(CC_USE_GLES2 ON)" >> build-win32/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER ON)" >> build-win32/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-win32/proj/cfg.cmake - echo "set(CMAKE_UNITY_BUILD ON)" >> build-win32/proj/cfg.cmake - mkdir build-win32/assets - cd build-win32 - RES_DIR=${GITHUB_WORKSPACE//\\//}/templates/windows/build-win32 - COCOS_X_PATH=${GITHUB_WORKSPACE//\\//} - cmake ../ -G"Visual Studio 15 2017" -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS_X_PATH -Awin32 - cmake --build . --config Release - echo "Compile Win32 Release Done!" - - compile_android: - name: "Android" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`grep version external/config.json |awk -F'"' '{print $4}'` - rm external/config.json - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external external - - name: Generate bindings - run: | - python3 -m pip install PyYAML==5.4.1 Cheetah3 - python3 ./tools/tojs/genbindings.py - rm ./tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - COCOS2DX_ROOT=$GITHUB_WORKSPACE - ANDORID_NDK=$ANDROID_NDK_LATEST_HOME - NATIVE_DIR=$COCOS2DX_ROOT/templates/android-template - echo "Compiling Android ... " - cd $COCOS2DX_ROOT/templates/ - if [ ! -d android-template ]; then - cp -r android/template android-template - fi - cd $COCOS2DX_ROOT/templates/android/build - mkdir -p build-android/proj - touch build-android/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-android/proj/cfg.cmake - echo "set(CC_USE_VULKAN ON)" >> build-android/proj/cfg.cmake - echo "set(CC_USE_GLES2 ON)" >> build-android/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER ON)" >> build-android/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-android/proj/cfg.cmake - echo "set(CMAKE_UNITY_BUILD ON)" >> build-android/proj/cfg.cmake - - mkdir -p build-android/assets - - ASSET_DIR=$COCOS2DX_ROOT/templates/android/build/build-android/ - - sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDORID_NDK@g" gradle.properties - sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties - sed -i "s@^RES_PATH.*@RES_PATH=$ASSET_DIR@g" gradle.properties - sed -i "s@^COCOS_ENGINE_PATH.*@COCOS_ENGINE_PATH=$COCOS2DX_ROOT@g" gradle.properties - sed -i "s@^NATIVE_DIR.*@NATIVE_DIR=$NATIVE_DIR@g" gradle.properties - - # To speedup CI, compile arm64-v8a only - # sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86@g" gradle.properties - sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=arm64-v8a@g" gradle.properties - - echo "Compile Android - cmake ..." - echo "ANDORID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}" - ./gradlew :CocosGame:assembleDebug --quiet - echo "Compile Android Debug Done!" - - compile_mac: - name: "MacOS" - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`grep version external/config.json |awk -F'"' '{print $4}'` - rm external/config.json - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external external - - name: Generate bindings - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./tools/tojs/genbindings.py - rm ./tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` - COCOS2DX_ROOT=$GITHUB_WORKSPACE - echo "Compiling MacOSX ... " - cd $COCOS2DX_ROOT/templates/mac - mkdir -p build-mac/proj - touch build-mac/proj/cfg.cmake - echo "set(CC_USE_VULKAN OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_GLES2 OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_GLES3 OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_METAL ON)" >> build-mac/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-mac/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-mac/proj/cfg.cmake - echo "set(CMAKE_UNITY_BUILD ON)" >> build-mac/proj/cfg.cmake - mkdir build-mac/assets - - RES_DIR=$COCOS2DX_ROOT/templates/mac/build-mac - cd build-mac - cmake ../ -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64 -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS2DX_ROOT - set +e - cmake --build . --config Release -- -quiet -jobs $NUM_OF_CORES -arch x86_64 - retcode=$? - set -e - if [ $retcode -ne 0 ]; then - echo "-----------------------------------------------------------------------------------------------" - echo "------------------------------------ recompile without `-quiet` -------------------------------" - echo "-----------------------------------------------------------------------------------------------" - cmake --build . --config Release -- -jobs $NUM_OF_CORES -arch x86_64 - fi - echo "Compile MacOSX x86_64 Release Done!" - - cd .. - mkdir build-mac-apple-silicon - cd build-mac-apple-silicon - cmake ../ -GXcode -DCMAKE_OSX_ARCHITECTURES=arm64 -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS2DX_ROOT - cmake --build . --config Release -- -quiet -jobs $NUM_OF_CORES -arch arm64 - echo "Compile MacOSX ARM64 Release Done!" - - compile_iOS: - name: "iOS" - runs-on: macos-latest - steps: - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`grep version external/config.json |awk -F'"' '{print $4}'` - rm external/config.json - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external external - - name: Generate bindings - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./tools/tojs/genbindings.py - rm ./tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - set -x - NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` - COCOS2DX_ROOT=$GITHUB_WORKSPACE - echo "Compiling iOS ... " - cd $COCOS2DX_ROOT/templates/ios - mkdir -p build-ios/proj - touch build-ios/proj/cfg.cmake - echo "set(CC_USE_GLES3 OFF)" >> build-ios/proj/cfg.cmake - echo "set(CC_USE_VULKAN OFF)" >> build-ios/proj/cfg.cmake - echo "set(CC_USE_GLES2 OFF)" >> build-ios/proj/cfg.cmake - echo "set(CC_USE_METAL ON)" >> build-ios/proj/cfg.cmake - echo "set(TARGET_IOS_VERSION 12.0)" >> build-ios/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-ios/proj/cfg.cmake - echo "set(USE_DRAGONBONES OFF)" >> build-ios/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED OFF)" >> build-ios/proj/cfg.cmake - echo "set(MACOSX_BUNDLE_GUI_IDENTIFIER com.cocos.demo.ios)" >> build-ios/proj/cfg.cmake - echo "set(CMAKE_UNITY_BUILD ON)" >> build-ios/proj/cfg.cmake - mkdir build-ios/assets - cd build-ios - RES_DIR=$COCOS2DX_ROOT/templates/ios/build-ios - cmake ../ -GXcode -DCMAKE_SYSTEM_NAME=iOS \ - -DCMAKE_OSX_SYSROOT=iphoneos \ - -DCMAKE_OSX_ARCHITECTURES=arm64 \ - -DRES_DIR=$RES_DIR \ - -DCOCOS_X_PATH=$COCOS2DX_ROOT - set +e - #cmake --build . --config Debug -- -quiet -jobs $NUM_OF_CORES -allowProvisioningUpdates CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO - cmake --build . --config Debug -- -quiet -jobs $NUM_OF_CORES CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO - retcode=$? - set -e - if [ $retcode -ne 0 ]; then - echo "-----------------------------------------------------------------------------------------------" - echo "------------------------------------ recompile without `-quiet` -------------------------------" - echo "-----------------------------------------------------------------------------------------------" - cmake --build . --config Debug -- -jobs $NUM_OF_CORES CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO - fi - echo "Compile iOS Done!" - - compile_wgpu_mac: - name: "Emscripten" - runs-on: macos-latest - if: contains( github.event.head_commit.message, 'WGPU_CI_ON' ) - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`grep version external/config.json |awk -F'"' '{print $4}'` - rm external/config.json - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external external - - name: Setup Emscripten - run: | - git clone https://github.com/emscripten-core/emsdk.git ../emsdk - cd ../emsdk - ./emsdk install latest - ./emsdk activate latest - source ./emsdk_env.sh - emcc -v - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - COCOS2DX_ROOT=$GITHUB_WORKSPACE - cd $COCOS2DX_ROOT/cocos/renderer/gfx-wgpu - $COCOS2DX_ROOT/../emsdk/upstream/emscripten/emcmake cmake . - $COCOS2DX_ROOT/../emsdk/upstream/emscripten/emmake make - echo "Compile WGPU by ems on MacOS Done!" diff --git a/native/.github/workflows/filter_by_cdb.js b/native/.github/workflows/filter_by_cdb.js deleted file mode 100644 index 440bd33f90..0000000000 --- a/native/.github/workflows/filter_by_cdb.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node - -const path = require('path'); -const fs = require('fs'); - -const ARGS = process.argv.slice(2); - -const excludes = [ - 'cocos/renderer/gfx-vulkan/volk', - 'cocos/bindings/auto', -]; - -let result = []; - -const cdbFile = path.join(__dirname, '../../build/compile_commands.json'); - -if (fs.existsSync(cdbFile)) { - const db = JSON.parse(fs.readFileSync(cdbFile, { encoding: 'utf8' })); - for (let f of ARGS) { - const name = f.endsWith('.h') ? f.slice(0, -2) : f; // ignore .h extension name - if (excludes.some((e) => name.includes(e))) continue; - if (db.some((info) => info.file.includes(name))) { - result.push(f); - } - } - console.log(result.join(' ')); -} else { - console.log(ARGS.join(' ')); -} diff --git a/native/.github/workflows/linter-android.yml b/native/.github/workflows/linter-android.yml deleted file mode 100644 index 5339c271bf..0000000000 --- a/native/.github/workflows/linter-android.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: ๐Ÿ“ Linter - -on: pull_request - -jobs: - # Set the job key. The key is displayed as the job name - # when a job name is not provided - super-lint: - # Name the Job - name: ClangTidy Android - # Set the type of machine to run on - runs-on: ubuntu-latest - - steps: - # Checks out a copy of your repository on the ubuntu-latest machine - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install Python3 - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - name: Install python deps - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - - name: Download external - run: | - EXT_VERSION=`grep version external/config.json |awk -F'"' '{print $4}'` - rm external/config.json - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external external - - - name: Generate bindings - shell: bash - run: | - python -V - cd ./tools/tojs - python ./genbindings.py - rm userconf.ini - - name: Get changed files - uses: PatriceJiang/paths-filter@master - id: listchanged - with: - list-files: shell - filters: | - source: - - added|modified: '**/*.cpp' - - added|modified: '**/*.h' - - added|modified: '**/*.hpp' - - added|modified: '**/*.m' - - added|modified: '**/*.mm' - - added|modified: '**/*.c' - - exclude: 'cocos/editor-support/**' - - exclude: 'cocos/base/etc1.*' - - exclude: 'cocos/base/etc2.*' - - exclude: 'cocos/bindings/manual/jsb_global.cpp' - - exclude: 'cocos/bindings/manual/jsb_dragonbones_manual.cpp' - - exclude: 'cocos/bindings/manual/jsb_spine_manual.cpp' - - exclude: 'cocos/bindings/manual/jsb_socketio.cpp' - - exclude: 'cocos/bindings/manual/jsb_conversions.*' - - exclude: 'cocos/bindings/jswrapper/v8/debugger/**' - - exclude: 'cocos/audio/android/audio_utils/**' - - exclude: 'cocos/core/builtin/DebugInfos.cpp' - allChanges: - - added|modified|deleted: '**' - skipedDebug: - - added|modified|deleted: '**' - - exclude: 'cocos/editor-support/**' - - name: Install CMake & Clang Tidy - run: | - sudo apt install -y cmake llvm clang-tidy-11 - - - name: Generate Compile database - shell: bash - run: | - utils/generate_compile_commands_android.sh - - - name: Generate clang-fix.yaml - shell: bash - if: ${{ steps.listchanged.outputs.source == 'true' }} - run: | - CPP="${{ steps.listchanged.outputs.source_files }}" - FILTERED=`node .github/workflows/filter_by_cdb.js $CPP` - if [[ "$FILTERED-xxx" == "-xxx" ]]; then - echo "no source files match" - else - clang-tidy-11 --format-style=file --export-fixes=clang-fixes.yaml $FILTERED - fi - - name: clang-tidy-action - uses: PatriceJiang/clang-tidy-action@master - if: hashFiles('clang-fixes.yaml') != '' - with: - fixesFile: clang-fixes.yaml - noFailOnIssue: false - repo-token: ${{ secrets.GITHUB_TOKEN }} - error-limit: 200 diff --git a/native/.github/workflows/mirror.yml b/native/.github/workflows/mirror.yml deleted file mode 100644 index 048480f0ad..0000000000 --- a/native/.github/workflows/mirror.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 'GitHub Actions Mirror' - -on: [create, push, delete] - -jobs: - mirror_to_gitee: - runs-on: ubuntu-latest - steps: - - name: 'Checkout' - uses: actions/checkout@v1 - - name: 'Mirror to gitee' - uses: pixta-dev/repository-mirroring-action@v1 - with: - target_repo_url: - git@gitee.com:creator-cocos/engine-native.git - ssh_private_key: - ${{ secrets.GITEE_KEY }} diff --git a/native/.github/workflows/simulator.yml b/native/.github/workflows/simulator.yml deleted file mode 100644 index 9d79ecdcb4..0000000000 --- a/native/.github/workflows/simulator.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: ๐Ÿ–ฅ๏ธ Simulator - -on: [pull_request] - -jobs: - win_gen_simulator: - # windows 2019, Visual Studio Enterprise 2019 - # windows 2016, Visual Studio Enterprise 2017 - #runs-on: windows-latest - runs-on: windows-2016 - name: Windows - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - name: npm install - run: | - npm install - - name: download external libraries - run: | - node ./utils/download-deps.js - - name: install vulkan-sdk - run: | - choco install vulkan-sdk - - name: pip install - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - - name: install android ndk - shell: bash - working-directory: ${{github.workspace}} - run: | - curl -O http://dl.google.com/android/repository/android-ndk-r16b-windows-x86_64.zip - unzip -q android-ndk-r16b-windows-x86_64.zip - mkdir -p ${HOME}/bin - mv android-ndk-r16b ${HOME}/bin/android-ndk - ls ${HOME} - - name: generate bindings glue codes - shell: bash - run: | - python -V - export NDK_ROOT=${HOME}/bin/android-ndk - cd ./tools/tojs - echo "Create auto-generated jsbinding glue codes." - python ./genbindings.py - rm userconf.ini - - name: gen simulator - run: | - gulp gen-simulator-release - - name: check result - run: | - Get-ChildItem ./simulator/Debug -Name SimulatorApp-Win32.exe - if(Test-Path ./simulator/Debug/SimulatorApp-Win32.exe) {exit 0} else {exit 1} - # mac_gen_simulator: - # runs-on: macos-latest - # name: MacOS - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-python@v2 - # with: - # python-version: "3.x" - # - name: npm install - # run: | - # npm install - # npm install gulp -g - # - name: download external libraries - # run: | - # node ./utils/download-deps.js - # - name: pip install - # run: | - # python -m pip install PyYAML Cheetah3 - # - name: install android ndk - # shell: bash - # working-directory: ${{github.workspace}} - # run: | - # curl -O http://dl.google.com/android/repository/android-ndk-r16b-darwin-x86_64.zip - # unzip -q android-ndk-r16b-darwin-x86_64.zip - # mkdir -p ${HOME}/bin - # mv android-ndk-r16b ${HOME}/bin/android-ndk - # ls ${HOME} - # - name: generate bindings glue codes - # shell: bash - # run: | - # python -V - # export NDK_ROOT=${HOME}/bin/android-ndk - # cd ${{github.workspace}}/tools/travis-scripts - # echo "Create auto-generated jsbinding glue codes." - # pushd ${{github.workspace}}/tools/tojs - # python ./genbindings.py - # rm userconf.ini - # popd - # - name: gen simulator - # run: | - # gulp gen-simulator-release - # - name: check result - # run: | - # find ./ -name SimulatorApp-Mac - # [ -f ./simulator/Debug/SimulatorApp-Mac.app/Contents/MacOS/SimulatorApp-Mac ] && exit 0 || exit 1 diff --git a/native/.github/workflows/unit-test.yml b/native/.github/workflows/unit-test.yml deleted file mode 100644 index 12f2d30129..0000000000 --- a/native/.github/workflows/unit-test.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: ๐Ÿงช Run Tests - -on: [pull_request] - -jobs: - unit-test-with-cmake: - name: "Run on windows" - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - name: Downlad external libraties - run: | - npm install - npm install gulp -g - node ./utils/download-deps.js - - - name: Generate bindings - shell: bash - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./tools/tojs/genbindings.py - - - name: Run Unit Tests - shell: bash - run: | - cmake -B tests/unit-test/build -S tests/unit-test -G"Visual Studio 16 2019" -A win32 - cmake --build tests/unit-test/build --config Release - ./tests/unit-test/build/src/Release/CocosTest.exe - - #### TODO(PatriceJiang): model split - # - name: Run Module Tests - # shell: bash - # run: | - # cd tests/module-tests - # bash run-test-windows.sh diff --git a/native/download-deps.py b/native/download-deps.py index f5df188d9c..21964a903e 100755 --- a/native/download-deps.py +++ b/native/download-deps.py @@ -255,9 +255,9 @@ class CocosZipInstaller(object): return data def clean_external_folder(self, external_folder): - print('==> Cleaning cocos2d-x/external folder ...') - # remove external except 'config.json' - delete_folder_except(external_folder, ['config.json']) + print('==> Cleaning native/external folder ...') + # remove files in external directory + delete_folder_except(external_folder, []) def run(self, workpath, folder_for_extracting, remove_downloaded, force_update, download_only): if not force_update and not self.need_to_update(): @@ -337,7 +337,7 @@ def main(): print("=======================================================") print("==> Prepare to download external libraries!") external_path = os.path.join(workpath, 'external') - installer = CocosZipInstaller(workpath, os.path.join(workpath, 'external', 'config.json'), os.path.join(workpath, 'external', 'version.json'), "prebuilt_libs_version") + installer = CocosZipInstaller(workpath, os.path.join(workpath, 'external-config.json'), os.path.join(workpath, 'external', 'version.json'), "prebuilt_libs_version") installer.run(workpath, external_path, opts.remove_downloaded, opts.force_update, opts.download_only) # -------------- main -------------- diff --git a/native/external/config.json b/native/external-config.json similarity index 100% rename from native/external/config.json rename to native/external-config.json diff --git a/native/tools/make-package/config.json b/native/tools/make-package/config.json index 9d5b64509b..dfac85f299 100755 --- a/native/tools/make-package/config.json +++ b/native/tools/make-package/config.json @@ -2,7 +2,7 @@ "extra_zip_files": [ { - "zip_config_path": "../../external/config.json", + "zip_config_path": "../../external-config.json", "zip_file_path": "../../", "extract_to_zip_path": "external" }, diff --git a/native/utils/download-deps.js b/native/utils/download-deps.js index b7e7dfa705..d2a1c68a05 100644 --- a/native/utils/download-deps.js +++ b/native/utils/download-deps.js @@ -15,7 +15,7 @@ function main() { const externalPath = ps.join(workDir, 'external'); (async () => { await downloadDepsThroughGit( - ps.join(externalPath, 'config.json'), + ps.join(workDir, 'external-config.json'), externalPath, ); })();