Skip to content

Commit 29ddd61

Browse files
committed
wip
1 parent dd8065f commit 29ddd61

2 files changed

Lines changed: 16 additions & 46 deletions

File tree

.github/workflows/build.yml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,11 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v2
22-
- name: Setup Graalvm
23-
id: setup-graalvm
24-
uses: DeLaGuardo/setup-graalvm@master
22+
- uses: ayltai/setup-graalvm@v1
2523
with:
26-
# GraalVM version, no pattern syntax available atm
27-
graalvm: '21.3.0'
28-
# Java version, optional, defaults to 'java8'. Available options are 'java8' and 'java11'.
29-
java: 'java11'
30-
# Architecture flag, optional, defaults to 'amd64'. Available options are 'amd64' and 'aarch64'. Later is available only for linux runners.
31-
arch: 'amd64'
32-
33-
- name: Install native-image component
34-
run: |
35-
gu install native-image
24+
java-version: 11
25+
graalvm-version: 21.3.0
26+
native-image: true
3627

3728
- name: Build native spp-cli
3829
run: gradle assemble nativeImage -Dbuild.profile=release
@@ -64,15 +55,14 @@ jobs:
6455
native-image: true
6556

6657
- name: Build native spp-cli.exe
67-
run: ./gradlew assemble nativeImage --debug --info --stacktrace
58+
run: ./gradlew assemble nativeImage -Dbuild.profile=release
6859
shell: powershell
69-
- run: ls build/graal
70-
# - name: Run UPX
71-
# uses: crazy-max/ghaction-upx@v1.3.3
72-
# with:
73-
# version: latest
74-
# file: target/demo-cli.exe
75-
# args: '-7'
60+
- name: Run UPX
61+
uses: crazy-max/ghaction-upx@v1.3.3
62+
with:
63+
version: latest
64+
file: build/graal/spp-cli
65+
args: '-7'
7666
- uses: actions/upload-artifact@v2
7767
with:
7868
if-no-files-found: warn
@@ -179,10 +169,10 @@ jobs:
179169
with:
180170
name: spp-cli-linux64.zip
181171
path: ./spp-cli-linux64.zip
182-
172+
183173
releaseDraft:
184174
name: Release Draft
185-
needs: [buildOnMac, buildOnLinux]
175+
needs: [ buildOnMac, buildOnLinux ]
186176
runs-on: ubuntu-latest
187177
if: github.ref == 'refs/heads/master'
188178
steps:

build.gradle.kts

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,34 +114,14 @@ nativeImage {
114114
dependsOn("shadowJar")
115115
runtimeClasspath = configurations.shadow.get()
116116
graalVmHome = System.getenv("GRAALVM_HOME")
117-
// mainClass ="com.example.App" // Deprecated, use `buildType.executable.main` as follows instead.
118117
buildType { build ->
119118
build.executable(main = "spp.cli.Main")
120119
}
121-
executableName = "my-native-application"
122-
outputDirectory = file("$buildDir/executable")
123-
arguments(
124-
"--no-fallback"
125-
// "--enable-all-security-services",
126-
// options.traceClassInitialization("com.example.MyDataProvider,com.example.MyDataConsumer"),
127-
// "--initialize-at-run-time=com.example.runtime",
128-
// "--report-unsupported-elements-at-runtime"
129-
)
120+
executableName = "spp-cli"
121+
outputDirectory = file("$buildDir/graal")
122+
arguments("--no-fallback")
130123
}
131124

132-
//graal {
133-
// windowsVsVersion("2022")
134-
// windowsVsEdition("BuildTools")
135-
// graalVersion(project.properties["graalVersion"] as String)
136-
// javaVersion("11")
137-
// mainClass("spp.cli.Main")
138-
// outputName("spp-cli")
139-
// option("-H:+PrintClassInitialization")
140-
// option("-H:+ReportExceptionStackTraces")
141-
// option("-H:IncludeResourceBundles=build")
142-
// option("-H:+AddAllCharsets")
143-
//}
144-
145125
tasks.getByName<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
146126
archiveBaseName.set("spp-cli")
147127
archiveClassifier.set("")

0 commit comments

Comments
 (0)