sbt / sbt-ci-release

sbt plugin to automate Sonatype releases from GitHub Actions
Apache License 2.0
286 stars 76 forks source link

Is setup-gpg still needed? #194

Closed ckipp01 closed 3 years ago

ckipp01 commented 3 years ago

I ran into a hiccup that took me a little while to figure out today. I kept hitting on the followinng error message when trying to do a release:

gpg (GnuPG) 1.4.23
gpg: directory `/home/runner/.gnupg' created
gpg: can't open `/usr/local/share/gnupg/options.skel': No such file or directory
gpg: keyring `/home/runner/.gnupg/secring.gpg' created
gpg: keyring `/home/runner/.gnupg/pubring.gpg' created
gpg: key FFFFFFFF: secret key imported
gpg: Total number processed: 1
gpg:       secret keys read: 1
gpg:   secret keys imported: 1
Tag push detected, publishing a stable release
[info] Defining Global / pgpSecretRing
[info] The new value will be used by Global / pgpStaticContext
[info] Reapplying settings...
[info] set current project to scalac-scoverage (in build file:/home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/)
[info] Defining Global / pgpPublicRing
[info] The new value will be used by Global / pgpStaticContext
[info] Reapplying settings...
[info] set current project to scalac-scoverage (in build file:/home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/)
[success] Total time: 0 s, completed May 1, 2021 1:33:55 PM
[success] Total time: 0 s, completed May 1, 2021 1:33:56 PM
[info] Setting Scala version to 2.12.10 on 4 projects.
[info] Reapplying settings...
[info] set current project to scalac-scoverage (in build file:/home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/)
[warn] Binary version (2.13) for dependency org.scala-lang#scala-compiler;2.13.5
[warn]  in org.scoverage#scalac-scoverage-runtime_2.12.10;1.4.4 differs from Scala binary version in project (2.12).
[info] Wrote /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-runtime/jvm/target/scala-2.12.10/scalac-scoverage-runtime_2.12.10-1.4.4.pom
[warn] Binary version (2.13) for dependency org.scala-lang#scala-compiler;2.13.5
[warn]  in org.scoverage#scalac-scoverage-runtime_sjs1_2.12.10;1.4.4 differs from Scala binary version in project (2.12).
[info] Wrote /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-runtime/js/target/scala-2.12.10/scalac-scoverage-runtime_sjs1_2.12.10-1.4.4.pom
[warn] Binary version (2.13) for dependency org.scala-lang#scala-compiler;2.13.5
[warn]  in org.scoverage#scalac-scoverage_2.12;1.4.4 differs from Scala binary version in project (2.12).
[warn] Binary version (2.13) for dependency org.scala-lang#scala-compiler;2.13.5
[warn]  in org.scoverage#scalac-scoverage-plugin_2.12.10;1.4.4 differs from Scala binary version in project (2.12).
[info] Wrote /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-plugin/target/scala-2.12.10/scalac-scoverage-plugin_2.12.10-1.4.4.pom
[info] Main Scala API documentation to /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-runtime/js/target/scala-2.12.10/api...
[info] Non-compiled module 'compiler-bridge_2.12' for Scala 2.12.10. Compiling...
[info] compiling 9 Scala sources to /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-runtime/js/target/scala-2.12.10/classes ...
[info]   Compilation completed in 11.212s.
model contains 19 documentable templates
[info] done compiling
[info] Main Scala API documentation to /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-runtime/jvm/target/scala-2.12.10/api...
model contains 4 documentable templates
[info] Main Scala API documentation successful.
[info] compiling 2 Scala sources to /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-runtime/jvm/target/scala-2.12.10/classes ...
[info] Main Scala API documentation successful.
[info] Main Scala API documentation to /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-plugin/target/scala-2.12.10/api...
[info] done compiling
[info] compiling 16 Scala sources to /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-plugin/target/scala-2.12.10/classes ...
model contains 47 documentable templates
[info] Main Scala API documentation successful.
[info] gpg: error checking usability status of FFFFFFFF
[info] gpg: key FFFFFFFF: secret key without public key - skipped
[info] gpg: no default secret key: secret key not available
[info] gpg: signing failed: secret key not available
[info] gpg: error checking usability status of FFFFFFFF
[info] gpg: key FFFFFFFF: secret key without public key - skipped
[info] gpg: no default secret key: secret key not available
[info] gpg: signing failed: secret key not available
[info] done compiling
[info] gpg: error checking usability status of FFFFFFFF
[info] gpg: key FFFFFFFF: secret key without public key - skipped
[info] gpg: no default secret key: secret key not available
[info] gpg: signing failed: secret key not available
[error] java.lang.RuntimeException: Failure running 'gpg --batch --passphrase *** --detach-sign --armor --use-agent --output /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-plugin/target/scala-2.12.10/scalac-scoverage-plugin_2.12.10-1.4.4.pom.asc /home/runner/work/scalac-scoverage-plugin/scalac-scoverage-plugin/scalac-scoverage-plugin/target/scala-2.12.10/scalac-scoverage-plugin_2.12.10-1.4.4.pom'.  Exit code: 2
[error]     at scala.sys.package$.error(package.scala:30)
[error]     at com.jsuereth.sbtpgp.CommandLineGpgSigner.sign(PgpSigner.scala:74)
[error]     at com.jsuereth.sbtpgp.PgpSettings$.$anonfun$signingSettings$2(PgpSettings.scala:151)
[error]     at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
[error]     at scala.collection.immutable.Map$Map4.foreach(Map.scala:492)
[error]     at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
[error]     at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
[error]     at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
[error]     at com.jsuereth.sbtpgp.PgpSettings$.$anonfun$signingSettings$1(PgpSettings.scala:146)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]     at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]     at sbt.Execute.work(Execute.scala:291)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]     at java.lang.Thread.run(Thread.java:748)

There also seems to be similar errors reported in a few other issues:

While some of them had different solutions one of them hinted at removing sbt-gpg, which caused me to try that, which finally worked for me and allowed for my release to work: https://github.com/scoverage/scalac-scoverage-plugin/actions/runs/802328069

I see that there was a pr to remove setup-pgp here, but I also see there is a commit later where you added it back in here.

I'm a bit confused as I have some projects that seem to require it, and then others that don't. Do you have any info on when this may or may not be required? I'll gladly expand the README if there is more info about this, but I'm a bit unsure if it's actually needed and when it may be needed.

alexarchambault commented 3 years ago

If that can help, running this script instead of the setup-gpg action works fine for me. (@regadas initially added it to the coursier/apps repository, I've been copying it from there to many of my repos since.)

olafurpg commented 3 years ago

You can remove setup-gpg. It’s no longer needed with the latest sbt-ci-release.

ckipp01 commented 3 years ago

You can remove setup-gpg. It’s no longer needed with the latest sbt-ci-release.

Should I send in a pr to remove it from this repo then? Because the instructions include a step that copies the release file from this repo which still includes it.

https://github.com/olafurpg/sbt-ci-release#github-actions

olafurpg commented 3 years ago

Yeah, that would be great. I had assumed setup-gpg didn’t cause issues with releases so I didn’t make an active effort to deprecate it yet. I’ll follow up and archive the repo with appropriate docs.

ckipp01 commented 3 years ago

Closed via https://github.com/olafurpg/sbt-ci-release/pull/195#event-4674655575