Publish To External #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish To External | |
on: | |
workflow_dispatch: | |
inputs: | |
physx_repo_ref: | |
description: "Branch To Publish." | |
required: true | |
type: string | |
default: cocos-master | |
dest_branch: | |
description: "Destination branch(of engine external repository) to update." | |
required: true | |
type: string | |
default: develop | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Engine Externals Repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.ENGINE_EXTERNAL_REPO_TOKEN }} | |
repository: cocos/cocos-engine-external | |
ref: ${{ inputs.dest_branch }} | |
path: external | |
- name: Checkout PhysX | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.physx_repo_ref }} | |
path: physx | |
- name: Set PhysX Info | |
id: set_physx_info | |
run: | | |
echo "TARGET_PHYSX_REF=$(git -C physx rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: Checkout EMSDK | |
uses: actions/checkout@v4 | |
with: | |
repository: emscripten-core/emsdk | |
path: emsdk | |
- name: Setup EMSDK | |
run: | | |
sudo apt-get install python3 | |
sudo apt-get install git | |
cd emsdk | |
./emsdk install 3.1.41 | |
./emsdk activate 3.1.41 | |
source ./emsdk_env.sh | |
# Verify | |
emcc -v | |
- name: Install Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Build | |
run: | | |
# Setup EMSDK env | |
source emsdk/emsdk_env.sh | |
export EMSCRIPTEN="$EMSDK/upstream/emscripten" | |
pushd -n $(pwd) | |
cd physx | |
echo "Start release build" | |
./build-emscripten.sh | |
echo "Start debug build" | |
./build-emscripten.sh debug | |
echo "Build finished" | |
ls builds | |
popd | |
targetOutPath="external/emscripten/physx" | |
mkdir -p "$(dirname "$targetOutPath")" | |
cp -r physx/builds/* "$targetOutPath" | |
cp physx/phy.d.ts "$targetOutPath/phy.d.ts" | |
cp physx/PhysX.d.ts "$targetOutPath/physx.d.ts" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.ENGINE_EXTERNAL_REPO_TOKEN }} | |
path: external | |
branch: auto/update-physx | |
base: ${{ inputs.dest_branch }} | |
add-paths: | |
emscripten/physx/*.* | |
commit-message: | | |
automated change: update PhysX dependency cocos/PhysX@${{ steps.set_physx_info.outputs.TARGET_PHYSX_REF }} | |
title: | | |
Update PhysX emscripten dependency | |
body: | | |
This PR updates PhysX emscripten dependency. | |
Target PhysX source is cocos/PhysX@${{ steps.set_physx_info.outputs.TARGET_PHYSX_REF }}. | |
branch-suffix: timestamp |