update workflows for future develop (#123)

* update workflows for future develop

* fix updated build id path
This commit is contained in:
sunxyw 2022-05-09 16:36:32 +08:00 committed by GitHub
parent 488fde47e5
commit 2481124ada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 17 deletions

View File

@ -4,6 +4,7 @@ on:
pull_request:
branches:
- master
- '*-develop'
types:
- closed
paths:
@ -17,6 +18,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Setup PHP
uses: "shivammathur/setup-php@v2"
@ -46,24 +49,19 @@ jobs:
continue-on-error: true
run: bin/gendoc
- name: Commit api docs
if: steps.generate-api-docs.outcome == 'success'
continue-on-error: true
run: |
git config --global user.name 'Github Build Bot'
git config --global user.email 'noreply@github.com'
git add docs
git commit -m "update api docs"
git push
- name: Commit API Docs
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: update api docs
- name: Increment build number
run: sed -i -r 's/(.*)(\VERSION_ID\s=\s)([0-9]+)(.*)/echo "\1\2$((\3+1))\4"/ge' src/ZM/ConsoleApplication.php
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
run: |
BUILD_ID=$(cat src/ZM/ConsoleApplication.php | grep "VERSION_ID = " | sed 's/[^0-9]//g')
git config --global user.name 'Github Build Bot'
git config --global user.email 'noreply@github.com'
git add src/ZM/ConsoleApplication.php
git commit -m "increment build number (build $BUILD_ID)"
git push
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: increment build number (build ${{ steps.increment-build-number.outputs.build_id }})

View File

@ -4,11 +4,13 @@ on:
push:
branches:
- master
- '*-develop'
paths:
- '**/**.php'
pull_request:
branches:
- master
- '*-develop'
types:
- opened
- synchronize