-
Notifications
You must be signed in to change notification settings - Fork 5
288 lines (284 loc) · 13.1 KB
/
build.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
name: Build
on:
push:
branches: [ master ]
jobs:
maven-central:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
type: [ modular, non-modular ]
steps:
- uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
- name: Find staging url
id: staging
run: |
STAGING_URL=`cat settings.properties | grep staging_url | cut -d'=' -f2`
MAVEN_VERSION=`cat settings.properties | grep maven_version | cut -d'=' -f2`
echo ::set-output name=staging_url::$STAGING_URL
echo ::set-output name=maven_version::$MAVEN_VERSION
shell: bash
- name: Test Maven (Linux)
if: runner.os == 'Linux'
run: |
export DISPLAY=:90
Xvfb -ac :90 -screen 0 1280x1024x24 > /dev/null 2>&1 &
mvn -q versions:set-property -Dproperty=staging.repo.url -DnewVersion=${{ env.staging_url }} -DgenerateBackupPoms=false -f ${{ matrix.type }}/maven/hellofx
mvn -q versions:set-property -Dproperty=javafx.version -DnewVersion=${{ env.maven_version }} -DgenerateBackupPoms=false -f ${{ matrix.type }}/maven/hellofx
mvn -q clean compile -f ${{ matrix.type }}/maven/hellofx
mvn -q javafx:run -f ${{ matrix.type }}/maven/hellofx
env:
staging_url: ${{ steps.staging.outputs.staging_url }}
maven_version: ${{ steps.staging.outputs.maven_version }}
- name: Test Maven (Mac)
if: runner.os == 'macOS'
run: |
mvn -q versions:set-property -Dproperty=staging.repo.url -DnewVersion=${{ env.staging_url }} -DgenerateBackupPoms=false -f ${{ matrix.type }}/maven/hellofx
mvn -q versions:set-property -Dproperty=javafx.version -DnewVersion=${{ env.maven_version }} -DgenerateBackupPoms=false -f ${{ matrix.type }}/maven/hellofx
mvn -q clean compile -f ${{ matrix.type }}/maven/hellofx
mvn -q javafx:run -f ${{ matrix.type }}/maven/hellofx
env:
staging_url: ${{ steps.staging.outputs.staging_url }}
maven_version: ${{ steps.staging.outputs.maven_version }}
- name: Test Maven (Windows)
if: runner.os == 'windows'
run: |
mvn -q versions:set-property -Dproperty="staging.repo.url" -DnewVersion="${{ env.staging_url }}" -DgenerateBackupPoms=false -f ${{ matrix.type }}/maven/hellofx
mvn -q versions:set-property -Dproperty="javafx.version" -DnewVersion="${{ env.maven_version }}" -DgenerateBackupPoms=false -f ${{ matrix.type }}/maven/hellofx
mvn -q clean compile -f ${{ matrix.type }}/maven/hellofx
mvn -q javafx:run -f ${{ matrix.type }}/maven/hellofx
env:
staging_url: ${{ steps.staging.outputs.staging_url }}
maven_version: ${{ steps.staging.outputs.maven_version }}
- name: Test Gradle (Linux)
if: runner.os == 'Linux'
run: |
export DISPLAY=:92
Xvfb -ac :92 -screen 0 1280x1024x24 > /dev/null 2>&1 &
cd ${{ matrix.type }}/gradle/hellofx
chmod +x gradlew
./gradlew run -Pstaging=${{ env.staging_url }} -Pjavafx_version=${{ env.maven_version }}
env:
staging_url: ${{ steps.staging.outputs.staging_url }}
maven_version: ${{ steps.staging.outputs.maven_version }}
- name: Test Gradle (Mac)
if: runner.os == 'macOS'
run: |
cd ${{ matrix.type }}/gradle/hellofx
chmod +x gradlew
./gradlew run -Pstaging=${{ env.staging_url }} -Pjavafx_version=${{ env.maven_version }}
env:
staging_url: ${{ steps.staging.outputs.staging_url }}
maven_version: ${{ steps.staging.outputs.maven_version }}
- name: Test Gradle (Windows)
if: runner.os == 'windows'
run: |
cd ${{ matrix.type }}/gradle/hellofx
.\gradlew run -Pstaging="${{ env.staging_url }}" -Pjavafx_version="${{ env.maven_version }}"
env:
staging_url: ${{ steps.staging.outputs.staging_url }}
maven_version: ${{ steps.staging.outputs.maven_version }}
sdk:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
type: [ modular, non-modular ]
steps:
- uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
- name: Find SDK version
id: sdk
run: |
SDK_VERSION=`cat settings.properties | grep sdk_version | cut -d'=' -f2`
echo ::set-output name=sdk_version::$SDK_VERSION
VERSIONPATH=$SDK_VERSION
if [[ "$VERSIONPATH" == *"ea"* ]]; then
VERSIONPATH=`echo $VERSIONPATH | cut -d'-' -f 1`
fi
echo ::set-output name=sdk_versionpath::$VERSIONPATH
shell: bash
- name: Find Platform
id: platform
run: |
OS=${{ matrix.os }}
SDK=/tmp/javafx-sdk-${{ steps.sdk.outputs.sdk_versionpath }}
if [[ "$OS" == "macos-latest" ]]; then
echo ::set-output name=platform::osx
elif [[ "$OS" == "windows-latest" ]]; then
echo ::set-output name=platform::windows
SDK=D:\\javafx-sdk-${{ steps.sdk.outputs.sdk_versionpath }}
else
echo ::set-output name=platform::linux
fi
echo ::set-output name=javafx::$SDK
shell: bash
- name: Setup JavaFX
if: runner.os != 'Windows'
run: |
wget -P /tmp https://download2.gluonhq.com/openjfx/${{ steps.sdk.outputs.sdk_versionpath }}/openjfx-${{ env.sdk_version }}_${{ env.platform }}-x64_bin-sdk.zip
unzip /tmp/openjfx-${{ env.sdk_version }}_${{ env.platform }}-x64_bin-sdk.zip -d /tmp
env:
sdk_version: ${{ steps.sdk.outputs.sdk_version }}
platform: ${{ steps.platform.outputs.platform }}
- name: Setup JavaFX (Windows)
if: runner.os == 'Windows'
run: |
Import-Module BitsTransfer; Start-BitsTransfer https://download2.gluonhq.com/openjfx/${{ steps.sdk.outputs.sdk_versionpath }}/openjfx-${{ env.sdk_version }}_windows-x64_bin-sdk.zip D:\openjfx-${{ env.sdk_version }}_windows-x64_bin-sdk.zip
Expand-Archive -Force D:\openjfx-${{ env.sdk_version }}_windows-x64_bin-sdk.zip D:\
env:
sdk_version: ${{ steps.sdk.outputs.sdk_version }}
- name: Test Gradle (Linux)
if: runner.os == 'Linux'
run: |
export DISPLAY=:94
Xvfb -ac :94 -screen 0 1280x1024x24 > /dev/null 2>&1 &
cd ${{ matrix.type }}/gradle/hellofx
chmod +x gradlew
./gradlew run -Psdk=${{ env.JAVAFX_HOME }} -Pjavafx_version=${{ env.sdk_version }}
env:
JAVAFX_HOME: ${{ steps.platform.outputs.javafx }}
sdk_version: ${{ steps.sdk.outputs.sdk_version }}
- name: Test Gradle (MacOS)
if: runner.os == 'macOS'
run: |
cd ${{ matrix.type }}/gradle/hellofx
chmod +x gradlew
./gradlew run -Psdk=${{ env.JAVAFX_HOME }} -Pjavafx_version=${{ env.sdk_version }}
env:
JAVAFX_HOME: ${{ steps.platform.outputs.javafx }}
sdk_version: ${{ steps.sdk.outputs.sdk_version }}
- name: Test Gradle (Windows)
if: runner.os == 'windows'
run: |
cd ${{ matrix.type }}/gradle/hellofx
.\gradlew run -Psdk="${{ env.JAVAFX_HOME }}" -Pjavafx_version="${{ env.sdk_version }}"
env:
JAVAFX_HOME: ${{ steps.platform.outputs.javafx }}
sdk_version: ${{ steps.sdk.outputs.sdk_version }}
jmod:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- name: Setup java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
- name: Find JMOD version
id: jmod
run: |
JMOD_VERSION=`cat settings.properties | grep jmod_version | cut -d'=' -f2`
echo ::set-output name=jmod_version::$JMOD_VERSION
VERSIONPATH=$JMOD_VERSION
if [[ "$VERSIONPATH" == *"ea"* ]]; then
VERSIONPATH=`echo $VERSIONPATH | cut -d'-' -f 1`
fi
echo ::set-output name=jmod_versionpath::$VERSIONPATH
shell: bash
- name: Find Platform
id: platform
run: |
OS=${{ matrix.os }}
JMOD_HOME=${{ runner.temp }}/javafx-jmods-${{ steps.jmod.outputs.jmod_versionpath }}
RUNTIME=target/runtime
JAVA_RUNTIME=$RUNTIME/bin/java
if [[ "$OS" == "macos-latest" ]]; then
echo ::set-output name=platform::osx
elif [[ "$OS" == "windows-latest" ]]; then
echo ::set-output name=platform::windows
JMOD_HOME=D:\\javafx-jmods-${{ steps.jmod.outputs.jmod_versionpath }}
RUNTIME=target\\runtime
JAVA_RUNTIME=$RUNTIME\\bin\\java
else
echo ::set-output name=platform::linux
fi
echo ::set-output name=jmod_home::$JMOD_HOME
echo ::set-output name=runtime::$RUNTIME
echo ::set-output name=java_runtime::$JAVA_RUNTIME
shell: bash
- name: Setup JavaFX
if: runner.os != 'Windows'
run: |
wget -P /tmp https://download2.gluonhq.com/openjfx/${{ steps.jmod.outputs.jmod_versionpath }}/openjfx-${{ env.jmod_version }}_${{ env.platform }}-x64_bin-jmods.zip
unzip /tmp/openjfx-${{ env.jmod_version }}_${{ env.platform }}-x64_bin-jmods.zip -d ${{ runner.temp }}
env:
jmod_version: ${{ steps.jmod.outputs.jmod_version }}
platform: ${{ steps.platform.outputs.platform }}
- name: Setup JavaFX (Windows)
if: runner.os == 'Windows'
run: |
Import-Module BitsTransfer; Start-BitsTransfer https://download2.gluonhq.com/openjfx/${{ steps.jmod.outputs.jmod_versionpath }}/openjfx-${{ env.jmod_version }}_windows-x64_bin-jmods.zip ${{ runner.temp }}\openjfx-${{ env.jmod_version }}_windows-x64_bin-jmods.zip
Expand-Archive -Force ${{ runner.temp }}\openjfx-${{ env.jmod_version }}_windows-x64_bin-jmods.zip D:\
env:
jmod_version: ${{ steps.jmod.outputs.jmod_version }}
- name: Test JMODS (MacOS)
if: runner.os == 'macOS'
run: |
cd modular/maven/hellofx
javac --module-path ${{ env.JMOD_HOME }} -d mods $(find src -name "*.java")
cp -r src/main/resources/* mods
${{ env.JAVA_HOME }}/bin/jlink \
--module-path ${{ env.JMOD_HOME }}:mods \
--add-modules javafx.fxml,javafx.controls,hellofx \
--output ${{ env.RUNTIME }} \
--strip-debug --compress 2 --no-header-files --no-man-pages
${{ env.JAVA_RUNTIME }} -Dsettings.javafx.version=${{ env.jmod_version }} -m hellofx/org.openjfx.MainApp
env:
RUNTIME: ${{ steps.platform.outputs.runtime }}
JAVA_RUNTIME: ${{ steps.platform.outputs.java_runtime }}
JMOD_HOME: ${{ steps.platform.outputs.jmod_home }}
jmod_version: ${{ steps.jmod.outputs.jmod_version }}
- name: Test JMODS (Windows)
if: runner.os == 'Windows'
run: |
cd modular\maven\hellofx
$SOURCES = Get-ChildItem -Name -Filter *.java -Recurse $pwd
javac --module-path "${{ env.JMOD_HOME }}" -d mods $SOURCES
Copy-Item -Force -Path "src\main\resources\*" -Destination "mods" -Recurse
${{ env.JAVA_HOME }}\bin\jlink `
--module-path "${{ env.JMOD_HOME }};mods" `
--add-modules javafx.fxml,javafx.controls,hellofx `
--output ${{ env.RUNTIME }} `
--strip-debug --compress 2 --no-header-files --no-man-pages
${{ env.JAVA_RUNTIME }} --% -Dsettings.javafx.version="${{ env.jmod_version }}" -m hellofx/org.openjfx.MainApp
env:
RUNTIME: ${{ steps.platform.outputs.runtime }}
JAVA_RUNTIME: ${{ steps.platform.outputs.java_runtime }}
JMOD_HOME: ${{ steps.platform.outputs.jmod_home }}
jmod_version: ${{ steps.jmod.outputs.jmod_version }}
- name: Test JMODS (Linux)
if: runner.os == 'Linux'
run: |
cd modular/maven/hellofx
javac --module-path ${{ env.JMOD_HOME }} -d mods $(find src -name "*.java")
cp -r src/main/resources/* mods
${{ env.JAVA_HOME }}/bin/jlink \
--module-path ${{ env.JMOD_HOME }}:mods \
--add-modules javafx.fxml,javafx.controls,hellofx \
--output ${{ env.RUNTIME }} \
--strip-debug --compress 2 --no-header-files --no-man-pages
export DISPLAY=:96
Xvfb -ac :96 -screen 0 1280x1024x24 > /dev/null 2>&1 &
${{ env.JAVA_RUNTIME }} -Dsettings.javafx.version=${{ env.jmod_version }} -m hellofx/org.openjfx.MainApp
env:
RUNTIME: ${{ steps.platform.outputs.runtime }}
JAVA_RUNTIME: ${{ steps.platform.outputs.java_runtime }}
JMOD_HOME: ${{ steps.platform.outputs.jmod_home }}
jmod_version: ${{ steps.jmod.outputs.jmod_version }}