-
Notifications
You must be signed in to change notification settings - Fork 13
211 lines (179 loc) · 6.27 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
# 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"