mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 00:55:35 +08:00
add build workflow to increment build number
This commit is contained in:
30
.github/workflows/build.yml
vendored
Normal file
30
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
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@v2
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
- name: Commit change
|
||||||
|
run: |
|
||||||
|
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"
|
||||||
|
git push
|
||||||
Reference in New Issue
Block a user