Skip to content

Commit

Permalink
Update build config to release
Browse files Browse the repository at this point in the history
  • Loading branch information
makiftutuncu committed May 8, 2024
1 parent 69b8103 commit 14c4a77
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ developers := List(developer)
// === Project Settings ===
scalaVersion := "3.4.1"
javacOptions ++= Seq("-source", "21")
ThisBuild / versionScheme := Some("semver-spec")

// === Project Dependencies ===
val e = "dev.akif" %% "e-scala" % "3.0.0"
Expand All @@ -27,6 +28,7 @@ libraryDependencies ++= Seq(e, munit)

// === Release Settings ===

import com.jsuereth.sbtpgp.PgpKeys.publishSigned
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations.*

Compile / doc / scalacOptions ++= Seq("-snippet-compiler:compile")
Expand All @@ -37,15 +39,25 @@ Compile / packageDoc / publishArtifact := true
Test / packageBin / publishArtifact := false
Test / packageSrc / publishArtifact := false
Test / packageDoc / publishArtifact := false
releasePublishArtifactsAction := publishSigned.value

val sonatypeUser = sys.env.getOrElse("SONATYPE_USER", "")
val sonatypePass = sys.env.getOrElse("SONATYPE_PASS", "")

ThisBuild / credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", sonatypeUser, sonatypePass)
ThisBuild / credentials ++= Seq(
Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
sonatypeUser,
sonatypePass
)
)
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / publishMavenStyle := true
ThisBuild / publishTo := Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")

usePgpKeyHex("3D5A9AE9F71508A0D85E78DF877A4F41752BB3B5")

val checkPublishCredentials = ReleaseStep { state =>
if (sonatypeUser.isEmpty || sonatypePass.isEmpty) {
throw new Exception(
Expand All @@ -56,8 +68,6 @@ val checkPublishCredentials = ReleaseStep { state =>
state
}

usePgpKeyHex("3D5A9AE9F71508A0D85E78DF877A4F41752BB3B5")

releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
checkPublishCredentials,
Expand Down

0 comments on commit 14c4a77

Please sign in to comment.