-
Notifications
You must be signed in to change notification settings - Fork 7
204 lines (193 loc) · 7.06 KB
/
standalone.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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
# on:
# push:
# branches: [ standalonetest ]
on:
push:
tags:
- v*.*.*
jobs:
front:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout tools repo
uses: actions/checkout@v3
with:
repository: correctexam/corrigeExamFront
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# caching node_modules
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install all system dependencies
run: sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: |
npm ci
- name: Build
run: |
npm run webapp:build:prodlocal
- name: Lint
run: |
npm run lint
- name: Test
run: |
npm run test
- name: Copy 404
run: |
npm run copy:404
- name: Upload front
uses: actions/upload-artifact@v3
with:
name: front
path: target/classes/static/
retention-days: 1
build-native-image:
needs: [front]
name: 'Build Native Image'
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
experimental: [true]
#windows-latest, macos-latest, ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: graalvm/setup-graalvm@v1
with:
java-version: '17'
version: '22.3.2'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: Download front
uses: actions/download-artifact@v3
with:
name: front
path: src/main/resources/META-INF/resources/
- name: Native build using maven # https://graalvm.github.io/native-build-tools/latest/maven-plugin.html
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
run: mvn --activate-profiles "native,alone" clean package
- name: Native build using maven for windows # https://graalvm.github.io/native-build-tools/latest/maven-plugin.html
if: startsWith(matrix.os, 'windows')
run: mvn --activate-profiles "native,alonewindows" clean package -DskipTests
- name: rename mac
if: startsWith(matrix.os, 'macos')
run: ls -l target/* && mv target/correctexam-1.0.0-SNAPSHOT-runner* target/correctexam-macos-runner
- name: rename linux
if: startsWith(matrix.os, 'ubuntu')
run: ls -l target/* && mv target/correctexam-1.0.0-SNAPSHOT-runner* target/correctexam-linux-runner
- name: prepare Windows Folder
if: startsWith(matrix.os, 'windows')
# run: cp target/correctexam-1.0.0-SNAPSHOT-runner* distwindows/correctexam-windows-runner.exe
run: copy target\correctexam-1.0.0-SNAPSHOT-runner* distwindows\correctexam-windows-runner.exe
- name: Upload binary linux
uses: actions/upload-artifact@v3
if: startsWith(matrix.os, 'ubuntu-latest')
with:
name: correctexam.standalone.linux
path: target/correctexam-linux-runner
retention-days: 1
- name: Upload sbom
uses: actions/upload-artifact@v3
if: startsWith(matrix.os, 'ubuntu-latest')
with:
name: correctexam.standalone.bom.back
path: target/bom.json
retention-days:
- name: Upload binary macos
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'macos')
with:
name: correctexam.standalone.macos
path: target/correctexam-macos-runner
retention-days: 1
- name: Upload binary windows
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'windows')
with:
name: correctexam.standalone.windows
path: distwindows
retention-days: 1
publish-native-image:
needs: [build-native-image]
name: 'Publish Native Image'
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
experimental: [true]
#windows-latest,, macos-latest, ubuntu-latest
steps:
- name: Download ubuntu binary
uses: actions/download-artifact@v3
if: startsWith(matrix.os, 'ubuntu')
with:
name: correctexam.standalone.linux
path: correctexam.standalone.linux
- name: Download bom
uses: actions/download-artifact@v3
if: startsWith(matrix.os, 'ubuntu')
with:
name: correctexam.standalone.bom.back
path: correctexam.standalone.bom.back
- name: Download macos binary
uses: actions/download-artifact@v3
if: startsWith(matrix.os, 'macos')
with:
name: correctexam.standalone.macos
path: correctexam.standalone.macos
- name: Download windows binary
uses: actions/download-artifact@v3
if: startsWith(matrix.os, 'windows')
with:
name: correctexam.standalone.windows
path: correctexam.standalone.windows
- name: Release standalone linux
uses: softprops/action-gh-release@v1
if: startsWith(matrix.os, 'ubuntu')
# if: startsWith(github.ref, 'refs/tags/')
with:
files: |
correctexam.standalone.linux/correctexam-linux-runner
correctexam.standalone.bom.back/bom.json
# tag_name: v1
- name: Release standalone macos
uses: softprops/action-gh-release@v1
if: startsWith(matrix.os, 'macos')
# if: startsWith(github.ref, 'refs/tags/')
with:
files: correctexam.standalone.macos/correctexam-macos-runner
# tag_name: v1
- name: Release standalone windows
uses: softprops/action-gh-release@v1
if: startsWith(matrix.os, 'windows')
# if: startsWith(github.ref, 'refs/tags/')
with:
files: |
correctexam.standalone.windows/*
# correctexam.standalone.windows/mydb.mv.db
# correctexam.standalone.windows/mydb.trace.db
# tag_name: v1