1

I'm trying to release a version of https://github.com/guardian/marley cross-built for Scala v2.11 & v2.12. All code dependencies are satisfied, and both +test and +publishLocalSigned work as expected, the latter definitely producing artifacts for Scala v2.11 & v2.12. Unfortunately, executing sbt release with the sbt-sonatype plugin only uploads artifacts for Scala v2.12 - it makes no attempt to upload artifacts for Scala v2.11 to the sonatype staging repository.

Here are the relevant sbt settings from the build.sbt file (full version in the repo on GitHub):

scalaVersion in ThisBuild := "2.12.4"

crossScalaVersions in ThisBuild := Seq(scalaVersion.value, "2.11.12")

import ReleaseTransformations._

releaseCrossBuild := true // true if you cross-build the project for multiple Scala versions
releaseProcess := Seq[ReleaseStep](
  checkSnapshotDependencies,
  inquireVersions,
  runClean,
  runTest,
  setReleaseVersion,
  commitReleaseVersion,
  tagRelease,
  releaseStepCommand("publishSigned"),
  setNextVersion,
  commitNextVersion,
  releaseStepCommand("sonatypeReleaseAll"),
  pushChanges
)

Here's a full copy of the sbt release command output: https://gist.github.com/rtyley/5f9f832fabe2bdcfc2d561a36c29f993 - you can see that even though [info] Setting scala version to 2.11.12 occurs (twice) - only Scala 2.12 artifacts are uploaded.

Roberto Tyley
  • 24,513
  • 11
  • 72
  • 101

1 Answers1

0

I think the issue is the releaseStepCommand("publishSigned") in your release process.

I think either:

  • it needs to be releaseStepCommand("+publishSigned"); or
  • you need to instead set releasePublishArtifactsAction := PgpKeys.publishSigned.value, and switch back to publishArtifacts (instead of using releaseStepCommand)

The README documents the releasePublishArtifactsAction way.

Dale Wijnand
  • 6,054
  • 5
  • 28
  • 55
  • Thanks for responding Dale! Unfortunately no luck... I tried `releaseStepCommand("+publishSigned")` with https://github.com/guardian/marley/commit/d4f62deee (crashed out with `No staging repository is found. Do publishSigned first.`...!?) and also `releasePublishArtifactsAction := PgpKeys.publishSigned.value` which seemed to make no difference - the Scala 2.12 artifacts were already being signed before, and `releasePublishArtifactsAction` (https://github.com/guardian/marley/commit/98b7bf77) didn't change the the fact that the Scala 2.11 artifacts weren't being uploaded... :( – Roberto Tyley Feb 09 '18 at 13:58
  • @RobertoTyley try `releasePublishArtifactsAction := PgpKeys.publishSigned.value` again, but switch back to `publishArtifacts` instead of `releaseStepCommand`. – Dale Wijnand Feb 09 '18 at 17:15
  • 1
    How about using `releaseStepCommandAndRemaining("+publishSigned")` ? – leo Feb 09 '18 at 17:45
  • Yes, @leo! That makes sense now that you mention it. – Dale Wijnand Feb 10 '18 at 07:56