-
Notifications
You must be signed in to change notification settings - Fork 13
299 lines (254 loc) · 9.31 KB
/
gradle.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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Gradle Build
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
workflow_dispatch:
permissions:
contents: write
concurrency:
group: gradle-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build-jar:
name: jar / ${{ matrix.os }} / ${{ matrix.jdk-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
jdk-version: [ 21 ]
os:
- ubuntu-latest
- windows-latest
- macos-13 # Intel OSX
- macos-14 # ARM64 OSX
steps:
- uses: actions/checkout@v4
- name: Set Up JDK ${{ matrix.jdk-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk-version }}
distribution: 'temurin'
- name: Gradle Build Jar
uses: gradle/actions/setup-gradle@v3
with:
add-job-summary: 'on-failure'
arguments: clean assemble -Penv=prod-jar
- name: Upload Jar
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: java-${{ matrix.jdk-version }}-${{ runner.os }}-${{ runner.arch }}-jar
path: build/libs/*-fx.jar
retention-days: 10
if-no-files-found: error
- name: Release Jar
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_NAME: trinity-${{ runner.os }}-${{ runner.arch }}-java-${{ matrix.jdk-version }}
shell: bash
run: |
mv build/libs/*-no-fx.jar "$RELEASE_NAME-slim.jar"
mv build/libs/*-fx.jar "$RELEASE_NAME.jar"
if [[ "$RUNNER_OS" == "macOS" ]]; then
zip "$RELEASE_NAME-jar.zip" "$RELEASE_NAME.jar"
elif [[ "$RUNNER_OS" == "Windows" ]]; then
7z a "$RELEASE_NAME-jar.zip" "$RELEASE_NAME.jar"
elif [[ "$RUNNER_OS" == "Linux" ]]; then
zip "$RELEASE_NAME-jar.zip" "$RELEASE_NAME.jar"
zip "trinity-java-${{ matrix.jdk-version }}-slim-jar.zip" "$RELEASE_NAME-slim.jar"
gh release upload "${{ github.ref_name }}" "trinity-java-${{ matrix.jdk-version }}-slim-jar.zip"
else
exit 1
fi
gh release upload "${{ github.ref_name }}" "$RELEASE_NAME-jar.zip"
build-jlink:
name: jlink / ${{ matrix.os }} / ${{ matrix.jdk-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
jdk-version: [ 21 ]
os:
- ubuntu-latest
- windows-latest
- macos-13 # Intel OSX
- macos-14 # ARM64 OSX
steps:
- uses: actions/checkout@v4
- name: Set Up JDK ${{ matrix.jdk-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk-version }}
distribution: 'temurin'
- name: Gradle Build JLink Zip
uses: gradle/actions/setup-gradle@v3
with:
add-job-summary: 'on-failure'
arguments: clean jlink -Penv=prod-jlink
- name: Upload JLink Zip
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: java-${{ matrix.jdk-version }}-${{ runner.os }}-${{ runner.arch }}-jlink-zip
path: build/image/**
retention-days: 10
if-no-files-found: error
- name: Release JLink
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_NAME: trinity-${{ runner.os }}-${{ runner.arch }}-java-${{ matrix.jdk-version }}
shell: bash
run: |
mv "build/image" "build/Trinity"
pushd "build"
if [[ "$RUNNER_OS" == "macOS" ]]; then
zip -r "../$RELEASE_NAME-jlink.zip" "Trinity"
elif [[ "$RUNNER_OS" == "Windows" ]]; then
7z a "../$RELEASE_NAME-jlink.zip" "Trinity"
elif [[ "$RUNNER_OS" == "Linux" ]]; then
zip -r ../"$RELEASE_NAME-jlink.zip" "Trinity"
else
exit 1
fi
popd
gh release upload "${{ github.ref_name }}" "$RELEASE_NAME-jlink.zip"
build-jpackage:
name: jpackage / ${{ matrix.os }} / ${{ matrix.jdk-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
jdk-version: [ 21 ]
os:
- ubuntu-latest
- windows-latest
- macos-13 # Intel OSX
- macos-14 # ARM64 OSX
steps:
- uses: actions/checkout@v4
- name: Set Up JDK ${{ matrix.jdk-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk-version }}
distribution: 'temurin'
- name: Gradle Build JPackage
uses: gradle/actions/setup-gradle@v3
with:
add-job-summary: 'on-failure'
arguments: clean jpackage -Penv=prod-jlink
- name: Upload JPackage
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: java-${{ matrix.jdk-version }}-${{ runner.os }}-${{ runner.arch }}-jpackage
path: build/jpackage/**
retention-days: 10
if-no-files-found: error
- name: Release JPackage
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_NAME: trinity-${{ runner.os }}-${{ runner.arch }}-java-${{ matrix.jdk-version }}
shell: bash
run: |
if [[ "$RUNNER_OS" == "macOS" ]]; then
mv build/jpackage/Trinity.app "Trinity.app"
zip -r "$RELEASE_NAME-jpackage.zip" "Trinity.app"
elif [[ "$RUNNER_OS" == "Windows" ]]; then
mv build/jpackage/** .
7z a "$RELEASE_NAME-jpackage.zip" "Trinity"
elif [[ "$RUNNER_OS" == "Linux" ]]; then
mv build/jpackage/** .
zip -r "$RELEASE_NAME-jpackage.zip" "Trinity/bin" "Trinity/lib"
else
exit 1
fi
gh release upload "${{ github.ref_name }}" "$RELEASE_NAME-jpackage.zip"
build-native:
name: native / ${{ matrix.os }} / ${{ matrix.jdk-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
jdk-version: [ 21 ]
os:
- ubuntu-latest
- windows-latest
- macos-14 # ARM64 OSX
# - macos-13 # Intel OSX (TODO Not Supported)
steps:
- uses: actions/checkout@v4
# https://github.com/gluonhq/substrate
- name: Linux Only - Install Additional Dependencies needed by substrate
if: runner.os == 'Linux'
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install --yes --no-install-recommends libasound2-dev libavcodec-dev libavformat-dev libavutil-dev libfreetype6-dev
sudo apt-get install --yes --no-install-recommends libgl-dev libglib2.0-dev libgtk-3-dev libpango1.0-dev libx11-dev libxtst-dev zlib1g-dev
# Setup CL, msbuild, etc.
- name: Windows Only - Enable Windows Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.13.0
if: runner.os == 'Windows'
with:
arch: x64
- name: Set Up JDK ${{ matrix.jdk-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk-version }}
distribution: 'temurin'
- name: Set Up GraalVM ${{ matrix.jdk-version }}
uses: graalvm/setup-graalvm@v1
with:
java-version: ${{ matrix.jdk-version }}
distribution: 'graalvm'
#components: 'native-image' # default
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Gradle Build Native
uses: gradle/actions/setup-gradle@v3
with:
add-job-summary: 'on-failure'
arguments: clean nativeBuild --stacktrace -Penv=prod-graal
- name: Upload Native
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: java-${{ matrix.jdk-version }}-${{ runner.os }}-${{ runner.arch }}-native
path: build/gluonfx/**/trinity*
retention-days: 10
if-no-files-found: error
- name: Release Native
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_NAME: trinity-${{ runner.os }}-${{ runner.arch }}-java-${{ matrix.jdk-version }}
shell: bash
run: |
if [[ "$RUNNER_OS" == "macOS" ]]; then
mv build/gluonfx/**/trinity* "Trinity.app"
zip "$RELEASE_NAME-native.zip" "Trinity.app"
elif [[ "$RUNNER_OS" == "Windows" ]]; then
mv build/gluonfx/**/trinity*.exe "Trinity.exe"
7z a "$RELEASE_NAME-native.zip" "Trinity.exe"
elif [[ "$RUNNER_OS" == "Linux" ]]; then
mv build/gluonfx/**/trinity* "Trinity.elf"
zip "$RELEASE_NAME-native.zip" "Trinity.elf"
else
exit 1
fi
gh release upload "${{ github.ref_name }}" "$RELEASE_NAME-native.zip"