-
Notifications
You must be signed in to change notification settings - Fork 86
#784 Switch to new Sonatype deployment #785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#784 Switch to new Sonatype deployment #785
Conversation
WalkthroughAdds a new GitHub Actions release workflow, migrates SBT build/release to sbt-ci-release, enables cross-Scala builds in multiple modules, updates SBT version and plugins, removes custom publishing/version settings, and drops Guava-related overrides and dependencies from SBT/Maven configs. Changes
Sequence Diagram(s)sequenceDiagram
actor Maintainer
participant GH as GitHub Actions
participant Runner as ubuntu-22.04 Runner
participant SBT as sbt ci-release
participant Sonatype as Sonatype/Maven Central
Maintainer->>GH: workflow_dispatch (Release2)
GH->>Runner: Start job "publish"
Runner->>Runner: actions/checkout (fetch-depth: 0)
Runner->>Runner: setup-java (Temurin 8, cache: sbt)
Runner->>SBT: Run ci-release
Note over SBT: Uses PGP_PASSPHRASE, PGP_SECRET,<br/>SONATYPE_USERNAME, SONATYPE_PASSWORD
SBT->>Sonatype: Publish artifacts
Sonatype-->>SBT: Acknowledgment
SBT-->>Runner: Exit code
Runner-->>GH: Job result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
JaCoCo code coverage report - 'cobol-parser'
|
JaCoCo code coverage report - 'spark-cobol'
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (7)
project/build.properties (1)
1-1: Confirm JDK 8 vs sbt 1.11.6 compatibility and align CI JVM.Docs state sbt runs on JDK 8+. Your workflow uses Java 8, so this should be fine, but verify plugins (assembly, shading, jacoco, scoverage) under JDK 8 with sbt 1.11.6 to avoid CI surprises. (scala-sbt.org)
If you plan to move CI to JDK 11/17 later, call it out now to keep build reproducibility across local and CI.
project/plugins.sbt (1)
3-3: scoverage 1.6.0 is quite old—verify compatibility across 2.11/2.12/2.13.Staying on 1.x may be intentional for Scala 2.11 support; still, please confirm it works with sbt 1.11.6. If you consider upgrading later, check Scala 2.11 support first.
.github/workflows/release2.yaml (2)
34-37: Re-check Java 8 choice with sbt 1.11.6 and your plugins.sbt supports JDK 8+, but some plugins/libs occasionally require newer JDKs. Keep Java 8 if you need Scala 2.11; otherwise consider 11/17. (scala-sbt.org, docs.scala-lang.net)
39-44: Secrets are fine; add a brief safety net.Consider gating the publish step to tags to avoid accidental snapshot publishes from manual runs. Works together with dynver/tag trigger. (github.com)
- - name: Build and release to Sonatype and Maven Central - run: sbt ci-release + - name: Build and release to Sonatype and Maven Central + if: startsWith(github.ref, 'refs/tags/v') + run: sbt ci-releasebuild.sbt (3)
55-55: Avoid repeating crossScalaVersions per-module.You already set ThisBuild / crossScalaVersions at Line 29; per-module duplication is redundant unless a module diverges. Simplify to reduce maintenance.
- crossScalaVersions := List(scala211, scala212, scala213), + // inherits ThisBuild / crossScalaVersionsRepeat similarly for cobol-parser, cobol-converters, spark-cobol.
Also applies to: 70-70, 88-88, 100-100
60-60: Redundant publish disabling.publishArtifact := false plus empty publish/publishLocal already prevent publication. publish / skip := true is extra; consider removing for clarity.
- publish / skip := true,Also applies to: 93-93
156-156: Jar name will include dynver format.Once dynver is added, version may contain '+' for non-tag builds; if that’s undesirable in filenames, normalize it (e.g., replace '+' with '-'). (github.com)
- assembly / assemblyJarName := s"${name.value}_${scalaBinaryVersion.value}_${sparkVersionShort(scalaVersion.value)}-${version.value}-bundle.jar", + assembly / assemblyJarName := s"${name.value}_${scalaBinaryVersion.value}_${sparkVersionShort(scalaVersion.value)}-${version.value.replace('+','-')}-bundle.jar",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.github/workflows/release2.yaml(1 hunks)build.sbt(3 hunks)pom.xml(0 hunks)project/Dependencies.scala(0 hunks)project/build.properties(1 hunks)project/plugins.sbt(1 hunks)publish.sbt(0 hunks)spark-cobol/pom.xml(0 hunks)version.sbt(0 hunks)
💤 Files with no reviewable changes (5)
- version.sbt
- spark-cobol/pom.xml
- publish.sbt
- project/Dependencies.scala
- pom.xml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Spark 3.5.5 on Scala 2.13.16
- GitHub Check: Spark 2.4.8 on Scala 2.11.12
- GitHub Check: Spark 3.5.5 on Scala 2.12.20
- GitHub Check: Spark 3.4.4 on Scala 2.12.20
- GitHub Check: test (2.12.20, 2.12, 3.3.4, 0, 80, 20)
| on: | ||
| workflow_dispatch: | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Trigger releases on tags to publish non-SNAPSHOTs.
ci-release expects tag-driven versions (with dynver). Add a push tag trigger so “vX.Y.Z” runs a release. (github.com)
on:
- workflow_dispatch:
+ workflow_dispatch:
+ push:
+ tags:
+ - "v*"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| on: | |
| workflow_dispatch: | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" |
🤖 Prompt for AI Agents
In .github/workflows/release2.yaml around lines 19 to 21, the workflow is only
triggered by workflow_dispatch but needs a push tag trigger so ci-release runs
for version tags; update the on: section to include a push trigger for tag
patterns (e.g. push: tags: - 'v*.*.*') alongside workflow_dispatch so pushes of
vX.Y.Z tags will run the release workflow.
| addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.1") | ||
| addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.2") | ||
| addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0") | ||
| addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0") | ||
| addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0") | ||
| addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing sbt-dynver: ci-release won’t produce proper release versions from tags.
You removed version.sbt; without sbt-dynver, version defaults to 0.1.0-SNAPSHOT, so ci-release will only publish snapshots. Add dynver so tags drive release versions. (github.com)
Apply:
+addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.1")
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.1") | |
| addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.2") | |
| addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0") | |
| addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0") | |
| addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0") | |
| addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5") | |
| // project/plugins.sbt | |
| addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.0") | |
| addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.1") | |
| addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.2") | |
| addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0") | |
| addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0") | |
| addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0") | |
| addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5") |
🤖 Prompt for AI Agents
In project/plugins.sbt around lines 1 to 6, the sbt-dynver plugin is missing so
CI release will keep publishing 0.1.0-SNAPSHOT; add the sbt-dynver plugin to
plugins.sbt (use the latest stable dynver version) so versions are derived from
Git tags, and remove any hardcoded version.sbt or ensure it does not override
dynver-generated versions; after adding the plugin, run sbt reload and verify
that sbt dynver or sbt show version returns a tag-derived version before relying
on ci-release.
Summary by CodeRabbit
New Features
Chores