[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge pull request #12 from kolotaev/iss-11
Browse files Browse the repository at this point in the history
Move releases to Maven Central
  • Loading branch information
kolotaev committed Apr 23, 2021
2 parents 77c47e9 + 523a45c commit 538522d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/kolotaev/ride.svg?branch=master)](https://travis-ci.org/kolotaev/ride)
[![codecov.io](https://codecov.io/github/kolotaev/ride/coverage.svg?branch=master)](https://codecov.io/github/kolotaev/ride?branch=master)
[![Download](https://api.bintray.com/packages/kolotaev/maven/ride/images/download.svg)](https://bintray.com/kolotaev/maven/ride/_latestVersion)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.kolotaev/ride_2.12.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.kolotaev%22%20AND%20a:%22ride_2.12%22)

Scala global unique identifier (GUID) generator for large systems.

Expand Down Expand Up @@ -42,11 +42,7 @@ sortable property of the ID.

In your `build.sbt` add
```scala
resolvers += Resolver.jcenterRepo // For Scala == 2.12
// or
resolvers += Resolver.bintrayRepo("kolotaev", "maven") // For Scala >= 2.12

libraryDependencies += "com.github.kolotaev" %% "ride" % "(version)"
libraryDependencies += "com.github.kolotaev" %% "ride" % "$VERSION_YOU_NEED"
```

#### Generating IDs
Expand Down
22 changes: 22 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# How to release

- Make sure you have a valid account in [Sonatype Nexus](https://oss.sonatype.org)
- Make sure you have Nexus account credentials in `~/.sbt/$SBT_VERSION/sonatype.sbt`
Example:
```scala
credentials += Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
"your-username",
"your-password"
)
```
- List GPG keys with `sbt gpg --list-keys`
- Check the presence of key for this library release (it's called `ride`). If not found: generate a new one with `sbt pgp-cmd gen-key` and then post it to GPG ubuntu keyserver with `sbt pgp-cmd send-key ride http://keyserver.ubuntu.com:11371`
- Make sure tests are passing (locally and on CI)
- Create a release at the Github
- Checkout released tag locally
- Publish to staging with `sbt publishSigned`
- Promote to Maven Central with `sbt sonatypeRelease`
- Test that the library is available in Maven Central
- Repeat for all ride supported Scala versions
21 changes: 12 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,22 @@ javacOptions ++= Seq(
)

libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.8" % "test"
"org.scalatest" %% "scalatest" % "3.0.8" % Test
)

licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT"))
homepage := Some(url(s"https://github.com/$username/$repo"))

publishMavenStyle := true
publishArtifact in Test := false

publishTo := Some(
if (isSnapshot.value)
Opts.resolver.sonatypeSnapshots
else
Opts.resolver.sonatypeStaging
)

pomExtra :=
<scm>
<connection>
Expand All @@ -36,11 +47,3 @@ pomExtra :=
<email>ekolotaev@gmail.com</email>
</developer>
</developers>

publishTo := Some(
"bintray" at
"https://api.bintray.com/maven/kolotaev/" +
"maven/ride/;publish=1")
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
publishMavenStyle := true
publishArtifact in Test := false
4 changes: 4 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")

// For releasing (Sonatype Nexus and Maven Central)
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")

0 comments on commit 538522d

Please sign in to comment.