diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 787bca71..8fadfbb2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,8 @@ name: GraalVM Native Image on: - push: - tags: - - '*' - paths-ignore: - - LICENSE - - '*.md' + release: + types: [created] defaults: run: @@ -31,7 +27,6 @@ jobs: strategy: fail-fast: false matrix: - version: [ '22.3.2' ] java-version: [ '21' ] os: [ macos-latest ] @@ -47,7 +42,6 @@ jobs: - name: ☕ Setup GraalVM Build uses: graalvm/setup-graalvm@v1 with: - version: ${{ matrix.version }} java-version: ${{ matrix.java-version }} github-token: ${{ secrets.GITHUB_TOKEN }} distribution: 'graalvm' @@ -58,8 +52,6 @@ jobs: - name: 🏗️ Native Image Build & Test id: native-build run: | - echo $JAVA_HOME - echo $GRAALVM_HOME ./gradlew buildBinary mv hildr-node/build/binary/hildr-node hildr-node/build/binary/hildr-node-osx ls -ltrh hildr-node/build/binary/hildr-node-osx @@ -78,7 +70,6 @@ jobs: strategy: fail-fast: false matrix: - version: [ '22.3.2' ] java-version: [ '21' ] os: [ windows-latest ] @@ -94,7 +85,6 @@ jobs: - name: ☕ Setup GraalVM Build uses: graalvm/setup-graalvm@v1 with: - version: ${{ matrix.version }} java-version: ${{ matrix.java-version }} github-token: ${{ secrets.GITHUB_TOKEN }} distribution: 'graalvm' @@ -105,7 +95,7 @@ jobs: - name: 🏗️ Native Image Build & Test id: native-build run: | - ./gradlew buildBinary + ./gradlew buildBinaryOnWindows ls -ltrh hildr-node/build/binary/hildr-node.exe - name: 📤 Upload ${{ matrix.os }} native image @@ -122,7 +112,6 @@ jobs: strategy: fail-fast: false matrix: - version: [ '22.3.2' ] java-version: [ '21' ] os: [ ubuntu-latest ] @@ -138,7 +127,6 @@ jobs: - name: ☕ Setup GraalVM Build uses: graalvm/setup-graalvm@v1 with: - version: ${{ matrix.version }} java-version: ${{ matrix.java-version }} github-token: ${{ secrets.GITHUB_TOKEN }} distribution: 'graalvm' @@ -174,7 +162,6 @@ jobs: - name: ☕ Setup GraalVM Build uses: graalvm/setup-graalvm@v1 with: - version: '22.3.2' java-version: '21' distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/hildr-node/build.gradle b/hildr-node/build.gradle index 2a1c2962..aff707a6 100644 --- a/hildr-node/build.gradle +++ b/hildr-node/build.gradle @@ -360,6 +360,21 @@ task buildBinary { println(out.toString()) } +task buildBinaryOnWindows{ + dependsOn copyJarToBinaryDir + def buildBinaryDir = "build/binary" + def out = new ByteArrayOutputStream() + doLast { + exec { + workingDir buildBinaryDir + executable "cmd" + args "/c", "native-image -jar ${project.name}.jar --no-fallback --enable-http --enable-https --enable-preview -H:EnableURLProtocols=http,https --initialize-at-build-time=org.slf4j.LoggerFactory,ch.qos.logback.core.CoreConstants,ch.qos.logback.core.util.Loader,ch.qos.logback.core.util.StatusPrinter,ch.qos.logback.core.status.InfoStatus,ch.qos.logback.classic.Logger,ch.qos.logback.core.rolling.helper.FileNamePattern,ch.qos.logback.classic.Level,ch.qos.logback.core.status.StatusBase,io.opentelemetry.api.trace.ArrayBasedTraceStateBuilder,io.opentelemetry.context.LazyStorage,ch.qos.logback.core.util.FileSize,ch.qos.logback.core.rolling.helper.RollingCalendar,io.opentelemetry.api.internal.ImmutableSpanContext,io.opentelemetry.api.internal.OtelEncodingUtils,ch.qos.logback.classic.PatternLayout,io.opentelemetry.context.ThreadLocalContextStorage,io.opentelemetry.api.trace.PropagatedSpan,io.opentelemetry.context.ContextStorageWrappers,ch.qos.logback.core.rolling.helper.Compressor\$1,io.opentelemetry.api.trace.ImmutableTraceFlags,ch.qos.logback.core.rolling.helper.RollingCalendar\$1,ch.qos.logback.classic.model.ConfigurationModel,ch.qos.logback.core.model.processor.DefaultProcessor\$1,ch.qos.logback.core.model.processor.ImplicitModelHandler\$1,ch.qos.logback.core.subst.Token,ch.qos.logback.core.pattern.parser.Parser,ch.qos.logback.core.subst.Parser\$1,ch.qos.logback.core.util.Duration,ch.qos.logback.core.model.processor.ChainedModelFilter\$1,ch.qos.logback.classic.model.processor.ConfigurationModelHandler,ch.qos.logback.classic.model.processor.LogbackClassicDefaultNestedComponentRules,ch.qos.logback.core.subst.NodeToStringTransformer\$1,ch.qos.logback.core.pattern.parser.TokenStream\$1,ch.qos.logback.core.subst.Tokenizer\$1 --initialize-at-run-time=io.netty.channel.AbstractChannel,io.netty.channel.socket.nio.SelectorProviderUtil,io.netty.util.concurrent.DefaultPromise,io.netty,org.slf4j.MDC,org.github.gestalt.config ${project.name}" + standardOutput out + } + } + println(out.toString()) +} + task buildBinaryStaticNoG1GC { dependsOn copyJarToBinaryDir def buildBinaryDir = "build/binary"