Skip to content

Commit

Permalink
build: Fix Sonatype Central publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
nightscape committed Dec 4, 2024
1 parent 09ae1ae commit c1f2b5e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .mill-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.1
0.12.3
23 changes: 18 additions & 5 deletions build.mill
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit c1f2b5e

Please sign in to comment.