我已经构建了一个OSS项目https://github.com/datlinq/scalafiniti Travis-ci管道完美地工作,但最终完成了一步。sbt发布使用pgpPassphrase通过Travis CI在Sonatype Nexus上签名
我跟着这些指南:
- http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html
- http://www.scala-sbt.org/sbt-pgp/usage.html
- https://github.com/xerial/sbt-sonatype
本地我得到了做工精细的所有步骤,实际上发布到了Nexus。
在.travis.yml
我导入密钥之前安装(在travis.ci ENV加密)
before_install:
- echo "$PGP_SECRET" | base64 --decode | gpg --import
- echo "$PGP_TRUST" | base64 --decode | gpg --import-ownertrust
的$PGP_PASS
也被加密特拉维斯env和可用于build.sbt
我检查它实际上得到此命令中的键
pgpPassphrase := sys.env.get("PGP_PASS").map(_.toArray)
现在如果Travis运行命令
sbt publishSigned
它仍然提示我的钥匙
你需要一个密码来解锁用户密钥口令: “com.datlinq.datalabs(主要为Datalabs OSS)” 2048位RSA密钥,ID 305DA15D,创造了2017年9月1日
输入密码:
我不知道我应该做的,使这项工作
这个时刻被捕获:
代码: https://github.com/datlinq/scalafiniti/tree/0d8a6a92bf111bae2a1081b17005a649f8fd00c9 生成日志: https://travis-ci.org/datlinq/scalafiniti/builds/271328874