From 95ecf4d704ed140075809c04704779ead37ef5cc Mon Sep 17 00:00:00 2001 From: Julien Vincent Date: Tue, 16 Jul 2024 16:59:37 -0600 Subject: [PATCH] Update build pipeline --- .github/workflows/release.yaml | 19 +++++-------------- build.clj | 6 +++--- justfile | 7 ++----- .../k16.kl/native-image.properties | 1 + 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 054e574..c9a7f7b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,24 +32,20 @@ jobs: - name: Fetch Tags run: git fetch --tags origin - - uses: actions/setup-java@v2 + - uses: graalvm/setup-graalvm@v1 with: - distribution: 'temurin' - java-version: 21 + java-version: '22' + distribution: 'graalvm' + github-token: ${{ secrets.GITHUB_TOKEN }} - uses: extractions/setup-just@v1 - uses: DeLaGuardo/setup-clojure@9.5 with: cli: latest - - uses: graalvm/setup-graalvm@v1 - with: - java-version: '21' - distribution: 'graalvm' - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Configure Auth run: | + mkdir -p ~/.m2/ cp ./build/settings.xml ~/.m2/settings.xml - name: Build Native Image @@ -86,11 +82,6 @@ jobs: mv checksums.txt bin/checksums.txt - - uses: actions/setup-java@v2 - with: - distribution: 'temurin' - java-version: 21 - - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') diff --git a/build.clj b/build.clj index bd2a546..5793c4c 100644 --- a/build.clj +++ b/build.clj @@ -5,12 +5,12 @@ (def basis (b/create-basis {:project "deps.edn" :aliases [:native]})) (def class-dir "target/classes") -(def uber-file "target/kl.jar") +(def jar-file "target/kl.jar") (defn clean [_] (b/delete {:path "target"})) -(defn uber [_] +(defn build [_] (clean nil) (b/copy-dir {:src-dirs ["src" "resources"] :target-dir class-dir}) @@ -22,6 +22,6 @@ "-Dclojure.spec.skip-macros=true"]}) (b/uber {:class-dir class-dir - :uber-file uber-file + :uber-file jar-file :basis basis :main 'k16.kl.cli})) diff --git a/justfile b/justfile index 6d265af..bcb58d9 100644 --- a/justfile +++ b/justfile @@ -1,8 +1,5 @@ -clean: - clojure -T:build clean - -build: clean - clojure -T:build uber +build: + clojure -T:build build native-image: $GRAALVM_HOME/bin/native-image -jar target/kl.jar target/kl diff --git a/resources/META-INF/native-image/k16.kl/native-image.properties b/resources/META-INF/native-image/k16.kl/native-image.properties index 0e5223a..1ec4d8f 100644 --- a/resources/META-INF/native-image/k16.kl/native-image.properties +++ b/resources/META-INF/native-image/k16.kl/native-image.properties @@ -2,6 +2,7 @@ Args = --no-fallback \ --features=clj_easy.graal_build_time.InitClojureClasses \ --report-unsupported-elements-at-runtime \ -H:+UnlockExperimentalVMOptions \ + --initialize-at-build-time=org.fusesource.jansi.Ansi$Attribute,org.fusesource.jansi.Ansi$Color \ -H:ReflectionConfigurationResources=${.}/reflect-config.json \ -H:ResourceConfigurationResources=${.}/resource-config.json \ -H:+ReportExceptionStackTraces