-
Notifications
You must be signed in to change notification settings - Fork 148
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
Properly set sonatype repo settings for publishTo #129
Properly set sonatype repo settings for publishTo #129
Conversation
publishRsyncHost := "akkarepo@gustav.akka.io", | ||
credentials ++= apacheNexusCredentials, | ||
organizationName := "Apache Software Foundation", | ||
organizationHomepage := Some(url("https://www.apache.org")), | ||
sonatypeCredentialHost := apacheBaseRepo, |
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.
This is the base repository which by default is oss.sonatype.org
(and hence the reason why it was publishing to the wrong location before, the sbt-sonatype plugin sets publishTo
to indirectly use sonatypeCredentialHost
and other related sbt-sonatype settings).
@@ -39,13 +42,6 @@ object Publish extends AutoPlugin { | |||
publishMavenStyle := true, | |||
pomIncludeRepository := (_ => false)) | |||
|
|||
private def pekkoPublishTo = Def.setting { |
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.
This is not needed anymore because sbt-sonatype handles this automatically behind the scenes. Hopefully Apache's Nexus behaves in the exact same way as OS sonatype with only a different host, in which case we can use sbt-ci-release.
145d3e6
to
950d733
Compare
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.
I discussed this a bit with @mdedetrich. Our current assumption is that snapshot releases and normal releases go through Apache's Nexus (and never through Sonatype). According to https://infra.apache.org/publishing-maven-artifacts.html the overall setup is quite similar to the process with Sonatype, so that it seems reasonable for now to keep using sbt-ci-release with just the Apache Nexus backend instead.
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.
lgtm
In order to get timely CI results - would it be a good idea to change the Github workflows setup in this PR to enable the nexus publish on every commit to main branch? |
You can actually manually force a github action to run outside of a cron job, which is what I am doing to test my PR's. However in general I think there is broad agreement to publish snapshots after a commit to main, will be done in a future PR. |
So I figured out the what was causing the publishing issues, it turns out that since sbt-ci-release was added into pekko, it overrode the settings defined in https://github.com/apache/incubator-pekko/blob/main/project/Publish.scala#L25-L56.
This is because sbt-ci-release depends on sbt-sonatype, which by default points to the OS sonatype public repo. This PR tries to set various sbt-sonatype settings so that sbt-ci-release ends up publishing to Apache's Nexus repo instead of sonatype, since they both use Nexus it should theoretically work however if it doesn't we may end up having to remove sbt-ci-release (because its hardcoded to use sbt-sonatype).
At least locally when I run
sbt show publishTo
it does appear the settings are now correctly workingRelated to #103