diff --git a/README.md b/README.md index 59280cc..c52dae2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# voicevoxcore4s +# voicevoxcore4s [![Latest version](https://index.scala-lang.org/windymelt/voicevoxcore4s/voicevoxcore4s/latest.svg)](https://index.scala-lang.org/windymelt/voicevoxcore4s/voicevoxcore4s) + Scala wrapper for [VOICEVOX Core](https://github.com/VOICEVOX/voicevox_core) Currently this binding supports [VOICEVOX Core v0.14.1](https://github.com/VOICEVOX/voicevox_core/tree/0.14.1). @@ -394,4 +395,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* ----------------------------------------------------------------- */ -``` \ No newline at end of file +``` diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..f84fa0a --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,7 @@ +# Release procedure + +``` +% sbt +> project dehydrated +> release skip-tests +``` diff --git a/build.sbt b/build.sbt index e09572f..5de4759 100644 --- a/build.sbt +++ b/build.sbt @@ -1,11 +1,37 @@ import Dependencies._ import ReleaseTransformations._ -ThisBuild / scalaVersion := "2.13.8" -ThisBuild / organization := "com.github.windymelt" +import xerial.sbt.Sonatype.sonatypeCentralHost + +ThisBuild / publishTo := sonatypePublishToBundle.value +ThisBuild / sonatypeCredentialHost := sonatypeCentralHost + +ThisBuild / scalaVersion := "2.13.13" +ThisBuild / organization := "dev.capslock" ThisBuild / organizationName := "windymelt" +ThisBuild / startYear := Some(2024) +ThisBuild / licenses += License.MIT +ThisBuild / homepage := Some( + url( + "https://github.com/windymelt/scala-new-maven-central-exercise" + ) +) +ThisBuild / scmInfo := Some( + ScmInfo( + url("https://github.com/windymelt/scala-new-maven-central-exercise"), + "https://github.com/windymelt/scala-new-maven-central-exercise.git" + ) +) +ThisBuild / developers += Developer( + "windymelt", + "windymelt", + "windymelt@3qe.us", + url("https://www.3qe.us/") +) +releasePublishArtifactsAction := PgpKeys.publishSigned.value -lazy val downloadCore = taskKey[Unit]("Download libcore zip and extract it ./voicevox_core-*") +lazy val downloadCore = + taskKey[Unit]("Download libcore zip and extract it ./voicevox_core-*") Compile / compile := (Compile / compile).dependsOn(downloadCore).value @@ -18,47 +44,112 @@ lazy val common = project "net.java.dev.jna" % "jna" % "5.12.1", "net.java.dev.jna" % "jna-platform" % "5.12.1", "com.lihaoyi" %% "os-lib" % "0.7.2", // for extracting resources - "com.typesafe.scala-logging" %% "scala-logging" % "3.9.4", // wrapper for SLF4J + "com.typesafe.scala-logging" %% "scala-logging" % "3.9.4" // wrapper for SLF4J + ) + ) + +lazy val dehydrated = (project in file(".")) + .settings( + name := "voicevoxcore4s", + buildInfoKeys := Seq[BuildInfoKey]( + "libcoreFile" -> "you don't need to extract library", + "libonnxFile" -> "you don't need to extract library" + ), + libraryDependencies ++= Seq( + "net.java.dev.jna" % "jna" % "5.12.1", + "net.java.dev.jna" % "jna-platform" % "5.12.1", + "com.lihaoyi" %% "os-lib" % "0.7.2", // for extracting resources + "com.typesafe.scala-logging" %% "scala-logging" % "3.9.4" // wrapper for SLF4J ), + libraryDependencies ++= Seq( + scalaTest % Test + ), + downloadCore := {}, + Compile / unmanagedResourceDirectories ++= { + Seq( + baseDirectory.value / "open_jtalk_dic_utf_8-1.11" // 辞書はリソースに含める + ) + } + ) + .enablePlugins(BuildInfoPlugin) + .settings( + releaseProcess := Seq[ReleaseStep]( + checkSnapshotDependencies, // : ReleaseStep + inquireVersions, // : ReleaseStep + runClean, // : ReleaseStep + runTest, // : ReleaseStep + setReleaseVersion, // : ReleaseStep + commitReleaseVersion, // : ReleaseStep, performs the initial git checks + tagRelease, // : ReleaseStep + releaseStepCommand("publishSigned"), + releaseStepCommand("sonatypeBundleRelease"), + releaseStepTask(assembly), + setNextVersion, // : ReleaseStep + commitNextVersion, // : ReleaseStep + pushChanges // : ReleaseStep, also checks that an upstream branch is properly configured + ) ) -lazy val x8664linuxcpu = (project in file(".")).settings( - name := "voicevoxcore4s-linux-x64-cpu", - buildInfoKeys := Seq[BuildInfoKey]("libcoreFile" -> "libvoicevox_core.so", "libonnxFile" -> "libonnxruntime.so.1.13.1"), - libraryDependencies ++= Seq( - scalaTest % Test, - ), - downloadCore := { - if(java.nio.file.Files.notExists(new File("voicevox_core-linux-x64-cpu-0.14.1").toPath())) { +// We don't provide Maven Central artifact for this build config due to huge size of library. +lazy val x8664linuxcpu = (project in file(".")) + .settings( + name := "voicevoxcore4s-linux-x64-cpu", + buildInfoKeys := Seq[BuildInfoKey]( + "libcoreFile" -> "libvoicevox_core.so", + "libonnxFile" -> "libonnxruntime.so.1.13.1" + ), + libraryDependencies ++= Seq( + scalaTest % Test + ), + downloadCore := { + if ( + java.nio.file.Files + .notExists(new File("voicevox_core-linux-x64-cpu-0.14.1").toPath()) + ) { println("[libcore] Path does not exist, downloading...") - IO.unzipURL(new URL("https://github.com/VOICEVOX/voicevox_core/releases/download/0.14.1/voicevox_core-linux-x64-cpu-0.14.1.zip"), new File("voicevox_core-linux-x64-cpu-0.14.1")) - } else { + IO.unzipURL( + new URL( + "https://github.com/VOICEVOX/voicevox_core/releases/download/0.14.1/voicevox_core-linux-x64-cpu-0.14.1.zip" + ), + new File("voicevox_core-linux-x64-cpu-0.14.1") + ) + } else { println("[libcore] Path exists, no need to download.") + } + }, + Compile / unmanagedResourceDirectories ++= { + Seq( + baseDirectory.value / "open_jtalk_dic_utf_8-1.11", + baseDirectory.value / "voicevox_core-linux-x64-cpu-0.14.1/voicevox_core-linux-x64-cpu-0.14.1/model" + ) + }, + Compile / unmanagedResources ++= { + Seq( + file( + "voicevox_core-linux-x64-cpu-0.14.1/voicevox_core-linux-x64-cpu-0.14.1/libvoicevox_core.so" + ), + file( + "voicevox_core-linux-x64-cpu-0.14.1/voicevox_core-linux-x64-cpu-0.14.1/libonnxruntime.so.1.13.1" + ) + ) } - }, - Compile / unmanagedResourceDirectories ++= { Seq( - baseDirectory.value / "open_jtalk_dic_utf_8-1.11", - baseDirectory.value / "voicevox_core-linux-x64-cpu-0.14.1/voicevox_core-linux-x64-cpu-0.14.1/model" -)}, - Compile / unmanagedResources ++= { Seq( - file("voicevox_core-linux-x64-cpu-0.14.1/voicevox_core-linux-x64-cpu-0.14.1/libvoicevox_core.so"), - file("voicevox_core-linux-x64-cpu-0.14.1/voicevox_core-linux-x64-cpu-0.14.1/libonnxruntime.so.1.13.1"), - ) }, -).dependsOn(common).enablePlugins(BuildInfoPlugin) -.settings( + ) + .dependsOn(common) + .enablePlugins(BuildInfoPlugin) + .settings( releaseProcess := Seq[ReleaseStep]( - checkSnapshotDependencies, // : ReleaseStep - inquireVersions, // : ReleaseStep - runClean, // : ReleaseStep - runTest, // : ReleaseStep - setReleaseVersion, // : ReleaseStep - commitReleaseVersion, // : ReleaseStep, performs the initial git checks - tagRelease, // : ReleaseStep + checkSnapshotDependencies, // : ReleaseStep + inquireVersions, // : ReleaseStep + runClean, // : ReleaseStep + runTest, // : ReleaseStep + setReleaseVersion, // : ReleaseStep + commitReleaseVersion, // : ReleaseStep, performs the initial git checks + tagRelease, // : ReleaseStep // publishArtifacts, // : ReleaseStep, checks whether `publishTo` is properly set up releaseStepTask(assembly), - setNextVersion, // : ReleaseStep - commitNextVersion, // : ReleaseStep - pushChanges // : ReleaseStep, also checks that an upstream branch is properly configured + setNextVersion, // : ReleaseStep + commitNextVersion, // : ReleaseStep + pushChanges // : ReleaseStep, also checks that an upstream branch is properly configured ) ) // See https://www.scala-sbt.org/1.x/docs/Using-Sonatype.html for instructions on how to publish to Sonatype. diff --git a/project/metals.sbt b/project/metals.sbt index 05fd2b3..119c929 100644 --- a/project/metals.sbt +++ b/project/metals.sbt @@ -2,5 +2,5 @@ // This file enables sbt-bloop to create bloop config files. -addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.6") +addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.15") diff --git a/project/plugins.sbt b/project/plugins.sbt index 179fec6..fc13d76 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,3 +3,10 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.0") addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0") + +addSbtPlugin( + "org.xerial.sbt" % "sbt-sonatype" % "0.0.0-734-5b5db727" +) // CAVEAT: Due to incapability with latest sbt-sonatype, use local built one +// cf. https://github.com/xerial/sbt-sonatype/issues/465 + +addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") diff --git a/project/project/metals.sbt b/project/project/metals.sbt index 05fd2b3..119c929 100644 --- a/project/project/metals.sbt +++ b/project/project/metals.sbt @@ -2,5 +2,5 @@ // This file enables sbt-bloop to create bloop config files. -addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.6") +addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.15") diff --git a/project/project/project/metals.sbt b/project/project/project/metals.sbt index 05fd2b3..119c929 100644 --- a/project/project/project/metals.sbt +++ b/project/project/project/metals.sbt @@ -2,5 +2,5 @@ // This file enables sbt-bloop to create bloop config files. -addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.6") +addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.15") diff --git a/version.sbt b/version.sbt index bc026f3..4e06fa1 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "0.14.2-SNAPSHOT" +ThisBuild / version := "0.14.2-ALPHA-1"