LoginSignup
2
0

More than 5 years have passed since last update.

Sonatypeにsbt-aws-serverlessを公開しました

Last updated at Posted at 2016-10-10

Publish a release to Bintray · Issue #2 · yoshiyoshifujii/sbt-aws-serverless というIssuesをいただきましたので、やってみようと思ってトライしました。

さぐりさぐりでやりましたので、この手順が正しいのか、あんまりよく分かってませんが、自分用のメモの変わりに残しておきます。

が、タイトルとIssuesの不一致で想定いただけるとかと思いますが、最終的には、Sonatypeにpublishしております。

Bintrayは有償?、OSSならどうなの?とかよう分からんかったというかあんまり調べてないです。

というか、そもそも今回のTryはあんまり下調べとかしていないのです…。
ので、マズいところとか無いかちょっと心配…。

主に、 http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html を参照しながら手探りで進めました。

PGP Signatures

http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html#First+-+PGP+Signatures
に記載の手順を実施しました。

が、

pgp-cmd send-key keyname hkp://pool.sks-keyservers.net

でひっかかりました。

http://www.scala-sbt.org/sbt-pgp/usage.html#creating-a-key-pair
を読んで、まずはkey pairを作るんだなって思って、それを実施しました。

> pgp-cmd gen-key
java.lang.RuntimeException: Cannot modify keyrings when in read-only mode.  Run `set pgpReadOnly := false` before running this command.

ふぁ?
ああ。なんか外さんといかんのね。

> set pgpReadOnly := false
[info] Defining */*:pgpReadOnly
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
...
> pgp-cmd gen-key
Please enter the name associated with the key: <your key>
Please enter the email associated with the key: <your email address>
Please enter the passphrase for the key: ********
Please re-enter the passphrase for the key: ********
[info] Creating a new PGP key, this could take a long time.
[info] Public key := ~/.sbt/gpg/pubring.asc
[info] Secret key := ~/.sbt/gpg/secring.asc
[info] Please do not share your secret key.   Your public key is free to share.

よし。うまいこといったっぽい。

> pgp-cmd send-key <your key> hkp://keyserver.ubuntu.com
[info] Sending PublicKeyRing(PublicKey(xxx, your key <your email address>, RSA@2048)) to HkpServer(http://keyserver.ubuntu.com:11371)
...

しゃーうまいこといったー。

ねーくすと!!

Maven Publishing Settings

http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html#Second+-+Maven+Publishing+Settings
に記載の手順ですね。

ここは特に疑うことなくsbtに追記しました。
ただ、既存の build.sbt に混ざるとあれやし、 publish.sbt って作ってそっちに設定を書いた。

ねーくすと!!

POM Metadata

http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html#Third+-+POM+Metadata
に記載の手順です。

これも一緒やね。
publish.sbt に書いた。

Adding credentials

http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html#Fourth+-+Adding+credentials
ですね。

はい。ここで、Sonatypeのアカウントないよーってやつですね。
JIRAに登録してIssuesにあれしてアカウントを作ってもらう必要あるってやつですね。

https://issues.sonatype.org/browse/OSSRH-25477 こんな感じで登録したら、けっこー即レスポンスいただけました。

英語苦手やし大丈夫かなーとドキドキしましたが、なんとかなりました。

Publish

http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html#Finally+-+Publish
いよいよpublish!!

> publishSigned
...
[info] Resolving org.scala-sbt#sbt-launch;0.13.9 ...
[info] Done updating.
...
[info] Done packaging.
Please enter PGP passphrase (or ENTER to abort): ********
[info]  published sbt-aws-serverless to https://oss.sonatype.org/content/repositories/snapshots/com/github/yoshiyoshifujii/sbt-aws-serverless_2.10_0.13/1.5.0/sbt-aws-serverless-1.5.0-javadoc.jar
[info]  published sbt-aws-serverless to https://oss.sonatype.org/content/repositories/snapshots/com/github/yoshiyoshifujii/sbt-aws-serverless_2.10_0.13/1.5.0/sbt-aws-serverless-1.5.0-javadoc.jar.asc
[info]  published sbt-aws-serverless to https://oss.sonatype.org/content/repositories/snapshots/com/github/yoshiyoshifujii/sbt-aws-serverless_2.10_0.13/1.5.0/sbt-aws-serverless-1.5.0.pom
[info]  published sbt-aws-serverless to https://oss.sonatype.org/content/repositories/snapshots/com/github/yoshiyoshifujii/sbt-aws-serverless_2.10_0.13/1.5.0/sbt-aws-serverless-1.5.0-sources.jar
[info]  published sbt-aws-serverless to https://oss.sonatype.org/content/repositories/snapshots/com/github/yoshiyoshifujii/sbt-aws-serverless_2.10_0.13/1.5.0/sbt-aws-serverless-1.5.0.jar
[info]  published sbt-aws-serverless to https://oss.sonatype.org/content/repositories/snapshots/com/github/yoshiyoshifujii/sbt-aws-serverless_2.10_0.13/1.5.0/sbt-aws-serverless-1.5.0-sources.jar.asc
[info]  published sbt-aws-serverless to https://oss.sonatype.org/content/repositories/snapshots/com/github/yoshiyoshifujii/sbt-aws-serverless_2.10_0.13/1.5.0/sbt-aws-serverless-1.5.0.pom.asc
[info]  published sbt-aws-serverless to https://oss.sonatype.org/content/repositories/snapshots/com/github/yoshiyoshifujii/sbt-aws-serverless_2.10_0.13/1.5.0/sbt-aws-serverless-1.5.0.jar.asc
[success]...

さいごに、sonatypeにリリースするんやー。

> sonatypeRelease
...

よっしゃー!!

update Giter8 template

Giter8 テンプレートを作成していたので、更新しておきました。

まとめ

けっこー手探りでやりましたが、SonatypeのJIRAに登録してアカウントを発行いただけると、あとは何とかなる気がします。
Group IDを com.github.yoshiyoshifujii で払い出していただきましたので、今後、このGroup IDを使うpluginとかlibは、さくさくと公開できるのかな?

なるたけ積極的に公開していこうと思います。

以上です。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0