mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 18:42:40 +08:00
77 lines
2.8 KiB
YAML
77 lines
2.8 KiB
YAML
name: <Native> Generate Code
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, synchronize, closed]
|
|
paths:
|
|
- 'templates/**'
|
|
- 'native/**'
|
|
- 'package.json'
|
|
- '.github/workflows/native-bindings.yml'
|
|
|
|
jobs:
|
|
generate-jsb:
|
|
# if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
|
strategy:
|
|
matrix:
|
|
node-version: [14.x]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Generate decorators
|
|
run: |
|
|
npm install
|
|
cd scripts/build-engine
|
|
echo "Installing babel dependencies ..."
|
|
npm install
|
|
echo "Build typescripts ... "
|
|
npm run build
|
|
cd ../..
|
|
echo " parsing ..."
|
|
node .github/workflows/gen_decorators.js
|
|
echo " generate done!"
|
|
git checkout HEAD package.json package-lock.json
|
|
git checkout HEAD scripts # revert all changes within build-engine/
|
|
|
|
- name: Update auto-gen source files
|
|
run: |
|
|
cd native
|
|
echo "Generating DebugInfos ... "
|
|
node cmake/scripts/gen_debugInfos.js \
|
|
../EngineErrorMap.md \
|
|
cocos/core/builtin/DebugInfos.cpp.in \
|
|
cocos/core/builtin/DebugInfos.cpp
|
|
echo "Generating cocos-version.h ... "
|
|
node ./cmake/scripts/engine-version.js
|
|
|
|
- name: Create Pull Request
|
|
uses: fish9167/create-pull-request@v3
|
|
if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
|
with:
|
|
title: '[ci skip][AUTO]: Automated PR to generate code'
|
|
body: |
|
|
Automated PR to genbindings & built resources
|
|
[X] does not change any runtime related code or build configuration
|
|
committer: cocos-robot <cocos-robot@cocos.com>
|
|
author: cocos-robot <cocos-robot@cocos.com>
|
|
commit-message: "[ci skip][AUTO]: Automated code generating update: ${{ github.event.pull_request.head.sha }} (#${{ github.event.number }})"
|
|
token: ${{ secrets.PR_TOKEN }}
|
|
push-to-fork: cocos-robot/engine
|
|
branch: t/bot/genbindings
|
|
branch-suffix: short-commit-hash
|
|
delete-branch: true
|
|
|
|
#- name: Make PR
|
|
# run: |
|
|
# cd native/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
|