diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cdf26a8..5de09ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,14 @@ jobs: - name: Build native binary run: gradle nativeCompile + - name: Install UPX (Linux) + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get update && sudo apt-get install -y upx + + - name: Compress binary with UPX (Linux only) + if: matrix.os == 'ubuntu-latest' + run: upx --best --lzma build/native/nativeCompile/notevc + - name: Rename binary for platform run: | mv build/native/nativeCompile/notevc notevc-${{ matrix.platform }} diff --git a/build.gradle.kts b/build.gradle.kts index 647eab0..927cb3d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,7 +26,7 @@ dependencies { val junitVersion = "5.10.0" implementation(kotlin("stdlib")) implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3") - + testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion") } @@ -47,19 +47,19 @@ graalvmNative { named("main") { imageName.set("notevc") mainClass.set("io.notevc.NoteVCKt") - + buildArgs.addAll(listOf( "--no-fallback", "-H:+ReportExceptionStackTraces", "-H:+UnlockExperimentalVMOptions", - "--initialize-at-build-time=kotlin", "--initialize-at-build-time=kotlinx", "--initialize-at-build-time=io.notevc", - - "--enable-monitoring=heapdump,jfr", "-H:IncludeResources=.*\\.json", - "-H:IncludeResources=.*\\.properties" + "-H:IncludeResources=.*\\.properties", + "-Ob", // Optimize for size + "--gc=serial", // Use smaller GC (if you don't need G1) + "--strict-image-heap" )) } }