Skip to content
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

WIP: skip -SNAPSHOT suffix if publishing to new portal #738

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import sbt._
import sbt._

import scala.util.Try
import xerial.sbt.Sonatype
import xerial.sbt.Sonatype.autoImport._

import Keys._
import Keys._
Expand Down Expand Up @@ -129,7 +131,10 @@ object TypelevelVersioningPlugin extends AutoPlugin {
version += s"-$formatted"
}

if (isSnapshot.value) version += "-SNAPSHOT"
val isPublishingToCentalPortal =
sonatypeCredentialHost.value == Sonatype.sonatypeCentralHost

if (isSnapshot.value && !isPublishingToCentalPortal) version += "-SNAPSHOT"
Copy link
Member

Choose a reason for hiding this comment

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

Sonatype Central does not accept -SNAPSHOT versions.

The Central Publisher Portal does not support -SNAPSHOT releases, and deployments of -SNAPSHOT releases will have a version cannot be a SNAPSHOT error in their validation results. Versions should only be published to the Portal if they are intended to reach Maven Central.

Copy link
Member

@armanbilge armanbilge Aug 20, 2024

Choose a reason for hiding this comment

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

Oh sorry, I missed the ! :)

Anyway, I feel it's disingenous for isSnapshot to be true but result in a version lacking the -SNAPSHOT.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Mmm, also disingenuous if isSnapshot is true but it's not published to the snapshot repo?

https://s01.oss.sonatype.org/content/repositories/snapshots/


version
},
Expand Down
Loading