Skip to content

Commit a292a39

Browse files
Copilotalexandru
andauthored
Fix Maven Central publishing: add missing sbt-sonatype plugin (#23)
* Initial plan * Add sbt-sonatype plugin and configure for Maven Central publishing Co-authored-by: alexandru <11753+alexandru@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alexandru <11753+alexandru@users.noreply.github.com>
1 parent 75e02d1 commit a292a39

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

build.sbt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import java.io.FileInputStream
22
import java.util.Properties
33
import sbt.ThisBuild
44
import scala.sys.process.Process
5+
import xerial.sbt.Sonatype.sonatypeCentralHost
56

67
val scala3Version = "3.3.7"
78
val scala2Version = "2.13.18"
@@ -16,6 +17,8 @@ inThisBuild(
1617
Seq(
1718
organization := "org.funfix",
1819
scalaVersion := scala2Version,
20+
// Configure for Sonatype Central Portal
21+
sonatypeCredentialHost := sonatypeCentralHost,
1922
// ---
2023
// Settings for dealing with the local Gradle-assembled artifacts
2124
// Also see: publishLocalGradleDependencies
@@ -102,7 +105,7 @@ val sharedSettings = Seq(
102105
publishTo := {
103106
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
104107
if (version.value.endsWith("-SNAPSHOT")) Some("central-snapshots".at(centralSnapshots))
105-
else localStaging.value
108+
else sonatypePublishToBundle.value
106109
},
107110

108111
// ScalaDoc settings
@@ -179,5 +182,5 @@ addCommandAlias(
179182
)
180183
addCommandAlias(
181184
"ci-publish",
182-
";publishLocalGradleDependencies; +Test/compile; +publishSigned; sonaUpload"
185+
";publishLocalGradleDependencies; +Test/compile; +publishSigned; sonatypeBundleRelease"
183186
)

project/plugins.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.6")
22
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.2")
33
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "3.5.5")
44
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
5+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2")
56

67
// https://github.com/typelevel/sbt-tpolecat/issues/291
78
libraryDependencies += "org.typelevel" %% "scalac-options" % "0.1.9"

0 commit comments

Comments
 (0)