diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ada425..f082940 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - spark: ["3.1.3","3.2.4", "3.3.4", "3.4.3", "3.5.1"] + spark: ["3.1.3","3.2.4", "3.3.4", "3.4.3", "3.5.3"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -21,6 +21,6 @@ jobs: with: jvm: zulu:8 - name: Test - run: sbt -Dspark.testVersion=${{ matrix.spark }} +test + run: sbt -Dspark.version=${{ matrix.spark }} +test - name: Benchmark - run: sbt -Dspark.testVersion=${{ matrix.spark }} +benchmarks/Jmh/run + run: sbt -Dspark.version=${{ matrix.spark }} +benchmarks/Jmh/run diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b10f4ce --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,18 @@ +name: Release +on: + push: + tags: [ "*" ] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: coursier/setup-action@v1 + with: + jvm: zulu:8 + - run: sbt -Dsun.net.client.defaultReadTimeout=60000 -Dsun.net.client.defaultConnectTimeout=60000 -Dspark.version=3.5.3 -v ci-release + env: + PGP_PASSPHRASE: ${{secrets.PGP_PASSPHRASE}} + PGP_SECRET: ${{secrets.PGP_LONG_ID}} + SONATYPE_PASSWORD: ${{secrets.MAVEN_PASSWORD}} + SONATYPE_USERNAME: ${{secrets.MAVEN_USERNAME}} diff --git a/README.md b/README.md index 543ba23..da14f91 100644 --- a/README.md +++ b/README.md @@ -325,7 +325,7 @@ There is a two step process for publishing. Generate Scala 2.11 JAR files: -* Run `sbt -Dspark.testVersion=2.4.8` +* Run `sbt -Dspark.version=2.4.8` * Run `> ; + publishSigned; sonatypeBundleRelease` to create the JAR files and release them to Maven. Generate Scala 2.12 & Scala 2.13 JAR files: diff --git a/build.sbt b/build.sbt index 34f6ac3..d088c5a 100644 --- a/build.sbt +++ b/build.sbt @@ -1,17 +1,25 @@ +inThisBuild( + List( + organization := "com.github.mrpowers", + homepage := Some(url("https://github.com/mrpowers-io/spark-fast-tests")), + licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")), + developers ++= List( + Developer("MrPowers", "Matthew Powers", "@MrPowers", url("https://github.com/MrPowers")) + ) + ) +) + enablePlugins(GitVersioning) Compile / scalafmtOnCompile := true -organization := "com.github.mrpowers" -name := "spark-fast-tests" - -version := "1.10.1" +name := "spark-fast-tests" val versionRegex = """^(.*)\.(.*)\.(.*)$""".r val scala2_13 = "2.13.14" val scala2_12 = "2.12.20" -val sparkVersion = System.getProperty("spark.testVersion", "3.5.1") +val sparkVersion = System.getProperty("spark.version", "3.5.3") crossScalaVersions := { sparkVersion match { case versionRegex("3", m, _) if m.toInt >= 2 => Seq(scala2_12, scala2_13) @@ -25,20 +33,22 @@ Test / fork := true lazy val commonSettings = Seq( javaOptions ++= { - Seq("-Xms512M", "-Xmx2048M", "-Duser.timezone=GMT") ++ (if (System.getProperty("java.version").startsWith("1.8.0")) - Seq("-XX:+CMSClassUnloadingEnabled") - else Seq.empty) + Seq("-Xms512M", "-Xmx2048M", "-Duser.timezone=GMT") ++ (if (System.getProperty("java.version").startsWith("1.8.0")) + Seq("-XX:+CMSClassUnloadingEnabled") + else Seq.empty) }, libraryDependencies ++= Seq( "org.apache.spark" %% "spark-sql" % sparkVersion % "provided", "org.scalatest" %% "scalatest" % "3.2.18" % "test" - ), + ) ) lazy val core = (project in file("core")) .settings( commonSettings, - name := "core", + name := "core", + Compile / packageSrc / publishArtifact := true, + Compile / packageDoc / publishArtifact := true ) lazy val benchmarks = (project in file("benchmarks")) @@ -46,10 +56,12 @@ lazy val benchmarks = (project in file("benchmarks")) .settings(commonSettings) .settings( libraryDependencies ++= Seq( - "org.openjdk.jmh" % "jmh-generator-annprocess" % "1.37" //required for jmh IDEA plugin. Make sure this version matches sbt-jmh version! + "org.openjdk.jmh" % "jmh-generator-annprocess" % "1.37" // required for jmh IDEA plugin. Make sure this version matches sbt-jmh version! ), - name := "benchmarks", - ).enablePlugins(JmhPlugin) + name := "benchmarks", + publish / skip := true + ) + .enablePlugins(JmhPlugin) lazy val docs = (project in file("docs")) .dependsOn(core) @@ -58,9 +70,8 @@ lazy val docs = (project in file("docs")) name := "docs", laikaTheme := { import laika.ast.Path.Root - import laika.ast.{Image, ExternalTarget} - import laika.helium.config.* import laika.helium.Helium + import laika.helium.config.* Helium.defaults.site .landingPage( @@ -96,26 +107,14 @@ lazy val docs = (project in file("docs")) }, laikaIncludeAPI := true, laikaExtensions ++= { - import laika.format.Markdown import laika.config.SyntaxHighlighting + import laika.format.Markdown Seq(Markdown.GitHubFlavor, SyntaxHighlighting) }, + publish / skip := true, Laika / sourceDirectories := Seq((ThisBuild / baseDirectory).value / "docs") ) -credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credentials") - -licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")) -homepage := Some(url("https://github.com/mrpowers-io/spark-fast-tests")) -developers ++= List( - Developer("MrPowers", "Matthew Powers", "@MrPowers", url("https://github.com/MrPowers")) -) scmInfo := Some(ScmInfo(url("https://github.com/mrpowers-io/spark-fast-tests"), "git@github.com:MrPowers/spark-fast-tests.git")) updateOptions := updateOptions.value.withLatestSnapshots(false) - -publishMavenStyle := true - -publishTo := sonatypePublishToBundle.value - -Global / useGpgPinentry := true \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index a8847c0..a918db6 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -6,7 +6,7 @@ resolvers += Resolver.typesafeRepo("releases") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.1") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0") addSbtPlugin("org.typelevel" % "laika-sbt" % "1.2.0")