forked from marian-m12l/studio
-
Notifications
You must be signed in to change notification settings - Fork 16
216 lines (189 loc) · 6.7 KB
/
native.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
name: Native
on:
push:
paths-ignore: [ '*.md' ]
branches: [ '*' ]
tags: [ '*.*.*' ]
permissions:
checks: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
JAVA_VERSION: 21
jobs:
build-front:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 12
- uses: actions/cache@v4
with:
path: web-ui/javascript/
key: studio-js-${{ hashFiles('**/yarn.lock') }}
- name: Run yarn
working-directory: web-ui/javascript/
run: |
yarn install --frozen-lockfile
yarn build
- uses: actions/upload-artifact@v4
with:
name: studio-front
path: web-ui/javascript/build/
build-jar:
needs: build-front
runs-on: ubuntu-latest
env:
zip-name: studio-${{github.ref_name}}-Java.zip
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{env.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{env.JAVA_VERSION}}
cache: maven
- name: Download JS front
uses: actions/download-artifact@v4
with:
name: studio-front
path: web-ui/javascript/build/
- name: Build Maven Jar
run: |
mvn install -B -Pide
cp web-ui/src/main/scripts/java/* web-ui/target/quarkus-app/
- name: Create zip
uses: thedoctor0/zip-release@main
with:
filename: ${{env.zip-name}}
directory: web-ui/target/quarkus-app
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.zip-name}}
path: web-ui/target/quarkus-app/${{env.zip-name}}
- name: Upload release artifact
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
discussion_category_name: Announcements
files: web-ui/target/quarkus-app/${{env.zip-name}}
build-native:
needs: build-front
runs-on: ${{ matrix.runner }}
continue-on-error: true
env:
zip-name: studio-${{github.ref_name}}-${{matrix.os}}.zip
strategy:
fail-fast: false
matrix:
include:
# GraalVM: Oracle, Mandrel or Liberica
# Mandrel (mac): no support
# Upx support (win): only<22, see https://github.com/oracle/graal/issues/4340
# AWT support (win & mac): only Liberica>22 see https://bell-sw.com/announcements/2022/08/05/liberica-native-image-kit-22-2-0-and-21-3-3-builds-are-out/#create-a-native-image-for-swingset2-app-linux-and-macos
# Runner: no latest for better compatibility
- runner: ubuntu-20.04
os: Linux
jdk-suffix: linux-amd64.tar.gz
- runner: macOS-latest
os: MacOS
jdk-suffix: macos-amd64.tar.gz
- runner: windows-latest
os: Windows
jdk-suffix: windows-amd64.zip
steps:
- uses: actions/checkout@v4
- name: Use GNU tar
run: |
"$env:ProgramFiles/Git/usr/bin" >> $env:GITHUB_PATH
if: ${{ runner.os == 'Windows' }}
- name: Download Liberica NIK
env:
#liberica-url: https://download.bell-sw.com/vm/22.3.2/bellsoft-liberica-vm-core-openjdk17.0.7+7-22.3.2+1-${{ matrix.jdk-suffix }}
#liberica-url: https://download.bell-sw.com/vm/23.1.0/bellsoft-liberica-vm-core-openjdk21+37-23.1.0+1-${{ matrix.jdk-suffix }}
liberica-url: https://github.com/bell-sw/LibericaNIK/releases/download/23.1.2+1-21.0.2+14/bellsoft-liberica-vm-core-openjdk21.0.2+14-23.1.2+1-${{ matrix.jdk-suffix }}
run: curl -sLo ${{ runner.temp }}/${{ matrix.jdk-suffix }} ${{ env.liberica-url }}
#if: ${{ runner.os != 'Linux' }}
- uses: actions/setup-java@v4
with:
java-version: ${{env.JAVA_VERSION}}
distribution: jdkfile
jdkFile: ${{ runner.temp }}/${{ matrix.jdk-suffix }}
cache: maven
#if: ${{ runner.os != 'Linux' }}
- uses: graalvm/setup-graalvm@v1
with:
java-version: ${{env.JAVA_VERSION}}
version: mandrel-latest
cache: maven
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: true
if: ${{ runner.os == 'DEPRECATED_Linux' }}
- name: (Windows) Set up compiler
uses: ilammy/msvc-dev-cmd@v1
if: ${{ runner.os == 'Windows' }}
- name: Download JS front
uses: actions/download-artifact@v4
with:
name: studio-front
path: web-ui/javascript/build/
- name: (*nix) Build native
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
java --version
native-image --version
mvn verify -B -Pnative -Pide -DskipTests
cp web-ui/src/main/scripts/native/*.sh web-ui/target/
env:
GRAALVM_HOME: ${{env.JAVA_HOME}}
if: ${{ runner.os != 'Windows' }}
- name: (Windows) Build native
run: |
echo "GRAALVM_HOME: $env:GRAALVM_HOME"
echo "JAVA_HOME: $env:JAVA_HOME"
java --version
native-image --version
mvn verify -B -Pnative -Pide -DskipTests
cp web-ui/target/*native-image-source-jar/*.dll web-ui/target/
cp web-ui/src/main/scripts/native/*.bat web-ui/target/
env:
GRAALVM_HOME: ${{env.JAVA_HOME}}
if: ${{ runner.os == 'Windows' }}
- name: Compress exec
uses: svenstaro/upx-action@v2
with:
args: '-7'
strip: false
files: |
web-ui/target/*runner
web-ui/target/*.exe
if: ${{ runner.os != 'Windows' }}
- name: Create zip
uses: thedoctor0/zip-release@main
with:
filename: ${{env.zip-name}}
directory: web-ui/target
path: '*runner *.exe *.dll *.sh *.bat'
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.zip-name}}
path: web-ui/target/${{env.zip-name}}
- name: Test native
run: mvn test-compile failsafe:integration-test -B -Pnative -Pide -DskipITs=false
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
with:
report_paths: '**/failsafe-reports/TEST-*.xml'
check_name: IT (${{ matrix.runner }})
if: always()
- name: Upload release artifact
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: web-ui/target/${{env.zip-name}}