Skip to content

Commit

Permalink
Merge branch 'v3.8.2' of github.com:cocos/cocos-engine into v3.8.2_we…
Browse files Browse the repository at this point in the history
…bpipeline
  • Loading branch information
hana-alice committed Sep 11, 2023
2 parents cadca90 + d7f90a3 commit 22eaf88
Show file tree
Hide file tree
Showing 74 changed files with 1,235 additions and 771 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/generate-android-ndk-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: <Native> Generate Android NDK Cache

on:
workflow_dispatch:
inputs:
android_ndk_sdk_version:
description: 'Android NDK Version'
type: string
default: 'r21e'
required: true

jobs:
generate_android_ndk_cache:
name: "Generate Android NDK Cache"
runs-on: ubuntu-latest
steps:
- name: Setup Android NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: ${{ github.event.inputs.android_ndk_sdk_version }}
local-cache: true

- name: Verify
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
cd ${ANDROID_NDK_HOME}
cat source.properties
platform=$(uname -s | tr '[:upper:]' '[:lower:]')
./toolchains/llvm/prebuilt/${platform}-x86_64/bin/clang -v
26 changes: 26 additions & 0 deletions .github/workflows/generate-emsdk-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: <Native> Generate Emsdk Cache

on:
workflow_dispatch:
inputs:
emsdk_version:
description: 'Emsdk version'
type: string
default: '3.1.45'
required: true

jobs:
generate_emsdk_cache:
name: "Generate Emsdk cache"
runs-on: ubuntu-latest
steps:
- name: Setup emsdk
uses: dumganhar/setup-emsdk@997d2cde2deabda085a11f98e86e842915b0e846
with:
version: ${{ github.event.inputs.emsdk_version }}
actions-cache-folder: 'emsdk-cache'

- name: Verify
run: |
which emcc
emcc -v
80 changes: 80 additions & 0 deletions .github/workflows/generate-oh-sdk-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: <Native> Generate OH SDK Cache

on:
workflow_dispatch:
inputs:
oh_sdk_version:
description: 'Openharmony SDK version'
type: string
default: '9'
required: true

jobs:
generate_oh_sdk_cache:
name: "Generate OH SDK cache"
runs-on: ubuntu-latest
steps:
- uses: actions/setup-java@v3
id: setup-jdk
with:
distribution: 'zulu'
java-version: '17'

