diff --git a/.mill-version b/.mill-version index 34a83616..aa22d3ce 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.12.1 +0.12.3 diff --git a/build.mill b/build.mill index b3d533b7..4911998e 100644 --- a/build.mill +++ b/build.mill @@ -1,10 +1,12 @@ -import $ivy.`io.chris-kipp::mill-ci-release::0.1.10` -import io.kipp.mill.ci.release.CiReleaseModule import coursier.maven.MavenRepository import mill._, scalalib._, publish._ import Assembly._ +import $ivy.`com.lihaoyi::mill-contrib-sonatypecentral:` +import mill.contrib.sonatypecentral.SonatypeCentralPublishModule +import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0` +import de.tobiasroeser.mill.vcs.version.VcsVersion -trait SparkModule extends Cross.Module2[String, String] with SbtModule with CiReleaseModule { +trait SparkModule extends Cross.Module2[String, String] with SbtModule with SonatypeCentralPublishModule { outer => override def scalaVersion = crossValue val sparkVersion = crossValue2 @@ -50,8 +52,10 @@ trait SparkModule extends Cross.Module2[String, String] with SbtModule with CiRe override def artifactName = "spark-excel" - override def publishVersion = s"${sparkVersion}_${super.publishVersion()}" - + override def publishVersion: T[String] = T { + val vcsVersion = VcsVersion.vcsState().format(untaggedSuffix = "-SNAPSHOT") + s"${sparkVersion}_${vcsVersion}" + } def pomSettings = PomSettings( description = "A Spark plugin for reading and writing Excel files", organization = "dev.mauch", @@ -69,6 +73,13 @@ trait SparkModule extends Cross.Module2[String, String] with SbtModule with CiRe override def extraPublish = Seq(PublishInfo(assembly(), classifier = None, ivyConfig = "compile")) + def publishArtifacts: T[PublishModule.PublishData] = Task { + val publishData = super.publishArtifacts() + publishData.copy( + payload = publishData.payload.filterNot { case (ref, name) => ref.toString.contains("jar.dest") } + ) + } + val sparkDeps = Agg( ivy"org.apache.spark::spark-core:$sparkVersion", ivy"org.apache.spark::spark-sql:$sparkVersion", @@ -136,6 +147,8 @@ trait SparkModule extends Cross.Module2[String, String] with SbtModule with CiRe ivy"org.scalamock::scalamock:5.2.0" ) } + + override def sonatypeCentralShouldRelease = T(true) } val scala213 = "2.13.15"