From ee1691aec62e879654820b18bfdccab30600ccac Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sun, 13 Oct 2024 19:56:06 +1100 Subject: [PATCH 01/11] Enable generation of src and doc jar on publish --- build.sbt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.sbt b/build.sbt index 34f6ac3..e357a08 100644 --- a/build.sbt +++ b/build.sbt @@ -39,6 +39,8 @@ lazy val core = (project in file("core")) .settings( commonSettings, name := "core", + Compile / packageSrc / publishArtifact := true, + Compile / packageDoc / publishArtifact := true ) lazy val benchmarks = (project in file("benchmarks")) From 1f0988205cf0fbaae87b8d954731bee7196279af Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sun, 13 Oct 2024 21:47:06 +1100 Subject: [PATCH 02/11] simple release workflow --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 25 +++++++++++++++++++++++++ README.md | 2 +- build.sbt | 2 +- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ada425..2563353 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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..51f611c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release +on: + push: + tags: ["*"] +jobs: + publish: + strategy: + fail-fast: false + matrix: + spark: [ "3.1.3", "3.2.4", "3.3.4", "3.4.3", "3.5.1" ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: coursier/cache-action@v6 + with: + extraKey: ${{ matrix.spark }} + - uses: coursier/setup-action@v1 + with: + jvm: zulu:8 + - run: sbt ci-release -Dspark.version=${{ matrix.spark }} + env: + PGP_PASSPHRASE: ${{secrets.PGP_PASSPHRASE}} + PGP_SECRET: ${{secrets.PGP_SECRET}} + SONATYPE_PASSWORD: ${{secrets.SONATYPE_PASSWORD}} + SONATYPE_USERNAME: ${{secrets.SONATYPE_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 e357a08..23cbc5a 100644 --- a/build.sbt +++ b/build.sbt @@ -11,7 +11,7 @@ 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.1") crossScalaVersions := { sparkVersion match { case versionRegex("3", m, _) if m.toInt >= 2 => Seq(scala2_12, scala2_13) From 4b4cfb343f8044a30ad134cc8c366d3d5a07244a Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Tue, 15 Oct 2024 23:04:21 +1100 Subject: [PATCH 03/11] run CI with single spark version --- .github/workflows/release.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51f611c..c53d5c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,10 +4,6 @@ on: tags: ["*"] jobs: publish: - strategy: - fail-fast: false - matrix: - spark: [ "3.1.3", "3.2.4", "3.3.4", "3.4.3", "3.5.1" ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,7 +13,7 @@ jobs: - uses: coursier/setup-action@v1 with: jvm: zulu:8 - - run: sbt ci-release -Dspark.version=${{ matrix.spark }} + - run: sbt ci-release -Dspark.version=3.5.3 env: PGP_PASSPHRASE: ${{secrets.PGP_PASSPHRASE}} PGP_SECRET: ${{secrets.PGP_SECRET}} From ffc68e985108cba55616ff0df85f756a7b1a355d Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Tue, 15 Oct 2024 23:14:53 +1100 Subject: [PATCH 04/11] Test with spark 3.5.3 --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 3 --- build.sbt | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2563353..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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c53d5c1..9596338 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,9 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: coursier/cache-action@v6 - with: - extraKey: ${{ matrix.spark }} - uses: coursier/setup-action@v1 with: jvm: zulu:8 diff --git a/build.sbt b/build.sbt index 23cbc5a..5f3e5cc 100644 --- a/build.sbt +++ b/build.sbt @@ -11,7 +11,7 @@ val versionRegex = """^(.*)\.(.*)\.(.*)$""".r val scala2_13 = "2.13.14" val scala2_12 = "2.12.20" -val sparkVersion = System.getProperty("spark.version", "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) From e7174249615aa09bcce24419f11554c533b998a6 Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sun, 3 Nov 2024 17:07:28 +1100 Subject: [PATCH 05/11] Release setting for newer sonaType account --- build.sbt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 5f3e5cc..e6729bb 100644 --- a/build.sbt +++ b/build.sbt @@ -120,4 +120,7 @@ publishMavenStyle := true publishTo := sonatypePublishToBundle.value -Global / useGpgPinentry := true \ No newline at end of file +Global / useGpgPinentry := true + +ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" +sonatypeRepository := "https://s01.oss.sonatype.org/service/local" \ No newline at end of file From 8f669624fbc66dfa2630ce9531cb680bccb4bfad Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sun, 3 Nov 2024 17:23:15 +1100 Subject: [PATCH 06/11] Remove manual sbt-release setting --- build.sbt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/build.sbt b/build.sbt index e6729bb..2fe3e9b 100644 --- a/build.sbt +++ b/build.sbt @@ -4,8 +4,6 @@ Compile / scalafmtOnCompile := true organization := "com.github.mrpowers" name := "spark-fast-tests" -version := "1.10.1" - val versionRegex = """^(.*)\.(.*)\.(.*)$""".r val scala2_13 = "2.13.14" @@ -105,8 +103,6 @@ lazy val docs = (project in file("docs")) 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( @@ -116,10 +112,6 @@ scmInfo := Some(ScmInfo(url("https://github.com/mrpowers-io/spark-fast-tests"), updateOptions := updateOptions.value.withLatestSnapshots(false) -publishMavenStyle := true - -publishTo := sonatypePublishToBundle.value - Global / useGpgPinentry := true ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" From b0b1bc7ba44e2ac7761703b391181d84b6f0d6d9 Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sun, 3 Nov 2024 17:38:15 +1100 Subject: [PATCH 07/11] Temp change organization to test publish --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 2fe3e9b..5bf0744 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ enablePlugins(GitVersioning) Compile / scalafmtOnCompile := true -organization := "com.github.mrpowers" +organization := "io.github.zeotuan" name := "spark-fast-tests" val versionRegex = """^(.*)\.(.*)\.(.*)$""".r From cbf576154bbdaec4b061fc500261fd83479e71f2 Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sun, 3 Nov 2024 17:52:34 +1100 Subject: [PATCH 08/11] use Sonatype Central host --- build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 5bf0744..d99f6ed 100644 --- a/build.sbt +++ b/build.sbt @@ -114,5 +114,6 @@ updateOptions := updateOptions.value.withLatestSnapshots(false) Global / useGpgPinentry := true -ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" +import xerial.sbt.Sonatype.sonatypeCentralHost +ThisBuild / sonatypeCredentialHost := sonatypeCentralHost sonatypeRepository := "https://s01.oss.sonatype.org/service/local" \ No newline at end of file From e655a375ed6ebe4aa003faa86c21a8c1d95a4676 Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sun, 3 Nov 2024 18:10:51 +1100 Subject: [PATCH 09/11] Upgrade sbt-ci-release --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") From a03b3d093ec2720873bf02afb0d01e2c43216df6 Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sun, 3 Nov 2024 18:25:39 +1100 Subject: [PATCH 10/11] Remove explicit repository --- build.sbt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index d99f6ed..12ab4f5 100644 --- a/build.sbt +++ b/build.sbt @@ -115,5 +115,4 @@ updateOptions := updateOptions.value.withLatestSnapshots(false) Global / useGpgPinentry := true import xerial.sbt.Sonatype.sonatypeCentralHost -ThisBuild / sonatypeCredentialHost := sonatypeCentralHost -sonatypeRepository := "https://s01.oss.sonatype.org/service/local" \ No newline at end of file +ThisBuild / sonatypeCredentialHost := sonatypeCentralHost \ No newline at end of file From 1b9e6e0024f09d27e67823a01557b7bcdc437ef9 Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sun, 3 Nov 2024 18:50:25 +1100 Subject: [PATCH 11/11] Put publishing setting on top --- build.sbt | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index 12ab4f5..1007cc2 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,21 @@ +inThisBuild( + List( + organization := "io.github.zeotuan", + 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 := "io.github.zeotuan" name := "spark-fast-tests" val versionRegex = """^(.*)\.(.*)\.(.*)$""".r @@ -103,11 +117,6 @@ lazy val docs = (project in file("docs")) Laika / sourceDirectories := Seq((ThisBuild / baseDirectory).value / "docs") ) -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)