Skip to content

Commit

Permalink
Merge pull request #69 from ckipp01/prepRelease
Browse files Browse the repository at this point in the history
ci: refactor release procedure
  • Loading branch information
ckipp01 authored May 5, 2023
2 parents 321e62c + 631751e commit 40a86b2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 22 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
39 changes: 23 additions & 16 deletions plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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`."
)
Expand All @@ -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."
)
Expand All @@ -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."
)
Expand All @@ -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"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down

0 comments on commit 40a86b2

Please sign in to comment.