-
Notifications
You must be signed in to change notification settings - Fork 3
546 lines (529 loc) · 20.8 KB
/
ci.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
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
name: Build Eclipse eMoflon
on:
push:
# Run pipeline for commits on branch 'main' and on 'testing/<stuff>'
branches:
- main
- 'testing/**'
- 'feature/**'
- 'hotfix/**'
# Run pipeline for release tags
tags:
- 'v*.*.*'
schedule:
# Weekly builds on Monday morning 4:42
# Github doc:
# "The schedule event can be delayed during periods of high loads of GitHub Actions workflow runs.
# High load times include the start of every hour.
# To decrease the chance of delay, schedule your workflow to run at a different time of the hour."
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '42 4 * * 1'
env:
# Eclipse version to use in this CI
VERSION: "2024-06"
# emoflon-headless source URL (needed by macOS-based runner workaround)
EMOFLON_HEADLESS_SRC: "https://api.github.com/repos/eMoflon/emoflon-headless/releases/latest"
# import plugin URL
IMPORT_PLUGIN_SRC: "https://api.github.com/repos/maxkratz/eclipse-import-projects-plugin/releases/latest"
jobs:
# Get emoflon-headless updatesite release + eclipse import plugin artifacts
# This is necessary because some of the Github-hosted macOS-based runner
# did trigger the API rate limit from time to time.
collect-github-api-artifacts:
runs-on: [ubuntu-20.04]
steps:
- name: Find emoflon-headless updatesite
run: |
RESPONSE=$(curl -s $EMOFLON_HEADLESS_SRC)
echo "curl: $RESPONSE"
EMOFLON_HEADLESS_LATEST_UPDATESITE=$(echo "$RESPONSE" \
| grep "updatesite.*zip" \
| cut -d : -f 2,3 \
| tr -d \")
if [[ -z "${EMOFLON_HEADLESS_LATEST_UPDATESITE// }" ]]; then
log "This runner propably reached it's Github API rate limit. Exit."
exit 1
fi
wget -qi $EMOFLON_HEADLESS_LATEST_UPDATESITE
mv updatesite.zip emoflon-headless-updatesite.zip
- name: Find eclipse import plugin jar
run: |
RESPONSE=$(curl -s $IMPORT_PLUGIN_SRC)
echo "curl: $RESPONSE"
IMPORT_PLUGIN_LATEST_SRC=$(echo "$RESPONSE" \
| grep "/com.seeq.eclipse.importprojects*.*jar" \
| cut -d : -f 2,3 \
| tr -d \")
if [[ -z "${IMPORT_PLUGIN_LATEST_SRC// }" ]]; then
echo "This runner propably reached it's Github API rate limit. Exit."
exit 1
fi
echo "Found URL: $IMPORT_PLUGIN_LATEST_SRC"
wget "${IMPORT_PLUGIN_LATEST_SRC// }"
mv com.seeq.eclipse.importprojects*.jar com.seeq.eclipse.importprojects.jar
- name: Upload emoflon-headless updatesite artifact
uses: actions/upload-artifact@v4
with:
name: emoflon-headless-updatesite.zip
path: emoflon-headless-updatesite.zip
- name: Upload eclipse import plugin artifact
uses: actions/upload-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
path: com.seeq.eclipse.importprojects.jar
# Create splash image
create-splash-image:
runs-on: [ubuntu-20.04]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Start message
run: echo "Creating splash image for version $VERSION."
- name: Run splash creator script
run: chmod +x splash.sh && ./splash.sh img $VERSION null
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: splash.bmp
path: splash.bmp
# Build Eclipse eMoflon Linux user
build-linux-user:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [ubuntu-20.04]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon Linux user)."
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: |
chmod +x build.sh && ./build.sh -m user -o linux
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-linux-user
path: eclipse-emoflon-linux-user.zip
# Build Eclipse eMoflon Linux dev
build-linux-dev:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [ubuntu-20.04]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon Linux dev)."
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m dev -o linux
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-linux-dev
path: eclipse-emoflon-linux-dev.zip
# Build Eclipse eMoflon Linux user CI
build-linux-user-ci:
needs: [collect-github-api-artifacts]
runs-on: [ubuntu-20.04]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon Linux user CI)."
- name: Check out repository code
uses: actions/checkout@v4
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m user -o linux --skip-theme
- name: Rename ZIP archive
run: mv eclipse-emoflon-linux-user.zip eclipse-emoflon-linux-user-ci.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-linux-user-ci
path: eclipse-emoflon-linux-user-ci.zip
# Build Eclipse eMoflon Linux dev CI
build-linux-dev-ci:
needs: [collect-github-api-artifacts]
runs-on: [ubuntu-20.04]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon Linux dev CI)."
- name: Check out repository code
uses: actions/checkout@v4
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m dev -o linux --skip-theme
- name: Rename ZIP archive
run: mv eclipse-emoflon-linux-dev.zip eclipse-emoflon-linux-dev-ci.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-linux-dev-ci
path: eclipse-emoflon-linux-dev-ci.zip
# Build Eclipse eMoflon Linux dev HiPE
build-linux-dev-hipe:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [ubuntu-20.04]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon Linux dev HiPE)."
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m hipedev -o linux
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-linux-dev-hipe
path: eclipse-emoflon-linux-dev-hipe.zip
# Build Eclipse eMoflon macOS user
build-macos-user:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [macos-12]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon macOS user)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m user -o macos
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-macos-user
path: eclipse-emoflon-macos-user.zip
# Build Eclipse eMoflon macOS dev
build-macos-dev:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [macos-12]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon macOS dev)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m dev -o macos
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-macos-dev
path: eclipse-emoflon-macos-dev.zip
# Build Eclipse eMoflon macOS dev HiPE
build-macos-dev-hipe:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [macos-12]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon macOS dev HiPE)."
- name: Install dependencies
run: |
brew install p7zip coreutils grep wget curl
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: chmod +x build.sh && ./build.sh -m hipedev -o macos
- name: Fix permissions
run: sudo xattr -cr ./eclipse/Eclipse.app
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-macos-dev-hipe
path: eclipse-emoflon-macos-dev-hipe.zip
# Build Eclipse eMoflon Windows user
build-windows-user:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [windows-2022]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon Windows user)."
- name: Install dependencies
run: |
choco install wget curl unzip zip --no-progress
- name: Install correct Java version
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '16'
- name: Fix Git line endings
run: git config --global core.autocrlf input
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: |
bash ./build.sh -m user -o windows
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-windows-user
path: eclipse-emoflon-windows-user.zip
# Build Eclipse eMoflon Windows dev
build-windows-dev:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [windows-2022]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon Windows dev)."
- name: Install dependencies
run: |
choco install wget curl unzip zip --no-progress
- name: Install correct Java version
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '16'
- name: Fix Git line endings
run: git config --global core.autocrlf input
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: |
bash ./build.sh -m dev -o windows
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-windows-dev
path: eclipse-emoflon-windows-dev.zip
# Build Eclipse eMoflon Windows dev HiPE
build-windows-dev-hipe:
needs: [create-splash-image, collect-github-api-artifacts]
runs-on: [windows-2022]
steps:
- name: Start message
run: echo "Started CI build (Eclipse eMoflon Windows dev HiPE)."
- name: Install dependencies
run: |
choco install wget curl unzip zip --no-progress
- name: Install correct Java version
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '16'
- name: Fix Git line endings
run: git config --global core.autocrlf input
- name: Check out repository code
uses: actions/checkout@v4
- name: Download splash image
uses: actions/download-artifact@v4
with:
name: splash.bmp
- name: Download emoflon-headless updatesite
uses: actions/download-artifact@v4
with:
name: emoflon-headless-updatesite.zip
- name: Move emoflon-headless updatesite
run: |
mkdir -p ./tmp/emoflon-headless
mv emoflon-headless-updatesite.zip ./tmp/emoflon-headless/updatesite.zip
- name: Download Eclipse import plugin JAR
uses: actions/download-artifact@v4
with:
name: com.seeq.eclipse.importprojects.jar
- name: Run build script
run: |
bash ./build.sh -m hipedev -o windows
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-windows-dev-hipe
path: eclipse-emoflon-windows-dev-hipe.zip
# Create a release if running on tag
create-release:
needs: [build-linux-user, build-linux-dev, build-linux-user-ci, build-linux-dev-ci, build-linux-dev-hipe, build-macos-user, build-macos-dev, build-macos-dev-hipe, build-windows-user, build-windows-dev, build-windows-dev-hipe]
runs-on: [ubuntu-20.04]
# Only run on pushed tags (and explicitely ignore scheduled runs)
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && github.event_name != 'schedule'
steps:
- name: Collect artifacts
uses: actions/download-artifact@master
- name: Release eclipse-emoflon-linux
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-emoflon-linux-user/eclipse-emoflon-linux-user.zip
eclipse-emoflon-linux-dev/eclipse-emoflon-linux-dev.zip
- name: Release eclipse-emoflon-macos
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-emoflon-macos-user/eclipse-emoflon-macos-user.zip
eclipse-emoflon-macos-dev/eclipse-emoflon-macos-dev.zip
- name: Release eclipse-emoflon-linux-ci
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-emoflon-linux-user-ci/eclipse-emoflon-linux-user-ci.zip
eclipse-emoflon-linux-dev-ci/eclipse-emoflon-linux-dev-ci.zip
- name: Release eclipse-emoflon-windows
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-emoflon-windows-user/eclipse-emoflon-windows-user.zip
eclipse-emoflon-windows-dev/eclipse-emoflon-windows-dev.zip
- name: Release eclipse-emoflon-dev-hipe-1
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-emoflon-linux-dev-hipe/eclipse-emoflon-linux-dev-hipe.zip
eclipse-emoflon-windows-dev-hipe/eclipse-emoflon-windows-dev-hipe.zip
- name: Release eclipse-emoflon-dev-hipe-2
uses: softprops/action-gh-release@v2
with:
files: |
eclipse-emoflon-macos-dev-hipe/eclipse-emoflon-macos-dev-hipe.zip