- name: Get oh sdk cache directory path
id: oh-sdk-cache-dir-path
run: |
echo "cache dir: "
echo "dir=$HOME/openharmony" >> $GITHUB_OUTPUT
- name: Output cache dir
run: |
echo "Output cache dir: ${{ steps.oh-sdk-cache-dir-path.outputs.dir }}"
- name: Cache OH SDK
id: cache-oh-sdk
uses: actions/cache@v3
env:
cache-name: cache-oh-sdk-${{ github.event.inputs.oh_sdk_version }}
with:
path: ${{ steps.oh-sdk-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-build-${{ env.cache-name }}

- name: Add package.json
run: |
echo "{}" > package.json
echo "{\"name\": \"tests\",\"lockfileVersion\": 3,\"requires\": true,\"packages\": {}}" > package-lock.json
- uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'

- if: ${{ steps.cache-oh-sdk.outputs.cache-hit != 'true' }}
name: No Cache found, install oh sdk
continue-on-error: false
run: |
if [ ! -d "$HOME/openharmony" ]; then
mkdir -p $HOME/openharmony
echo "Download commandline-tools-linux.zip ..."
curl -o commandline-tools-linux.zip "https://contentcenter-vali-drcn.dbankcdn.cn/pvt_2/DeveloperAlliance_package_901_9/b1/v3/E6zhv5UFQ2-inIwNJhTN6Q/commandline-tools-linux-2.0.0.2.zip?HW-CC-KV=V1&HW-CC-Date=20230621T074401Z&HW-CC-Expire=315360000&HW-CC-Sign=621224257B02079B1E76C0A56FDF21483400B1E3556213F88DC79BC9BE7D595D"
echo "Unzip commandline-tools-linux.zip ..."
unzip commandline-tools-linux.zip -d $HOME/openharmony > /dev/null
cd $HOME/openharmony
ls -l
cd command-line-tools
echo "=============== PATCHING sdkmanager/bin/sdkmgr file ==============="
sed -i "[email protected][email protected]=UTF-8 -Duser.country=CN@g" ./sdkmanager/bin/sdkmgr
cd bin
./sdkmgr list
echo "=============== INSTALL HOS toolchains:${{ github.event.inputs.oh_sdk_version }} ==============="
./sdkmgr install toolchains:${{ github.event.inputs.oh_sdk_version }} --accept-license > /dev/null
echo "=============== INSTALL OH SDK ets:${{ github.event.inputs.oh_sdk_version }} ==============="
./sdkmgr install OpenHarmony/ets:${{ github.event.inputs.oh_sdk_version }} --accept-license > /dev/null
echo "=============== INSTALL OH SDK js:${{ github.event.inputs.oh_sdk_version }} ==============="
./sdkmgr install OpenHarmony/js:${{ github.event.inputs.oh_sdk_version }} --accept-license > /dev/null
echo "=============== INSTALL OH SDK native:${{ github.event.inputs.oh_sdk_version }} ==============="
./sdkmgr install OpenHarmony/native:${{ github.event.inputs.oh_sdk_version }} --accept-license > /dev/null
echo "=============== INSTALL OH SDK toolchains:${{ github.event.inputs.oh_sdk_version }} ==============="
./sdkmgr install OpenHarmony/toolchains:${{ github.event.inputs.oh_sdk_version }} --accept-license > /dev/null
echo "=============== INSTALL OH SDK DONE ==============="
./sdkmgr list
fi
22 changes: 22 additions & 0 deletions .github/workflows/generate-vulkan-sdk-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: <Native> Generate Vulkan SDK Cache

on:
workflow_dispatch:
inputs:
vulkan_sdk_version:
description: 'Vulkan SDK version'
type: string
default: '1.2.189.0'
required: true

jobs:
generate_vulkan_sdk_cache:
name: "Generate Vulkan SDK cache"
runs-on: windows-2019
steps:
- name: Setup Vulkan SDK
uses: humbletim/[email protected]
with:
vulkan-query-version: ${{ github.event.inputs.vulkan_sdk_version }}
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
1 change: 1 addition & 0 deletions .github/workflows/native-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
with:
ndk-version: r21e
add-to-path: false
local-cache: true
- name: Generate decorators
run: |
cd native
Expand Down
34 changes: 3 additions & 31 deletions .github/workflows/native-compile-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
with:
ndk-version: r21e
add-to-path: false
local-cache: true
- uses: actions/setup-java@v3
id: setup-jdk
with:
Expand Down Expand Up @@ -144,6 +145,7 @@ jobs:
with:
ndk-version: r21e
add-to-path: false
local-cache: true
- uses: actions/setup-java@v3
id: setup-jdk
with:
Expand Down Expand Up @@ -237,7 +239,7 @@ jobs:
id: cache-oh-sdk
uses: actions/cache@v3
env:
cache-name: cache-oh-sdk-2
cache-name: cache-oh-sdk-9
with:
path: ${{ steps.oh-sdk-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-build-${{ env.cache-name }}
Expand Down Expand Up @@ -510,33 +512,3 @@ jobs:
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.pull_request.title, 'WGPU_CI_ON' )
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/cocos-engine-external native/external
- name: Setup Emscripten
run: |
NATIVE_ROOT=$GITHUB_WORKSPACE/native
git clone https://github.com/emscripten-core/emsdk.git NATIVE_ROOT/../../emsdk
cd NATIVE_ROOT/../../emsdk
./emsdk install 3.1.17
./emsdk activate 3.1.17
source ./emsdk_env.sh
emcc -v
- name: Compile
env:
COCOS_ENGINE_DEV: 1
run: |
NATIVE_ROOT=$GITHUB_WORKSPACE/native
cd $NATIVE_ROOT/cocos/renderer/gfx-wgpu
$NATIVE_ROOT/../../emsdk/upstream/emscripten/emcmake cmake .
$NATIVE_ROOT/../../emsdk/upstream/emscripten/emmake make
echo "Compile WGPU by ems on MacOS Done!"
66 changes: 66 additions & 0 deletions .github/workflows/native-compile-webgpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: <Native> Compile WebGPU

on:
pull_request:
paths:
- 'native/external-config.json'
- 'native/cocos/base/**'
- 'native/cocos/renderer/gfx-base/**'
- 'native/cocos/renderer/gfx-wgpu/**'
- 'native/cocos/renderer/gfx-validator/**'
- 'native/cocos/renderer/gfx-empty/**'
- '.github/workflows/native-compile-webgpu.yml'

# github.head_ref is only defined on pull_request events
concurrency:
group: ${{ github.workflow }}-${{ github.actor }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
compile_wgpu:
if:
(! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration'))
name: "Emscripten"
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/cocos-engine-external native/external
- name: Setup emsdk
uses: dumganhar/setup-emsdk@997d2cde2deabda085a11f98e86e842915b0e846
with:
version: 3.1.45
actions-cache-folder: 'emsdk-cache'

- name: Verify
run: |
which emcc
emcc -v
- name: Install ninja
run: |
if ! command -v ninja &> /dev/null; then
echo "Ninja not found, installing..."
# sudo apt update
sudo apt install ninja-build
else
echo "Ninja is already installed."
fi
which ninja
- name: Compile
# env:
# COCOS_ENGINE_DEV: 1
run: |
NATIVE_ROOT=$GITHUB_WORKSPACE/native
cd $NATIVE_ROOT/cocos/renderer/gfx-wgpu
mkdir build
cd build
cmake .. -GNinja -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Debug
ninja
echo "============== Compile WGPU by ems on Ubuntu Done! =============="
1 change: 1 addition & 0 deletions .github/workflows/native-linter-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
with:
ndk-version: r21e
add-to-path: false
local-cache: true
- name: Get changed files
uses: PatriceJiang/paths-filter@master
id: listchanged
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/lib
lib/
.turbo/
/bin
/web.config
.idea
Expand Down
6 changes: 6 additions & 0 deletions cc.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,12 @@
"type": "boolean",
"value": false,
"internal": true
},
"CULL_MESHOPT": {
"comment": "An internal constant to indicate whether we cull the meshopt wasm module and asm.js module.",
"type": "boolean",
"value": true,
"internal": true
}
},

Expand Down
2 changes: 0 additions & 2 deletions cocos/2d/components/mask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,9 @@ export class Mask extends Component {

protected _removeMaskNode (): void {
if (this._sprite) {
this._sprite.destroy();
this._sprite = null;
}
if (this._graphics) {
this._graphics.destroy();
this._graphics = null;
}
}
Expand Down
Loading

0 comments on commit 22eaf88

Please sign in to comment.