Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/aot-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Ahead-of-time compile & publish
on:
push:
branches: [ "main" ]
tags: ["v*"]

jobs:
aot-compile:
name: AOT compile on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14, windows-2022, ubuntu-24.04, ubuntu-24.04-arm]
steps:
- uses: actions/checkout@v4

- uses: graalvm/setup-graalvm@v1
with:
java-version: '23'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'

- name: Setup SBT
uses: sbt/setup-sbt@v1

- name: Build native image
run: sbt GraalVMNativeImage/packageBin

- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: jelly-cli-${{ matrix.os }}
path: target/graalvm-native-image/jelly-cli

# TODO: we just build and upload the artifact.
# We should also publish it to GitHub releases.
29 changes: 29 additions & 0 deletions .github/workflows/aot-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Ahead-of-time compilation test
on:
pull_request:
branches: [ "main" ]

jobs:
build:
name: AOT test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14, windows-2022, ubuntu-24.04]
steps:
- uses: actions/checkout@v4

- uses: graalvm/setup-graalvm@v1
with:
java-version: '23'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'

- name: Setup SBT
uses: sbt/setup-sbt@v1

- name: Build native image
env:
DEV_BUILD: true
run: sbt GraalVMNativeImage/packageBin
15 changes: 13 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ resolvers +=
lazy val jenaV = "5.3.0"
lazy val jellyV = "2.8.0+14-4181e89a-SNAPSHOT"

def isDevBuild: Boolean =
sys.env.get("DEV_BUILD").exists(s => s != "0" && s != "false")

lazy val root = (project in file("."))
.enablePlugins(BuildInfoPlugin)
.enablePlugins(
BuildInfoPlugin,
GraalVMNativeImagePlugin,
)
.settings(
name := "cli",
name := "jelly-cli",
libraryDependencies ++= Seq(
"org.apache.jena" % "jena-core" % jenaV,
"org.apache.jena" % "jena-arq" % jenaV,
Expand All @@ -25,4 +31,9 @@ lazy val root = (project in file("."))
libraryDependencies,
),
buildInfoPackage := "eu.neverblink.jelly.cli",

// GraalVM settings
Compile / mainClass := Some("eu.neverblink.jelly.cli.App"),
// Do a fast build if it's a dev build
graalVMNativeImageOptions := (if (isDevBuild) Seq("-Ob") else Seq())
)
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.3")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.11.1")
3 changes: 1 addition & 2 deletions src/main/scala/eu/neverblink/jelly/cli/command/Version.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ object Version extends JellyCommand[VersionOptions]:
val jellyV = BuildInfo.libraryDependencies
.find(_.startsWith("eu.ostrzyciel.jelly:jelly-jena:")).get.split(":")(2)
printLine(
f"""jelly-cli ${BuildInfo.version}
f"""jelly-cli ${BuildInfo.version}
|----------------------------------------------
|Jelly-JVM $jellyV
|Apache Jena $jenaV
|JVM ${System.getProperty("java.vm.name")} ${System.getProperty("java.vm.version")}
|
|""".stripMargin)
Loading