Skip to content

Commit

Permalink
Refactor build & publish
Browse files Browse the repository at this point in the history
  • Loading branch information
dacr committed Oct 6, 2024
1 parent fe79385 commit d22f85b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
22 changes: 13 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
organization := "fr.janalyse"
name := "zio-lmdb"
homepage := Some(new URL("https://github.com/dacr/zio-lmdb"))
organization := "fr.janalyse"
description := "Lightning Memory Database (LMDB) for scala ZIO"

licenses += "NON-AI-APACHE2" -> url(s"https://github.com/non-ai-licenses/non-ai-licenses/blob/main/NON-AI-APACHE2")

scmInfo := Some(
ScmInfo(
url(s"https://github.com/dacr/zio-lmdb.git"),
s"git@github.com:dacr/zio-lmdb.git"
)
)

scalaVersion := "3.5.1"
crossScalaVersions := Seq("2.13.15", "3.5.1")

Expand Down Expand Up @@ -43,3 +36,14 @@ excludeDependencies += "org.scala-lang.modules" % "scala-collection-compat_2.13"

ThisBuild / fork := true
ThisBuild / javaOptions ++= Seq("--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED")

homepage := Some(new URL("https://github.com/dacr/zio-lmdb"))
scmInfo := Some(ScmInfo(url(s"https://github.com/dacr/zio-lmdb.git"), s"git@github.com:dacr/zio-lmdb.git"))
developers := List(
Developer(
id = "dacr",
name = "David Crosson",
email = "crosson.david@gmail.com",
url = url("https://github.com/dacr")
)
)
39 changes: 17 additions & 22 deletions publish.sbt
Original file line number Diff line number Diff line change
@@ -1,40 +1,35 @@
pomIncludeRepository := { _ => false }

releaseCrossBuild := true
releasePublishArtifactsAction := PgpKeys.publishSigned.value
publishMavenStyle := true
pomIncludeRepository := { _ => false }
publishMavenStyle := true
Test / publishArtifact := false
publishTo := Some(if (isSnapshot.value) Opts.resolver.sonatypeOssSnapshots.head else Opts.resolver.sonatypeStaging)
releaseCrossBuild := true
versionScheme := Some("semver-spec")

Global / PgpKeys.useGpg := true // workaround with pgp and sbt 1.2.x
pgpSecretRing := pgpPublicRing.value // workaround with pgp and sbt 1.2.x

pomExtra in Global := {
<developers>
<developer>
<id>dacr</id>
<name>David Crosson</name>
<url>https://github.com/dacr</url>
</developer>
</developers>
publishTo := {
// For accounts created after Feb 2021:
// val nexus = "https://s01.oss.sonatype.org/"
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}

releaseTagComment := s"Releasing ${(ThisBuild / version).value}"
releaseCommitMessage := s"Setting version to ${(ThisBuild / version).value}"
releasePublishArtifactsAction := PgpKeys.publishSigned.value

releaseTagComment := s"Releasing ${(ThisBuild / version).value}"
releaseCommitMessage := s"Setting version to ${(ThisBuild / version).value}"
releaseNextCommitMessage := s"[ci skip] Setting version to ${(ThisBuild / version).value}"

import ReleaseTransformations._
import ReleaseTransformations.*
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
//runClean,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
releaseStepCommand("sonatypeReleaseAll"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges
)

0 comments on commit d22f85b

Please sign in to comment.