1
1
name : Full Release
2
2
3
3
on :
4
- milestone :
5
- types :
6
- - closed
4
+ pull_request :
5
+ branches :
6
+ - master
7
+ types : [closed]
7
8
8
9
env :
9
10
artifactId : gaffer2
10
11
MAVEN_OPTS : -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
11
12
12
-
13
13
jobs :
14
- create-release-tag :
14
+ deploy-release :
15
+ if : ${{ github.event.pull_request.merged }}
15
16
runs-on : ubuntu-latest
16
17
17
18
outputs :
18
- branch_name : ${{ steps.branch .outputs.branch_name }}
19
+ release_version : ${{ steps.release-version .outputs.release_version }}
19
20
20
21
steps :
21
22
- name : Setup JDK
@@ -36,106 +37,15 @@ jobs:
36
37
git config user.name github-actions[bot]
37
38
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
38
39
39
- - name : Set release version
40
- run : echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV
41
-
42
- - name : Set branch name
43
- run : echo "BRANCH_NAME=$(git branch -a | grep $RELEASE_VERSION | tail -n 1 | cut -c 18-)" >> $GITHUB_ENV
44
-
45
- - name : Output branch name
46
- id : branch
47
- run : echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
48
-
49
- - name : Fail if branch output missing (no branch found)
50
- if : ${{ !steps.branch.outputs.branch_name }}
51
- run : exit 1
52
-
53
- - name : Merge release into master
54
- run : |
55
- git checkout ${{ env.BRANCH_NAME }}
56
- git checkout master
57
- git merge ${{ env.BRANCH_NAME }}
58
-
59
- - name : Push changes
60
- run : |
61
- git tag $artifactId-$RELEASE_VERSION
62
- git push origin $artifactId-$RELEASE_VERSION
63
- git push
64
-
65
- update-develop :
66
- runs-on : ubuntu-latest
67
- needs :
68
- - create-release-tag
69
-
70
- steps :
71
- - name : Checkout develop
72
- uses : actions/checkout@v4
73
- with :
74
- ref : develop
75
- token : ${{ secrets.ADMIN_GITHUB_TOKEN }}
76
- fetch-depth : 0
77
-
78
- - name : Set up Github credentials
79
- run : |
80
- git config user.name github-actions[bot]
81
- git config user.email 41898282+github-actions[bot]@users.noreply.github.com
82
-
83
- - name : Setup JDK
84
- uses : actions/setup-java@v4
85
- with :
86
- distribution : ' zulu'
87
- java-version : ' 8'
88
-
89
- - name : Merge release into develop
90
- run : |
91
- git checkout ${{ needs.create-release-tag.outputs.branch_name }}
92
- git checkout develop
93
- git merge ${{ needs.create-release-tag.outputs.branch_name }} --strategy-option theirs
94
-
95
- - name : Update develop branch
40
+ - name : Output release version
41
+ id : release-version
96
42
run : |
97
- git checkout develop
98
- mvn versions:set-property -Dproperty=revision -DnewVersion=$(echo ${{ github.event.milestone.title }} | cut -c 2-)-SNAPSHOT
99
- mvn build-helper:parse-version versions:set-property \
100
- -Dproperty=revision \
101
- -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT
102
- NEW_GAFFER_VERSION=$(mvn -q help:evaluate -DforceStdout -Dexpression=pom.version)
103
- sed -i'' -e "s/^gaffer.version=.*/gaffer.version=$NEW_GAFFER_VERSION/" rest-api/common-rest/src/main/resources/version.properties
104
- git commit -a -m "prepare for next development iteration"
105
- git push
106
-
107
- update-github-releases :
108
- runs-on : ubuntu-latest
109
- needs :
110
- - create-release-tag
111
-
112
- steps :
113
- - name : Checkout Master
114
- uses : actions/checkout@v4
115
- with :
116
- ref : master
117
-
118
- - name : Create Release Notes
119
- uses : docker://decathlon/release-notes-generator-action:3.1.5
120
- env :
121
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
122
-
123
- - name : Set version
124
- run : echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV
125
-
126
- - name : Upload notes
127
- uses : softprops/action-gh-release@v2
128
- env :
129
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
130
- with :
131
- tag_name : ${{ env.artifactId }}-${{ env.RELEASE_VERSION }}
132
- name : Gaffer ${{ env.RELEASE_VERSION }}
133
- body_path : release_file.md
43
+ echo "release_version=$(mvn -q help:evaluate -DforceStdout -Dexpression=pom.version)" >> $GITHUB_OUTPUT
134
44
135
45
generate-javadoc :
136
46
runs-on : ubuntu-latest
137
47
needs :
138
- - create -release-tag
48
+ - deploy -release
139
49
140
50
steps :
141
51
- name : Checkout Master
156
66
java-version : ' 11'
157
67
158
68
- name : Set version
159
- run : echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2- )" >> $GITHUB_ENV
69
+ run : echo "RELEASE_VERSION=$(echo ${{ needs.deploy-release.outputs.release_version }})" >> $GITHUB_ENV
160
70
161
71
- name : Upload Javadoc
162
72
run : |
176
86
release-to-nexus :
177
87
runs-on : ubuntu-latest
178
88
needs :
179
- - create -release-tag
89
+ - deploy -release
180
90
181
91
steps :
182
92
- name : Setup JDK
188
98
- name : Checkout release
189
99
uses : actions/checkout@v4
190
100
with :
191
- ref : ${{ needs.create-release-tag.outputs.branch_name }}
101
+ ref : master
192
102
193
103
- name : Decode CodeSigning key
194
104
env :
@@ -205,4 +115,65 @@ jobs:
205
115
GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
206
116
OSS_NEXUS_USERNAME : ${{ secrets.OSS_NEXUS_USERNAME }}
207
117
OSS_NEXUS_PASSWORD : ${{ secrets.OSS_NEXUS_PASSWORD }}
208
- run : mvn deploy -P quick,ossrh-release --settings cd/mvnsettings.xml -B
118
+ run :
119
+ mvn deploy -P quick,ossrh-release --settings cd/mvnsettings.xml -B
120
+
121
+ update-github-releases :
122
+ runs-on : ubuntu-latest
123
+ needs :
124
+ - deploy-release
125
+
126
+ steps :
127
+ - name : Checkout Master
128
+ uses : actions/checkout@v4
129
+ with :
130
+ ref : master
131
+
132
+ - name : Set version
133
+ run : echo "RELEASE_VERSION=$(echo ${{ needs.deploy-release.outputs.release_version }})" >> $GITHUB_ENV
134
+
135
+ - name : Create github release
136
+ uses : softprops/action-gh-release@v2
137
+ env :
138
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
139
+ with :
140
+ tag_name : ${{ env.artifactId }}-${{ env.RELEASE_VERSION }}
141
+ name : Gaffer ${{ env.RELEASE_VERSION }}
142
+
143
+ update-develop :
144
+ runs-on : ubuntu-latest
145
+ needs :
146
+ - deploy-release
147
+
148
+ steps :
149
+ - name : Checkout develop
150
+ uses : actions/checkout@v4
151
+ with :
152
+ ref : develop
153
+ token : ${{ secrets.ADMIN_GITHUB_TOKEN }}
154
+ fetch-depth : 0
155
+
156
+ - name : Set up Github credentials
157
+ run : |
158
+ git config user.name github-actions[bot]
159
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
160
+
161
+ - name : Setup JDK
162
+ uses : actions/setup-java@v4
163
+ with :
164
+ distribution : ' zulu'
165
+ java-version : ' 8'
166
+
167
+ - name : Merge master into develop
168
+ run : |
169
+ git merge origin/master
170
+
171
+ - name : Update develop branch
172
+ run : |
173
+ git checkout develop
174
+ mvn versions:set-property -Dproperty=revision -DnewVersion=$(echo ${{ needs.deploy-release.outputs.release_version }})-SNAPSHOT
175
+ mvn build-helper:parse-version versions:set-property \
176
+ -Dproperty=revision \
177
+ -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT
178
+ git commit -a -m "prepare for next development iteration"
179
+ git push
0 commit comments