mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
update workflows for future develop (#123)
* update workflows for future develop * fix updated build id path
This commit is contained in:
parent
488fde47e5
commit
2481124ada
32
.github/workflows/increment-build-number.yml
vendored
32
.github/workflows/increment-build-number.yml
vendored
@ -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 }})
|
||||
|
||||
2
.github/workflows/integration-test.yml
vendored
2
.github/workflows/integration-test.yml
vendored
@ -4,11 +4,13 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- '*-develop'
|
||||
paths:
|
||||
- '**/**.php'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- '*-develop'
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user