-
Notifications
You must be signed in to change notification settings - Fork 1
391 lines (329 loc) · 15.8 KB
/
default.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
name: kotlin-atlassian-client - default
on:
push:
branches:
- '**'
release:
types: [ created ]
schedule:
- cron: '0 4 * * 2' # At 02:00 on Tuesday
env:
MAIN_BRANCH: 'dev'
MAIN_BRANCH_FULL: 'refs/heads/dev'
MAVEN_OPTS: >
-Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Daether.connector.http.connectionMaxTtl=25
jobs:
build:
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.extract-version.outputs.version }}
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
lfs: true
- name: Download Maven Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Extract and Set Release Version
if: ${{ github.event_name == 'release' }}
id: extract-version
run: |
VERSION=$(git describe --tags | cut -d v -f2)
echo "Detected version = $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
- name: Build libraries
run: mvn package -T 2 -Pci "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
# JIRA
# -------------------------------------------------------
kotlin-jira-client-test-ktor:
runs-on: ubuntu-20.04
needs: build
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
lfs: true
- name: Download Maven Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Set Release Version
if: ${{ github.event_name == 'release' }}
id: extract-version
run: |
VERSION="${{ needs.build.outputs.version }}"
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
- name: Startup Jira and Insight
# Loop is needed to prevent Jira from suspension
run: (while true; do sleep 10000; done) | mvn jira:debug -Pitest-jira,-insight-itest-applink,-insight-itest-sdk,-insight-itest-ktor,-jira-itest-applink,-jira-itest-ktor,-jira-itest-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" &
- name: Wait for Jira and Insight
run: ./scripts/wait-for-jira.sh
- name: Integration tests using ktor
run: mvn -B verify -Pjira-itest-ktor,jira-ci-ktor,-jira-itest-applink,-jira-itest-sdk,-insight-itest-applink,-insight-itest-sdk,-insight-itest-ktor "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
kotlin-jira-client-test-applink:
runs-on: ubuntu-20.04
needs: build
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
lfs: true
- name: Download Maven Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Set Release Version
if: ${{ github.event_name == 'release' }}
id: extract-version
run: |
VERSION="${{ needs.build.outputs.version }}"
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
- name: Startup Jira and Insight
# Loop is needed to prevent Jira from suspension
run: (while true; do sleep 10000; done) | mvn jira:debug -Pitest-jira,-insight-itest-applink,-insight-itest-sdk,-insight-itest-ktor,-jira-itest-applink,-jira-itest-ktor,-jira-itest-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" &
- name: Wait for Jira and Insight
run: ./scripts/wait-for-jira.sh
- name: Add hosts to /etc/hosts
run: sudo echo "127.0.0.1 confluence" | sudo tee -a /etc/hosts
- name: Integration tests using applinks
run: mvn -B verify -Pjira-itest-applink,jira-ci-applink,-jira-itest-ktor,-jira-itest-sdk,-insight-itest-applink,-insight-itest-sdk,-insight-itest-ktor "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://confluence:1990"
kotlin-jira-client-test-sdk:
runs-on: ubuntu-20.04
needs: build
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
lfs: true
- name: Download Maven Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Set Release Version
if: ${{ github.event_name == 'release' }}
id: extract-version
run: |
VERSION="${{ needs.build.outputs.version }}"
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
- name: Integration tests using sdk
run: mvn clean -B verify -Pjira-itest-sdk,jira-ci-sdk,-jira-itest-applink,-jira-itest-ktor,-insight-itest-sdk,-insight-itest-applink,-insight-itest-ktor "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990"
# INSIGHT
# -------------------------------------------------------
kotlin-insight-client-test-ktor:
runs-on: ubuntu-20.04
needs: build
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
lfs: true
- name: Download Maven Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Set Release Version
if: ${{ github.event_name == 'release' }}
id: extract-version
run: |
VERSION="${{ needs.build.outputs.version }}"
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
- name: Startup Jira and Insight
# Loop is needed to prevent Jira from suspension
run: (while true; do sleep 10000; done) | mvn jira:debug -Pitest-jira,-insight-itest-applink,-insight-itest-sdk,-insight-itest-ktor,-jira-itest-applink,-jira-itest-ktor,-jira-itest-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" &
- name: Wait for Jira and Insight
run: ./scripts/wait-for-jira.sh
- name: Integration tests using ktor
run: mvn -B verify -Pinsight-itest-ktor,insight-ci-ktor,-jira-itest-applink,-jira-itest-sdk,-jira-itest-ktor,-insight-itest-applink,-insight-itest-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
kotlin-insight-client-test-sdk:
runs-on: ubuntu-20.04
needs: build
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
lfs: true
- name: Download Maven Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Set Release Version
if: ${{ github.event_name == 'release' }}
id: extract-version
run: |
VERSION="${{ needs.build.outputs.version }}"
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
- name: Integration tests using sdk
run: mvn -B verify -Pinsight-itest-sdk,insight-ci-sdk,-insight-itest-ktor,-insight-ci-ktor,-jira-itest-applink,-jira-itest-sdk,-jira-itest-ktor,-insight-itest-applink "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990"
kotlin-insight-client-test-applink:
runs-on: ubuntu-20.04
needs: build
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
lfs: true
- name: Download Maven Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Set Release Version
if: ${{ github.event_name == 'release' }}
id: extract-version
run: |
VERSION="${{ needs.build.outputs.version }}"
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
- name: Startup Jira and Insight
# Loop is needed to prevent Jira from suspension
run: (while true; do sleep 10000; done) | mvn jira:debug -Pitest-jira,-insight-itest-sdk,-insight-itest-ktor,-jira-itest-applink,-insight-itest-applink,-jira-itest-ktor,-jira-itest-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" &
- name: Wait for Jira and Insight
run: ./scripts/wait-for-jira.sh
- name: Add hosts to /etc/hosts
run: sudo echo "127.0.0.1 confluence" | sudo tee -a /etc/hosts
- name: Integration tests using applinks
run: mvn -B verify -Pinsight-itest-applink,insight-ci-applink,-insight-itest-ktor,-insight-itest-sdk,-jira-itest-ktor,-jira-itest-sdk,-jira-itest-applink "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://confluence:1990"
deploy-to-central:
runs-on: ubuntu-20.04
needs: [ build, kotlin-jira-client-test-sdk, kotlin-jira-client-test-ktor, kotlin-jira-client-test-applink, kotlin-insight-client-test-ktor, kotlin-insight-client-test-applink, kotlin-insight-client-test-sdk ]
if: ${{ github.event_name == 'release' }}
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
lfs: true
- name: Download Maven Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Extract, set and commit Release Version
id: extract-version
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
VERSION="${{ needs.build.outputs.version }}"
mvn -B versions:set "-DnewVersion=$VERSION" versions:commit "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
git commit -am "[skip ci] set release version $VERSION"
git push origin HEAD:$MAIN_BRANCH
TAG_NAME="v$VERSION"
git tag -f $TAG_NAME
git push origin -f --tags
- name: Install GPG Secret Key
id: install-secret-key
run: cat <(echo -e "${{ secrets.SIGNING_KEY }}") | gpg --batch --import
- name: Deploy to Maven Central
run: mvn -B deploy -Pci,-ci-sdk,-ci-jira-applink,-ci-ktor -DskipTests "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
prepare-next-snapshot:
runs-on: ubuntu-20.04
needs: [ build, deploy-to-central ]
if: ${{ github.event_name == 'release' }}
steps:
- name: Checkout Source
uses: actions/checkout@v3
- name: Download Maven Cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
- name: Prepare next Snapshot Version
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
git fetch origin $MAIN_BRANCH
git reset --hard origin/$MAIN_BRANCH
VERSION="${{ needs.build.outputs.version }}"
MAJOR_VERSION=$(echo "$VERSION" | cut -d . -f1)
MINOR_VERSION=$(echo "$VERSION" | cut -d . -f2)
INCREMENT_VERSION=$(echo "$VERSION" | cut -d . -f3)
NEXT_INCREMENT_VERSION=$((INCREMENT_VERSION + 1))
NEXT_SNAPSHOT_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$NEXT_INCREMENT_VERSION-SNAPSHOT"
mvn -B versions:set "-DnewVersion=$NEXT_SNAPSHOT_VERSION" versions:commit "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
git commit -am "[skip ci] set development version $NEXT_SNAPSHOT_VERSION"
git push origin HEAD:$MAIN_BRANCH
notify-slack:
needs: prepare-next-snapshot
if: always()
runs-on: ubuntu-20.04
steps:
- name: Notify Slack
if: ${{ github.ref == env.MAIN_BRANCH_FULL || github.event_name == 'release' }}
uses: iRoachie/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GITHUB_TOKEN: ${{ secrets.GH_API_TOKEN }}