Files
zhamao-framework/.github/workflows/increment-build-number.yml
crazywhalecc 3a57294e48 fix: add SIGHUP/SIGTERM handling, modernize PHP support and CI
Signal handling fixes:
- SignalListener: add SIGHUP/SIGTERM handling for both Swoole
  and Workerman drivers in master and worker processes
- Prevent 100% CPU when IDE terminal is closed by ensuring
  graceful shutdown on terminal hangup

PHP version support:
- Widen PHP constraint to 8.3, 8.4, 8.5
- Bump doctrine/dbal from ^2.13.1 to ^4.4
- Bump php-cs-fixer to ^3.64, phpstan to ^1.12
- Bump swoole/ide-helper to ^5.0
- Drop phpunit ^8.5 (EOL), keep ^9.0

CI updates:
- actions/checkout@v3 → @v4 (Node.js 20 deprecated)
- Bump static analysis/code style PHP from 8.1 to 8.3
2026-06-17 15:19:00 +08:00

72 lines
2.2 KiB
YAML

name: Increment Build Number
on:
pull_request:
branches:
- main
types:
- closed
paths:
- 'src/**.php'
jobs:
incremental-build-number:
if: github.event.pull_request.merged == true
name: Incremental Build Number
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
- name: Setup PHP
uses: sunxyw/workflows/setup-environment@main
with:
php-version: 8.3
php-extensions: swoole, posix, json
operating-system: ubuntu-latest
use-cache: true
- name: Prepare Doxygen
id: prepare-doxygen
continue-on-error: true
run: bin/prepare-doxygen before
- name: Generate Doxygen
if: steps.prepare-doxygen.outcome == 'success'
uses: mattnotmitt/doxygen-action@v1.9.5
- name: Finishing Doxygen
if: steps.prepare-doxygen.outcome == 'success'
run: bin/prepare-doxygen after
- name: Commit API Docs
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: update api docs
branch: ${{ github.base_ref }}
- name: Update Class Aliases Docs
run: ./zhamao generate:text class-alias-md
if: ${{ github.event.pull_request.merged == true && contains(github.event.pull_request.changed_files, 'src/Globals/global_class_alias.php') }}
- name: Commit Class Aliases Docs
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: update class aliases docs
branch: ${{ github.base_ref }}
- name: Increment build number
id: increment-build-number
run: |
sed -i -r 's/(.*)(\VERSION_ID\s=\s)([0-9]+)(.*)/echo "\1\2$((\3+1))\4"/ge' src/ZM/Framework.php
BUILD_ID=$(cat src/ZM/Framework.php | grep "VERSION_ID = " | sed 's/[^0-9]//g')
echo "::set-output name=build_id::$BUILD_ID"
- name: Commit build number
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: increment build number (build ${{ steps.increment-build-number.outputs.build_id }})
branch: ${{ github.base_ref }}