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 f2e4a7b
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 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,16 @@ 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") }
)
}

override def sonatypeCentralReadTimeout: T[Int] = 600000
override def sonatypeCentralAwaitTimeout: T[Int] = 1200 * 1000

val sparkDeps = Agg(
ivy"org.apache.spark::spark-core:$sparkVersion",
ivy"org.apache.spark::spark-sql:$sparkVersion",
Expand Down Expand Up @@ -136,16 +150,17 @@ trait SparkModule extends Cross.Module2[String, String] with SbtModule with CiRe
ivy"org.scalamock::scalamock:5.2.0"
)
}

}

val scala213 = "2.13.15"
val scala212 = "2.12.20"
val spark24 = List("2.4.1", "2.4.7", "2.4.8")
val spark30 = List("3.0.1", "3.0.3")
val spark31 = List("3.1.1", "3.1.2", "3.1.3")
val spark24 = List("2.4.8")
val spark30 = List("3.0.3")
val spark31 = List("3.1.3")
val spark32 = List("3.2.4")
val spark33 = List("3.3.4")
val spark34 = List("3.4.1", "3.4.4")
val spark34 = List("3.4.4")
val spark35 = List("3.5.3")
val sparkVersions = spark24 ++ spark30 ++ spark31 ++ spark32 ++ spark33 ++ spark34 ++ spark35
val crossMatrix =
Expand Down

0 comments on commit f2e4a7b

Please sign in to comment.