From 9479ffd70a4d16b7b55f403b5a4e1078dc009060 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Fri, 5 May 2023 14:43:53 +0200 Subject: [PATCH 1/2] ci: refactor release procedure Make sure we're using the latest sbt-ci-release and also swap to setup-java --- .github/workflows/release.yml | 13 ++++++++----- project/plugins.sbt | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eebebfb..ad87ece 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,11 +7,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: olafurpg/setup-scala@v13 - - uses: olafurpg/setup-gpg@v3 - - run: git fetch --tags || true - - name: Publish ${{ github.ref }} - run: sbt ci-release + with: + fetch-depth: 0 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '8' + cache: 'sbt' + - run: sbt ci-release env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} PGP_SECRET: ${{ secrets.PGP_SECRET }} diff --git a/project/plugins.sbt b/project/plugins.sbt index bfa78ad..96148c6 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.4") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.27") From 631751ea6c24ce18a3cad9567eb465b7013a84bf Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Fri, 5 May 2023 14:48:21 +0200 Subject: [PATCH 2/2] format to make CI happy --- .../sbtnativeimage/NativeImagePlugin.scala | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala b/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala index 55efc99..815cfb9 100644 --- a/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala +++ b/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala @@ -57,9 +57,10 @@ object NativeImagePlugin extends AutoPlugin { lazy val nativeImageCommand: TaskKey[Seq[String]] = taskKey[Seq[String]]( "The command arguments to launch the GraalVM native-image binary." ) - lazy val nativeImageTestCommand: TaskKey[Seq[String]] = taskKey[Seq[String]]( - "The command arguments to launch the GraalVM native-image binary of tests." - ) + lazy val nativeImageTestCommand: TaskKey[Seq[String]] = + taskKey[Seq[String]]( + "The command arguments to launch the GraalVM native-image binary of tests." + ) lazy val nativeImageRunAgent: InputKey[Unit] = inputKey[Unit]( "Run application, tracking all usages of dynamic features of an execution with `native-image-agent`." ) @@ -76,10 +77,11 @@ object NativeImagePlugin extends AutoPlugin { "Whether `native-image-agent` should merge generated configurations." + s" (See $assistedConfigurationOfNativeImageBuildsLink for details)" ) - lazy val nativeImageTestAgentMerge: SettingKey[Boolean] = settingKey[Boolean]( - "Whether `native-image-agent` should merge generated configurations for tests." + - s" (See $assistedConfigurationOfNativeImageBuildsLink for details)" - ) + lazy val nativeImageTestAgentMerge: SettingKey[Boolean] = + settingKey[Boolean]( + "Whether `native-image-agent` should merge generated configurations for tests." + + s" (See $assistedConfigurationOfNativeImageBuildsLink for details)" + ) lazy val nativeImage: TaskKey[File] = taskKey[File]( "Generate a native image for this project." ) @@ -92,9 +94,10 @@ object NativeImagePlugin extends AutoPlugin { lazy val nativeImageTestRun: InputKey[Unit] = inputKey[Unit]( "Run the generated native-image binary for tests without linking." ) - lazy val nativeImageTestRunOptions: TaskKey[Seq[String]] = taskKey[Seq[String]]( - "Extra command-line arguments that should be forwarded to the tests." - ) + lazy val nativeImageTestRunOptions: TaskKey[Seq[String]] = + taskKey[Seq[String]]( + "Extra command-line arguments that should be forwarded to the tests." + ) lazy val nativeImageCopy: InputKey[Unit] = inputKey[Unit]( "Link the native image and copy the resulting binary to the provided file argument." ) @@ -107,9 +110,10 @@ object NativeImagePlugin extends AutoPlugin { lazy val nativeImageOptions: TaskKey[Seq[String]] = taskKey[Seq[String]]( "Extra command-line arguments that should be forwarded to the native-image optimizer." ) - lazy val nativeImageTestOptions: TaskKey[Seq[String]] = taskKey[Seq[String]]( - "Extra command-line arguments that should be forwarded to the native-image optimizer." - ) + lazy val nativeImageTestOptions: TaskKey[Seq[String]] = + taskKey[Seq[String]]( + "Extra command-line arguments that should be forwarded to the native-image optimizer." + ) private lazy val assistedConfigurationOfNativeImageBuildsLink = "https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/#assisted-configuration-of-native-image-builds" @@ -138,8 +142,10 @@ object NativeImagePlugin extends AutoPlugin { libraryDependencies += "org.scalameta" % "svm-subs" % "101.0.0", target.in(NativeImage) := target.in(Compile).value / "native-image", target.in(NativeImageTest) := target.in(Test).value / "native-image-test", - target.in(NativeImageInternal) := target.in(Compile).value / "native-image-internal", - target.in(NativeImageTestInternal) := target.in(Test).value / "native-image-test-internal", + target.in(NativeImageInternal) := + target.in(Compile).value / "native-image-internal", + target.in(NativeImageTestInternal) := + target.in(Test).value / "native-image-test-internal", nativeImageReady := { val s = streams.value @@ -371,7 +377,8 @@ object NativeImagePlugin extends AutoPlugin { s"no such file: $binary.\nTo fix this problem, run 'nativeImageTest' first." ) } - val exit = Process(binary.absolutePath :: nativeImageTestRunOptions.value.toList).! + val exit = + Process(binary.absolutePath :: nativeImageTestRunOptions.value.toList).! if (exit != 0) { throw new MessageOnlyException(s"non-zero exit: $exit") }