-
Notifications
You must be signed in to change notification settings - Fork 76
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
Problems publishing using GitHub actions #173
Comments
I also am having problems doing a release. Here is the output. |
I am getting an error that starts like the following: [error] java.net.ProtocolException: Server redirected too many times (20)
[error] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[error] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[error] at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1950)
[error] at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1945)
[error] at java.security.AccessController.doPrivileged(Native Method) |
I have some more info so we should be able to edit the docs and good but perhaps if secrets are not found the plugin should error right away? Solved but we may be able to make it easier for the next victim. I put the secrets in the environment and apparently you need to select the following: Interestingly the errors for a non-SNAPSHOT deploy are different than above.
|
I agree the erroring should be more explicit. Just had the same Looking at the plugin code, it seems like most of the work is happening when delegating to sbt-pgp/sbt-sonatype, so I think this needs to be fixed in there. sbt-ci-release can detect absence of variables early, but I'm not 100% certain that there's a finite set of configurations one can check in which absence of particular env variables is a surefire stop condition. |
This doesn't fix the error reporting but make the directions better - #174 |
Hello! I had the same problem when updated to 1.5.6: gpg: signing failed: secret key not available (with GitHub Actions) |
I am also facing this issue, I have checked the secrets they are correct I have tried versions 1.5.6 and 1.5.7 both are giving the same error. |
@amitksingh1490 afaik this plugin delegates to sbt-sonatype. You can configure the host like this (according to documentation: // For all Sonatype accounts created on or after February 2021
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" |
I have already tried this still getting the error |
adding the sonaTypecredetialHost in project settings solves the issue |
I've added to my
But I keep getting:
And at the end I get this error:
But citing Central OSSRH:
|
I added these three settings in the project I want to publish for and, it worked
|
Yes, I've tried that as well, but still getting the same issue, I found out that it works "fine" (with some strange version) in PR but not tagging a commit in master. The repository is here: https://github.com/Insubric/box |
In your repo I can see your snapshot release is working fine but tagged/Stable release is not working might be a issue with signing your build. Verify these steps again https://github.com/olafurpg/sbt-ci-release#gpg. |
Since it works on PR I exclude it may be an authentication issue |
PGP_SECRET can be the issue since signing is not done on PR |
I have tried all of these settings, and github actions still says
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeRepository := "https://s01.oss.sonatype.org/service/local",
sonatypeProfileName := "io.github.kalin-rudnicki",
publishTo := {
val nexus = "https://s01.oss.sonatype.org/"
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
sonatypePublishTo := {
val nexus = "https://s01.oss.sonatype.org/"
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}, |
I have a multi-project build. The // Shared settings
inThisBuild(
List(
compileOrder := CompileOrder.JavaThenScala,
crossScalaVersions := Seq(Versions.scala212, Versions.scala213),
developers := List(
Developer(...)
),
homepage := Some(url("...")),
javacOptions := Seq("-encoding", "UTF-8", "-source", Versions.java),
licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")),
organization := "...",
organizationName := "...",
scalaVersion := Versions.scala213,
startYear := Some(2021),
versionScheme := Some("early-semver")
)
)
lazy val root = (project in file("."))
.aggregate(javadsl, scaladsl)
.settings(
publish / skip := true,
sonatypeCredentialHost := Sonatype.sonatype01
)
lazy val javadsl = (project in file("javadsl"))
.enablePlugins(AutomateHeaderPlugin)
.settings(
name := "...-javadsl"
)
lazy val scaladsl = (project in file("scaladsl"))
.dependsOn(javadsl)
.settings(
libraryDependencies ++= Seq(Dependencies.scalaCollectionCompat) ++ Seq(Dependencies.scalaTest).map(_ % Test),
name := "...-scaladsl"
)
I was also getting:
If I explicitly apply lazy val javadsl = (project in file("javadsl"))
.enablePlugins(AutomateHeaderPlugin)
.settings(
name := "...-javadsl",
sonatypeCredentialHost := Sonatype.sonatype01
) Then it works. But I have seen projects that only define |
Previously, the `sonatypeCredentialHost` setting had to be redefined inside every project even if the sbt-sonatype readme documents that the setting can be configured once via `ThisBuild /` at the root of build.sbt. This commit moves the definition of that setting to the build scope so that the behavior is consistent with the documentation. Related sbt/sbt-ci-release#173
I opened a PR xerial/sbt-sonatype#242 to sbt-sonatype changing the scoping of |
@olafurpg Makes sense to me, thanks. |
Previously, the `sonatypeCredentialHost` setting had to be redefined inside every project even if the sbt-sonatype readme documents that the setting can be configured once via `ThisBuild /` at the root of build.sbt. This commit moves the definition of that setting to the build scope so that the behavior is consistent with the documentation. Related sbt/sbt-ci-release#173
I just triggered a 1.5.8 release upgrading to the latest sbt-sonatype version that includes the fix from xerial/sbt-sonatype#242 The short story is that the following settings should work as expected now ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" Previously, this didn't work because you had to redefine the setting for every project in a multi-module build. |
@olafurpg Looks like the release got stuck: https://github.com/olafurpg/sbt-ci-release/runs/3348896102?check_suite_focus=true#step:4:272
maven central is also missing this version |
Applying workaround for error outline in issue: sbt/sbt-ci-release#173
Without `ThisBuild / `, the setting would only be applied to the top-level project, which breaks publishing in multi-project builds. See this pull request: xerial/sbt-sonatype#242 And this report: sbt#173 (comment) I had the exact same issue as kflorence, and it was fixed by adding the ThisBuild part.
Anyone else is getting the same error again ? |
Could it be related to the changes in authorization for sonatype? Did you update to use the token? I've seen a bunch of errors there that didn't seem related and it was the token actually |
What do you mean with token ? I tried to generate another gpg keys because I though the keys were expired but I'm still having the same problem. I also tried to log in into sonatype https://oss.sonatype.org/ and it works |
I recently had to change my sonatype user and password like explained in https://central.sonatype.org/publish/generate-token/ The disallowed using plain username and password. Not sure if that is the issue, but I had that problem multiple times last few weeks |
It works 🎉 |
Thank-you for having information and scripts for getting started with GitHub actions.
When pushing to a PR and using the script that follows I got the CI to run twice.
https://github.com/olafurpg/sbt-ci-release/blob/master/.github/workflows/ci.yml
I changed to do the following after poking around and it seems to run CI once. Sometime people add
main
to the branch as usingmaster
is now not considered a best practice. Future proofing I guess.https://github.com/ekrich/sjavatime/blob/topic/scalanative/.github/workflows/ci.yml
I also wonder why in you use a different checkout version as used above in
ci.yml
?https://github.com/ekrich/sjavatime/blob/topic/scalanative/.github/workflows/release.yml#L10
https://github.com/ekrich/sjavatime/blob/topic/scalanative/.github/workflows/ci.yml#L10
The text was updated successfully, but these errors were encountered: