Skip to content

Commit af2329f

Browse files
committed
publish to sonatype central
1 parent bf81d2c commit af2329f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ jobs:
175175
- env:
176176
CI_SNAPSHOT_RELEASE: +publishSigned
177177
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
178-
SONATYPE_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
179-
SONATYPE_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
178+
SONATYPE_PASSWORD: ${{ secrets.CENTRAL_DEPLOY_PASSWORD }}
179+
SONATYPE_USERNAME: ${{ secrets.CENTRAL_DEPLOY_USERNAME }}
180180
PGP_SECRET: ${{ secrets.PGP_SECRET }}
181181
run: sbt -J-Xmx2G ci-release

build.sbt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import com.github.sbt.sbom._
22
import com.typesafe.tools.mima.core._
33
import sbtghactions.JavaSpec.Distribution.Zulu
4+
import xerial.sbt.Sonatype.sonatypeCentralHost
45

56
// Basic facts
67
name := "jackson-module-scala"
@@ -12,7 +13,17 @@ ThisBuild / scalaVersion := scala213Version
1213

1314
ThisBuild / crossScalaVersions := Seq("2.11.12", "2.12.20", scala213Version, "3.3.6")
1415

16+
ThisBuild / sonatypeCredentialHost := sonatypeCentralHost
17+
1518
resolvers ++= Resolver.sonatypeOssRepos("snapshots")
19+
resolvers += "Sonatype Central Snapshots" at "https://central.sonatype.com/repository/maven-snapshots"
20+
21+
ThisBuild / dynverSonatypeSnapshots := true
22+
ThisBuild / publishTo := {
23+
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
24+
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
25+
else localStaging.value
26+
}
1627

1728
publishTo := sonatypePublishToBundle.value
1829

@@ -169,8 +180,8 @@ ThisBuild / githubWorkflowPublish := Seq(
169180
env = Map(
170181
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
171182
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
172-
"SONATYPE_PASSWORD" -> "${{ secrets.CI_DEPLOY_PASSWORD }}",
173-
"SONATYPE_USERNAME" -> "${{ secrets.CI_DEPLOY_USERNAME }}",
183+
"SONATYPE_PASSWORD" -> "${{ secrets.CENTRAL_DEPLOY_PASSWORD }}",
184+
"SONATYPE_USERNAME" -> "${{ secrets.CENTRAL_DEPLOY_USERNAME }}",
174185
"CI_SNAPSHOT_RELEASE" -> "+publishSigned"
175186
)
176187
)

0 commit comments

Comments
 (0)