-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from windymelt/pre-release-prepare
Mavenから使えるようにする準備
- Loading branch information
Showing
8 changed files
with
147 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Release procedure | ||
|
||
``` | ||
% sbt | ||
> project dehydrated | ||
> release skip-tests | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
"[email protected]", | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ThisBuild / version := "0.14.2-SNAPSHOT" | ||
ThisBuild / version := "0.14.2-ALPHA-1" |