Skip to content

Commit cc9c2b2

Browse files
committed
Add native image build workflow
1 parent 8b6528c commit cc9c2b2

File tree

3 files changed

+116
-62
lines changed

3 files changed

+116
-62
lines changed

.github/workflows/native-build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: GraalVM Native Image builds
2+
on: [workflow_dispatch, push, pull_request]
3+
jobs:
4+
build:
5+
name: Build on ${{ matrix.os }}
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
matrix:
9+
os: [macos-latest, ubuntu-latest]
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: graalvm/setup-graalvm@v1
14+
with:
15+
java-version: '21'
16+
distribution: 'graalvm'
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
native-image-job-reports: 'true'
19+
20+
- name: Maven version
21+
run: mvn --version
22+
23+
- name: Native image version
24+
run: |
25+
echo "GRAALVM_HOME: $GRAALVM_HOME"
26+
echo "JAVA_HOME: $JAVA_HOME"
27+
java --version
28+
native-image --version
29+
30+
31+
# - name: Upload binary
32+
# uses: actions/upload-artifact@v4
33+
# with:
34+
# name: helloworld-${{ matrix.os }}
35+
# path: helloworld*

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
*.autofetch
2+
*.orig
3+
.classpath
4+
.project
5+
.settings/
6+
target/
7+
logs/
8+
log/
9+
ebean-autotune.xml
10+
ebean-profiling*.xml
11+
/db
12+
/mydb.db
13+
profiling/
14+
.DS_Store
15+
16+
# Intellij project files
17+
*.iml
18+
*.ipr
19+
*.iws
20+
.idea/
21+
*uuid.state

pom.xml

Lines changed: 60 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -238,67 +238,45 @@
238238
</executions>
239239
</plugin>
240240

241-
<plugin>
242-
<groupId>org.graalvm.buildtools</groupId>
243-
<artifactId>native-maven-plugin</artifactId>
244-
<version>0.10.6</version>
245-
<executions>
246-
<execution>
247-
<id>build-native</id>
248-
<goals>
249-
<goal>build</goal>
250-
</goals>
251-
<phase>package</phase>
252-
<configuration>
253-
<mainClass>org.ebean.monitor.Application</mainClass>
254-
<buildArgs>
255-
<buildArg>--no-fallback</buildArg>
256-
<buildArg>--allow-incomplete-classpath</buildArg>
257-
</buildArgs>
258-
</configuration>
259-
</execution>
260-
</executions>
261-
</plugin>
262-
<plugin>
263-
<groupId>com.google.cloud.tools</groupId>
264-
<artifactId>jib-maven-plugin</artifactId>
265-
<version>3.4.5</version>
266-
<dependencies>
267-
<dependency>
268-
<groupId>com.google.cloud.tools</groupId>
269-
<artifactId>jib-native-image-extension-maven</artifactId>
270-
<version>0.1.0</version>
271-
</dependency>
272-
</dependencies>
273-
274-
<configuration>
275-
<from>
276-
<image>gcr.io/distroless/static-debian12</image>
277-
<platforms>
278-
<platform>
279-
<architecture>arm64</architecture>
280-
<os>linux</os>
281-
</platform>
282-
</platforms>
283-
</from>
284-
<to>
285-
<image>ebean-insight-svc</image>
286-
<tags>${project.version}</tags>
287-
</to>
288-
289-
<container>
290-
<ports>8081</ports>
291-
</container>
292-
<pluginExtensions>
293-
<pluginExtension>
294-
<implementation>com.google.cloud.tools.jib.maven.extension.nativeimage.JibNativeImageExtension</implementation>
295-
<properties>
296-
<imageName>ebean-insight</imageName>
297-
</properties>
298-
</pluginExtension>
299-
</pluginExtensions>
300-
</configuration>
301-
</plugin>
241+
<!-- <plugin>-->
242+
<!-- <groupId>com.google.cloud.tools</groupId>-->
243+
<!-- <artifactId>jib-maven-plugin</artifactId>-->
244+
<!-- <version>3.4.5</version>-->
245+
<!-- <dependencies>-->
246+
<!-- <dependency>-->
247+
<!-- <groupId>com.google.cloud.tools</groupId>-->
248+
<!-- <artifactId>jib-native-image-extension-maven</artifactId>-->
249+
<!-- <version>0.1.0</version>-->
250+
<!-- </dependency>-->
251+
<!-- </dependencies>-->
252+
253+
<!-- <configuration>-->
254+
<!-- <from>-->
255+
<!-- <image>gcr.io/distroless/static-debian12</image>-->
256+
<!-- <platforms>-->
257+
<!-- <platform>-->
258+
<!-- <architecture>arm64</architecture>-->
259+
<!-- <os>linux</os>-->
260+
<!-- </platform>-->
261+
<!-- </platforms>-->
262+
<!-- </from>-->
263+
<!-- <to>-->
264+
<!-- <image>ebean-insight-svc</image>-->
265+
<!-- <tags>${project.version}</tags>-->
266+
<!-- </to>-->
267+
<!-- <container>-->
268+
<!-- <ports>8081</ports>-->
269+
<!-- </container>-->
270+
<!-- <pluginExtensions>-->
271+
<!-- <pluginExtension>-->
272+
<!-- <implementation>com.google.cloud.tools.jib.maven.extension.nativeimage.JibNativeImageExtension</implementation>-->
273+
<!-- <properties>-->
274+
<!-- <imageName>ebean-insight</imageName>-->
275+
<!-- </properties>-->
276+
<!-- </pluginExtension>-->
277+
<!-- </pluginExtensions>-->
278+
<!-- </configuration>-->
279+
<!-- </plugin>-->
302280

303281
</plugins>
304282
</build>
@@ -308,7 +286,27 @@
308286
<id>native</id>
309287
<build>
310288
<plugins>
311-
289+
<plugin>
290+
<groupId>org.graalvm.buildtools</groupId>
291+
<artifactId>native-maven-plugin</artifactId>
292+
<version>0.10.6</version>
293+
<executions>
294+
<execution>
295+
<id>build-native</id>
296+
<goals>
297+
<goal>build</goal>
298+
</goals>
299+
<phase>package</phase>
300+
<configuration>
301+
<mainClass>org.ebean.monitor.Application</mainClass>
302+
<buildArgs>
303+
<buildArg>--no-fallback</buildArg>
304+
<buildArg>--allow-incomplete-classpath</buildArg>
305+
</buildArgs>
306+
</configuration>
307+
</execution>
308+
</executions>
309+
</plugin>
312310
</plugins>
313311
</build>
314312
</profile>

0 commit comments

Comments
 (0)