cross-build artifacts being built but not with `releaseCrossBuild := true`

466 views Asked by At

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.

1

There are 1 answers

4
Dale Wijnand On

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.