Skip to content

Commit 54266c1

Browse files
committed
Upgrade sbt-sonatype, sbt-pgp
The new sbt-sonatype adds a command to publish all modules in one step (`sonatypeBundleRelease`) which should avoid getting into inconsistent states (#7190, #6922).
1 parent 32b845a commit 54266c1

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

.drone.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ steps:
107107
- test_sbt
108108
- test_java11
109109
commands:
110-
- ./project/scripts/sbtPublish ";dotty-bootstrapped/publishSigned ;sonatypeRelease"
110+
- ./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease"
111111
environment:
112112
NIGHTLYBUILD: yes
113113
PGP_PW:
@@ -135,7 +135,7 @@ steps:
135135
- test_java11
136136
commands:
137137
- ./project/scripts/sbt dist-bootstrapped/packArchive
138-
- ./project/scripts/sbtPublish ";dotty-bootstrapped/publishSigned ;sonatypeRelease"
138+
- ./project/scripts/sbtPublish ";project dotty-bootstrapped ;publishSigned ;sonatypeBundleRelease"
139139
environment:
140140
PGP_PW:
141141
from_secret: pgp_pw
@@ -177,7 +177,7 @@ steps:
177177
- test_sbt
178178
- test_java11
179179
commands:
180-
- ./project/scripts/sbtPublish ";sbt-dotty/publishSigned ;sonatypeRelease"
180+
- ./project/scripts/sbtPublish ";project sbt-dotty ;publishSigned ;sonatypeBundleRelease"
181181
environment:
182182
PGP_PW:
183183
from_secret: pgp_pw

project/Build.scala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import sbt.plugins.SbtPlugin
1313
import sbt.ScriptedPlugin.autoImport._
1414
import xerial.sbt.pack.PackPlugin
1515
import xerial.sbt.pack.PackPlugin.autoImport._
16+
import xerial.sbt.Sonatype.autoImport._
1617

1718
import dotty.tools.sbtplugin.DottyPlugin.autoImport._
1819
import dotty.tools.sbtplugin.DottyPlugin.makeScalaInstance
@@ -198,7 +199,8 @@ object Build {
198199
password <- sys.env.get("SONATYPE_PW")
199200
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)
200201
).toList,
201-
PgpKeys.pgpPassphrase := sys.env.get("PGP_PW").map(_.toCharArray())
202+
PgpKeys.pgpPassphrase := sys.env.get("PGP_PW").map(_.toCharArray()),
203+
PgpKeys.useGpgPinentry := true,
202204
)
203205

204206
lazy val commonSettings = publishSettings ++ Seq(
@@ -1150,12 +1152,7 @@ object Build {
11501152
lazy val publishSettings = Seq(
11511153
publishMavenStyle := true,
11521154
isSnapshot := version.value.contains("SNAPSHOT"),
1153-
publishTo := Some(
1154-
if (isSnapshot.value)
1155-
Opts.resolver.sonatypeSnapshots
1156-
else
1157-
Opts.resolver.sonatypeStaging
1158-
),
1155+
publishTo := sonatypePublishToBundle.value,
11591156
publishArtifact in Test := false,
11601157
homepage := Some(url(dottyGithubUrl)),
11611158
licenses += ("BSD New",

project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0-M8")
66

7-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.1")
7+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.6")
88

9-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
9+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0-M2")
1010

1111
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.10.1")
1212

project/scripts/sbtPublish

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ if [ ! "$NIGHTLYBUILD" = "yes" ] && [ ! "$RELEASEBUILD" = "yes" ]; then
1818
exit 1
1919
fi
2020

21-
# Write down PGP secret key to the location expected by sbt-pgp
22-
mkdir -p "$HOME/.sbt/gpg"
23-
echo "$PGP_SECRET" > "$HOME/.sbt/gpg/secring.asc"
21+
# Setup gpg
22+
export GPG_TTY="$(tty)"
23+
echo "$PGP_SECRET" | gpg --batch --import
2424

2525
# run sbt with the supplied arg
2626
SBT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/sbt"

0 commit comments

Comments
 (0)