-
Notifications
You must be signed in to change notification settings - Fork 3
133 lines (127 loc) · 5.12 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
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-03"
# 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 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
sudo chmod +x ./eclipse/Eclipse.app/Contents/MacOS/eclipse
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: eclipse-emoflon-macos-dev-hipe
path: eclipse-emoflon-macos-dev-hipe.zip