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

Properly set sonatype repo settings for publishTo #129

Merged

Conversation

mdedetrich
Copy link
Contributor

@mdedetrich mdedetrich commented Jan 26, 2023

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 working

pekko > show publishTo
[info] pki / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] actor-testkit-typed / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] coordination / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] cluster-sharding-typed / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] actor-typed / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] docs / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] actor-typed-tests / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] testkit / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] stream / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] multi-node-testkit / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] persistence-query / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] osgi / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] persistence-typed-tests / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] persistence-testkit / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] persistence / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] cluster-tools / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] remote-tests / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] protobuf-v3 / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] stream-tests-tck / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] protobuf / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] actor / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] discovery / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] bench-jmh / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] cluster-metrics / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] bill-of-materials / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] stream-tests / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] stream-testkit / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] remote / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] distributed-data / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] cluster / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] actor-tests / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] slf4j / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] cluster-typed / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] serialization-jackson / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] persistence-tck / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] stream-typed / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] persistence-shared / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] persistence-typed / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] cluster-sharding / publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)
[info] publishTo
[info] 	Some(sonatype-snapshots: https://repository.apache.org/content/repositories/snapshots)

Related to #103

publishRsyncHost := "akkarepo@gustav.akka.io",
credentials ++= apacheNexusCredentials,
organizationName := "Apache Software Foundation",
organizationHomepage := Some(url("https://www.apache.org")),
sonatypeCredentialHost := apacheBaseRepo,
Copy link
Contributor Author

@mdedetrich mdedetrich Jan 26, 2023

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 {
Copy link
Contributor Author

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.

@mdedetrich mdedetrich force-pushed the properly-set-sonatype-repo-settings branch from 145d3e6 to 950d733 Compare January 26, 2023 11:35
Copy link
Contributor

@jrudolph jrudolph left a 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.

Copy link
Contributor

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

lgtm

@pjfanning
Copy link
Contributor

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?

@mdedetrich
Copy link
Contributor Author

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.

@mdedetrich mdedetrich merged commit beb13d2 into apache:main Jan 26, 2023
@mdedetrich mdedetrich deleted the properly-set-sonatype-repo-settings branch January 26, 2023 12:40
@mdedetrich mdedetrich mentioned this pull request Jan 26, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants