mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 17:15:36 +08:00
update workflows for future develop (#123)
* update workflows for future develop * fix updated build id path
This commit is contained in:
32
.github/workflows/increment-build-number.yml
vendored
32
.github/workflows/increment-build-number.yml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- '*-develop'
|
||||||
types:
|
types:
|
||||||
- closed
|
- closed
|
||||||
paths:
|
paths:
|
||||||
@@ -17,6 +18,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: "shivammathur/setup-php@v2"
|
uses: "shivammathur/setup-php@v2"
|
||||||
@@ -46,24 +49,19 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: bin/gendoc
|
run: bin/gendoc
|
||||||
|
|
||||||
- name: Commit api docs
|
- name: Commit API Docs
|
||||||
if: steps.generate-api-docs.outcome == 'success'
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
continue-on-error: true
|
with:
|
||||||
run: |
|
commit_message: update api docs
|
||||||
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: Increment build number
|
- 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
|
- name: Commit build number
|
||||||
run: |
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
BUILD_ID=$(cat src/ZM/ConsoleApplication.php | grep "VERSION_ID = " | sed 's/[^0-9]//g')
|
with:
|
||||||
git config --global user.name 'Github Build Bot'
|
commit_message: increment build number (build ${{ steps.increment-build-number.outputs.build_id }})
|
||||||
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
|
|
||||||
|
|||||||
2
.github/workflows/integration-test.yml
vendored
2
.github/workflows/integration-test.yml
vendored
@@ -4,11 +4,13 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- '*-develop'
|
||||||
paths:
|
paths:
|
||||||
- '**/**.php'
|
- '**/**.php'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- '*-develop'
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- synchronize
|
- synchronize
|
||||||
|
|||||||
Reference in New Issue
Block a user