4
4
workflow_dispatch :
5
5
inputs :
6
6
releaseVersion :
7
- description : Release version (vX.X.X )
7
+ description : Release version (vX.X)
8
8
required : true
9
9
commitSha :
10
10
description : SHA of the commit from where to release
11
- required : false
12
- patch :
13
- description : Whether or not it is a patch to a previous release
14
- required : false
15
- default : ' false'
11
+ required : true
16
12
17
13
jobs :
18
14
build :
@@ -31,25 +27,18 @@ jobs:
31
27
32
28
- name : Extract tag versions
33
29
run : |
34
- regex="v([0-9]+).([0-9]+).([0-9]+) "
30
+ regex="v([0-9]+).([0-9]+)"
35
31
if [[ ${{ github.event.inputs.releaseVersion }} =~ $regex ]]
36
32
then
37
33
echo "GITHUB_MAJOR_VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV
38
34
echo "GITHUB_MINOR_VERSION=${BASH_REMATCH[2]}" >> $GITHUB_ENV
39
- echo "GITHUB_PATCH_VERSION=${BASH_REMATCH[3]}" >> $GITHUB_ENV
40
- echo "GITHUB_SHORT_VERSION=${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}" >> $GITHUB_ENV
35
+ echo "GITHUB_SHORT_VERSION=${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.0" >> $GITHUB_ENV
41
36
fi
42
37
43
38
- name : Checkout with new branch
44
- if : github.event.inputs.patch == 'false'
45
39
run : |
46
40
git checkout -b release/v${{ env.GITHUB_MAJOR_VERSION }}.${{ env.GITHUB_MINOR_VERSION }} ${{ github.event.inputs.commitSha }}
47
41
48
- - name : Checkout on existing release branch
49
- if : github.event.inputs.patch == 'true'
50
- run : |
51
- git checkout release/v${{ env.GITHUB_MAJOR_VERSION }}.${{ env.GITHUB_MINOR_VERSION }}
52
-
53
42
- name : Change Maven version to release version
54
43
run : mvn --batch-mode versions:set -DgenerateBackupPoms=false -DnewVersion=${{ env.GITHUB_SHORT_VERSION }}
55
44
@@ -58,10 +47,10 @@ jobs:
58
47
git config --global user.name "github-actions[bot]"
59
48
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
60
49
git add .
61
- git commit -m "Release ${{ github.event.inputs.releaseVersion }}"
62
- git tag ${{ github.event.inputs.releaseVersion }}
50
+ git commit -m "Release v ${{ env.GITHUB_SHORT_VERSION }}"
51
+ git tag v ${{ env.GITHUB_SHORT_VERSION }}
63
52
git push origin release/v${{ env.GITHUB_MAJOR_VERSION }}.${{ env.GITHUB_MINOR_VERSION }}
64
- git push origin ${{ github.event.inputs.releaseVersion }}
53
+ git push origin v ${{ env.GITHUB_SHORT_VERSION }}
65
54
66
55
- name : Build with Maven
67
56
run : mvn --batch-mode -Pjacoco verify
@@ -85,14 +74,12 @@ jobs:
85
74
-Djib.to.auth.password=${{ secrets.DOCKERHUB_TOKEN }}
86
75
87
76
- name : Increment minor version
88
- if : github.event.inputs.patch == 'false'
89
77
run : |
90
78
minor=${{ env.GITHUB_MINOR_VERSION }}
91
79
((minor++))
92
80
echo "GITHUB_MINOR_VERSION=${minor}" >> $GITHUB_ENV
93
81
94
82
- name : Update SNAPSHOT version on main
95
- if : github.event.inputs.patch == 'false'
96
83
run : |
97
84
git checkout main
98
85
mvn --batch-mode versions:set -DgenerateBackupPoms=false -DnewVersion=${{ env.GITHUB_MAJOR_VERSION }}.${{ env.GITHUB_MINOR_VERSION }}.0-SNAPSHOT
0 commit comments