diff --git a/build.sbt b/build.sbt index a7bb4f9f..53c3b1bd 100755 --- a/build.sbt +++ b/build.sbt @@ -10,9 +10,6 @@ spName := "databricks/spark-xml" crossScalaVersions := Seq("2.11.12", "2.12.8") -// Necessary for JUnit tests to be found? -crossPaths := false - scalacOptions := Seq("-unchecked", "-deprecation") sparkVersion := sys.props.get("spark.testVersion").getOrElse("2.4.0") @@ -61,6 +58,18 @@ pomExtra := +publishTo := { + val nexus = "https://oss.sonatype.org/" + if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots") + else Some("releases" at nexus + "service/local/staging/deploy/maven2") +} + +credentials += Credentials( + "Sonatype Nexus Repository Manager", + "oss.sonatype.org", + sys.env.get("USERNAME").getOrElse(""), + sys.env.get("PASSWORD").getOrElse("")) + parallelExecution in Test := false // Skip tests during assembly diff --git a/dev/make-release.sh b/dev/make-release.sh new file mode 100755 index 00000000..b01bd162 --- /dev/null +++ b/dev/make-release.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# Release process: +# +# 1. Making a release requires PGP signing. Please make sure you generated a key. +# See https://www.scala-sbt.org/sbt-pgp/usage.html +# +# 2. Make sure your key is uploaded to one of keyservers. For instance, it is required to +# run 'sbt "pgp-cmd receive-key hkp://keyserver.ubuntu.com"'. +# See https://www.scala-sbt.org/sbt-pgp/usage.html +# +# 3. You should have an access to Databricks domain. This is typically +# requested by JIRA in Sonatype per individual. +# See https://issues.sonatype.org/browse/OSSRH-19509 +# +# 4. Run this script, for instance, as below: +# 'USERNAME=username PASSWORD=password dev/make-release.sh' +# USERNAME and PASSWORD are the user name and password for Sonatype Nexsus Repository Manager. +# +# 5. After pushing the artifect to staging repogitory by running this script, you can manually +# release it in https://oss.sonatype.org. +# See also https://www.scala-sbt.org/1.x/docs/Using-Sonatype.html + +if [[ -z "${USERNAME}" ]]; then + echo "'USERNAME' environment varible for 'Sonatype Nexus Repository Manager' is undefiend." + exit 1 +fi + +if [[ -z "${PASSWORD}" ]]; then + echo "'PASSWORD' environment varible for 'Sonatype Nexus Repository Manager' is undefiend." + exit 1 +fi + +sbt clean "+ publishSigned"