66 tag :
77 description : ' Tag version'
88 required : true
9+ workflow_call :
10+ inputs :
11+ tag :
12+ type : string
13+ required : true
914
1015permissions : write-all
1116
17+ env :
18+ TAG_NAME : ${{ inputs.tag || github.event.inputs.tag }}
19+
1220jobs :
1321 build :
1422 runs-on : ubuntu-latest
15-
23+
24+ name : Build
25+
1626 steps :
17- - name : Extract the tag version
18- id : tag
19- run : |
20- if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
21- GITHUB_REF=${{ github.event.inputs.tag }}
22- fi
23- echo "tag=${GITHUB_REF##*v}" >> "$GITHUB_OUTPUT"
27+ - name : Detect version
28+ run : echo "New versions is $TAG_NAME"
2429
2530 - name : Checkout the code
2631 uses : actions/checkout@v4
3944 run : composer test
4045
4146 - name : Create the PHAR file
42- run : php ./notifications app:build notifications --build-version=${{ steps.tag.outputs.tag }} --ansi
47+ run : php ./notifications app:build notifications --build-version=$TAG_NAME --ansi
4348
4449 - name : Show version
4550 run : php builds/notifications --version
@@ -49,17 +54,27 @@ jobs:
4954 with :
5055 name : notifications
5156 path : builds/notifications
52- retention-days : 30
57+ retention-days : 14
5358
54- push :
59+ pull_request :
5560 runs-on : ubuntu-latest
56-
61+
5762 needs : build
5863
64+ name : Create a Pull Request
65+
5966 steps :
6067 - name : Checkout the code
6168 uses : actions/checkout@v4
6269
70+ - name : Make a title
71+ id : title
72+ run : |
73+ echo "title=🏗️ Build the application version ${TAG_NAME}" >> "$GITHUB_OUTPUT"
74+
75+ - name : Show title
76+ run : echo ${{ steps.title.outputs.title }}
77+
6378 - name : Remove old file
6479 run : rm -f builds/notifications
6580
@@ -68,20 +83,14 @@ jobs:
6883 name : notifications
6984 path : builds
7085
71- - name : Push changes
72- uses : ad-m/github-push-action@master
73- if : steps.build.outputs.is_dirty == 1
74- with :
75- github_token : ${{ secrets.COMPOSER_TOKEN }}
76-
7786 - name : Create a Pull Request
7887 uses : peter-evans/create-pull-request@v6
7988 with :
80- branch : app
89+ branch : build/ app
8190 branch-suffix : random
8291 delete-branch : true
8392 add-paths : ./builds/notifications
84- title : " 🏗️ Build application "
85- commit-message : 🏗️ Build application
93+ title : ${{ steps.title.outputs.title }}
94+ commit-message : ${{ steps.title.outputs.title }}
8695 body : Application compiled successfully
8796 labels : build
0 commit comments