Skip to content

Commit

Permalink
Publish packages to sonatype #5780
Browse files Browse the repository at this point in the history
  • Loading branch information
StepanBrychta committed Sep 13, 2024
1 parent 6901b0b commit cf71e14
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
val projectVersion = "32.42.0"
val projectVersion = "32.42.1"

Global / excludeLintKeys += composeNoBuild

Expand Down
36 changes: 29 additions & 7 deletions project/Common.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
import java.io.File
import com.jsuereth.sbtpgp.PgpKeys.*

import java.io.File
import com.tapad.docker.DockerComposePlugin
import sbt.Keys._
import sbt._
import sbt.Keys.*
import sbt.*
import xerial.sbt.Sonatype.autoImport.{sonatypeCredentialHost, sonatypePublishToBundle, sonatypeRepository}

object Common {
def createSettings(projectVersion: String): Seq[Def.Setting[_]] = Seq(
scalaVersion := "2.12.15",
organization := "weco",
organization := "org.wellcomecollection",
homepage := Some(url("https://github.com/wellcomecollection/scala-libs")),
scmInfo := Some(
ScmInfo(
url("https://github.com/wellcomecollection/scala-libs"),
"scm:git:git@github.com:wellcomecollection/scala-libs.git"
)
),
developers ++= List(
Developer(
id = "sbrychta",
name = "Stepan Brychta",
email = "s.brychta@wellcome.org",
url = url("https://github.com/StepanBrychta")
)
),
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
Expand All @@ -22,9 +39,14 @@ object Common {
),
parallelExecution in Test := false,
publishMavenStyle := true,
publishTo := Some(
"S3 releases" at "s3://releases.mvn-repo.wellcomecollection.org/"
),
credentials += Credentials(Path.userHome / ".sbt" / "sonatype.credentials"),
// pgpPublicRing := file(System.getProperty("user.home")) / ".gnupg" / "pubring.kbx",
// pgpSecretRing := file(System.getProperty("user.home")) / ".gnupg" / "secring.gpg",
pgpPassphrase := sys.env.get("PGP_PASSPHRASE").map(_.toCharArray),
sonatypeCredentialHost := "central.sonatype.com",
sonatypeRepository := "https://central.sonatype.com/service/local",
licenses := Seq("MIT" -> url("https://github.com/wellcomecollection/scala-libs/blob/main/LICENSE")),
publishTo := sonatypePublishToBundle.value,
publishArtifact in Test := true,
// Don't build scaladocs
// https://www.scala-sbt.org/sbt-native-packager/formats/universal.html#skip-packagedoc-task-on-stage
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ addSbtPlugin("com.tapad" % "sbt-docker-compose" % "1.0.34")
addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.19.0")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.15")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.3.2")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.1.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.11.2")
addDependencyTreePlugin

0 comments on commit cf71e14

Please sign in to comment.