Skip to content

Set up Maven Central publishing#438

Merged
xerial merged 7 commits intomainfrom
feature/maven-central-publishing
Mar 23, 2026
Merged

Set up Maven Central publishing#438
xerial merged 7 commits intomainfrom
feature/maven-central-publishing

Conversation

@xerial
Copy link
Copy Markdown
Member

@xerial xerial commented Mar 23, 2026

Summary

  • Add sbt-sonatype and sbt-pgp plugins for Maven Central publishing
  • Configure POM metadata (licenses, homepage, scmInfo, developers) and Sonatype publish targets
  • Create GitHub Actions release workflows for JVM, Scala.js, and Scala Native (triggered by v* tags)
  • Add command aliases: publishSnapshots, publishJSSigned, publishNativeSigned

First release will be v2026.1.0 using YYYY.(milestone).patch versioning via sbt-dynver.

Required GitHub secrets: PGP_SECRET, PGP_PASSPHRASE, SONATYPE_USER, SONATYPE_PASS

Test plan

  • ./sbt compile passes
  • ./sbt scalafmtAll passes
  • Verify CI passes on PR
  • After merge, tag v2026.1.0 and verify release workflows run

🤖 Generated with Claude Code

@github-actions github-actions Bot added the doc Improvements or additions to documentation label Mar 23, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes the necessary infrastructure for publishing the project's artifacts to Maven Central. It involves updating build configurations, adding required sbt plugins, defining POM metadata, and setting up automated release workflows to ensure a smooth and signed publication process across JVM, Scala.js, and Scala Native platforms.

Highlights

  • Build Configuration: Configured build.sbt with ThisBuild settings for organization, dynamic versioning, and Sonatype publish targets.
  • POM Metadata: Added essential POM metadata including licenses, homepage, SCM information, and developer details.
  • Publishing Command Aliases: Introduced sbt command aliases (publishSnapshots, publishJSSigned, publishNativeSigned) to streamline the publishing process.
  • Plugin Integration: Integrated sbt-sonatype and sbt-pgp plugins to enable Maven Central publishing and GPG signing.
  • Release Workflows: Established GitHub Actions workflows for JVM, Scala.js, and Scala Native artifact releases, triggered by version tags.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/release-js.yml
    • .github/workflows/release-native.yml
    • .github/workflows/release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request sets up Maven Central publishing by adding the necessary sbt plugins and build configurations. The changes are mostly correct, including the addition of POM metadata. However, I've found a syntax issue in the newly defined sbt command aliases in build.sbt. The + prefix used in the commands is invalid and will cause the aliases to fail. I've provided suggestions to correct the syntax. The rest of the changes for configuring publishing look good.

Comment thread build.sbt Outdated
Comment on lines +21 to +22
"publishSnapshots",
s"+ projectJVM/publish; + projectJS/publish; + projectNative/publish"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The command string for the publishSnapshots alias appears to be incorrect. The + prefix before each command part (e.g., + projectJVM/publish) is not valid sbt syntax for running a task on a project. The + command is for cross-building and should be prefixed to a task (e.g., +publish), not a scoped task key with a space. To run a task on a specific project, you should use the project/task syntax. Since crossScalaVersions contains only one version, cross-building is not necessary.

  "publishSnapshots",
  s"projectJVM/publish; projectJS/publish; projectNative/publish"

Comment thread build.sbt Outdated
Comment on lines +25 to +26
"publishJSSigned",
s"+ projectJS/publishSigned"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The command string for the publishJSSigned alias appears to be incorrect. The + prefix is not valid sbt syntax. To run a signed publish on the projectJS aggregate, you should use projectJS/publishSigned. The + for cross-building would be projectJS/+publishSigned, but it's not needed here as there's only one Scala version.

  "publishJSSigned",
  s"projectJS/publishSigned"

Comment thread build.sbt Outdated
Comment on lines +29 to +30
"publishNativeSigned",
s"+ projectNative/publishSigned"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The command string for the publishNativeSigned alias appears to be incorrect. The + prefix is not valid sbt syntax. To run a signed publish on the projectNative aggregate, you should use projectNative/publishSigned. The + for cross-building would be projectNative/+publishSigned, but it's not needed here as there's only one Scala version.

  "publishNativeSigned",
  s"projectNative/publishSigned"

xerial and others added 3 commits March 22, 2026 21:56
Add sbt-sonatype and sbt-pgp plugins, configure POM metadata
(licenses, homepage, scmInfo, developers), and create GitHub Actions
release workflows for JVM, Scala.js, and Scala Native platforms.
Releases are triggered by v* tags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sbt's built-in sonaRelease and localStaging work without the
sbt-sonatype plugin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@xerial xerial force-pushed the feature/maven-central-publishing branch from f647943 to 0e3f9db Compare March 23, 2026 04:58
xerial and others added 4 commits March 22, 2026 22:15
uni only targets Scala 3, so the + cross-build prefix is not needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused SCALA_JS/SCALA_NATIVE env vars from sonaRelease
- Add Node.js setup for Scala.js release
- Add sbt cache to all release workflows

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ruby script that auto-increments YYYY.(milestone).patch version,
creates an annotated git tag, and pushes to trigger release workflows.

Usage: ruby project/release.rb

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@xerial xerial merged commit d5b631d into main Mar 23, 2026
13 checks passed
@xerial xerial deleted the feature/maven-central-publishing branch March 23, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant