Skip to content

Commit b0ec046

Browse files
authored
Enable push and build to sonatype (#105)
* testing * old versions * testing plugins * testing * test * sbt release * added pgp * update plugins * update version * use env for creds * update for sbt-ci * removed duplicate clone * remove creds * publish staging first * update * update * some hashing * tested working * cleanup * further cleanup * org name changed to dmain
1 parent 2ac415d commit b0ec046

File tree

8 files changed

+55
-84
lines changed

8 files changed

+55
-84
lines changed

.github/workflows/scala.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ jobs:
2525
run: sbt universal:packageBin
2626
if: startsWith(github.ref, 'refs/tags/v')
2727

28+
29+
- uses: olafurpg/setup-scala@v10
30+
- run: sbt ci-release
31+
env:
32+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
33+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
34+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
35+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
36+
if: startsWith(github.ref, 'refs/tags/v')
37+
2838
- name: Set env
2939
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3040

.travis.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

build.sbt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
inThisBuild(List(
2+
organization := "io.conduktor",
3+
homepage := Some(url("https://github.com/conduktor/kafka-security-manager")),
4+
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
5+
developers := List(
6+
Developer(
7+
"conduktor",
8+
"Stephane Maarek",
9+
10+
url("https://github.com/conduktor")
11+
)
12+
)
13+
))
14+
15+
116
name := "kafka-security-manager"
217

3-
organization := "com.github.conduktor.ksm"
418

519
version := "0.11.0-SNAPSHOT"
620

@@ -13,7 +27,7 @@ lazy val root = (project in file("."))
1327

1428

1529
resolvers ++= Seq(
16-
"Artima Maven Repository" at "http://repo.artima.com/releases",
30+
"Artima Maven Repository" at "https://repo.artima.com/releases",
1731
Resolver.bintrayRepo("beyondthelines", "maven")
1832
)
1933

@@ -60,8 +74,7 @@ dockerRepository := Some("conduktor")
6074
dockerUpdateLatest := true
6175
dockerBaseImage := "openjdk:8-jre-slim"
6276

63-
// Add the default sonatype repository setting
64-
publishTo := sonatypePublishTo.value
77+
6578

6679
assemblyMergeStrategy in assembly := {
6780
case PathList("META-INF", _ @ _*) => MergeStrategy.discard

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.2.8
1+
sbt.version = 1.5.2

project/plugins.sbt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ resolvers += Resolver.typesafeRepo("releases")
22

33
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.1")
44

5-
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.3")
5+
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.6")
66

7-
resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"
7+
resolvers += "Artima Maven Repository" at "https://repo.artima.com/releases"
88

99
addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.1.7")
1010

11-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
11+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")
1212

13-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
13+
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
1414

1515
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
16+
17+
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")

publish.sbt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ThisBuild / organization := "io.conduktor"
2+
3+
ThisBuild / scmInfo := Some(
4+
ScmInfo(
5+
url("https://github.com/conduktor/kafka-security-manager"),
6+
"scm:[email protected]:conduktor/kafka-security-manager.git"
7+
)
8+
)
9+
10+
// Remove all additional repository other than Maven Central from POM
11+
ThisBuild / pomIncludeRepository := { _ => false }
12+
ThisBuild / publishTo := {
13+
val nexus = "https://s01.oss.sonatype.org/"
14+
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
15+
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
16+
}
17+
ThisBuild / publishMavenStyle := true
18+
19+
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"

sonatype.sbt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Your profile name of the sonatype account. The default is the same with the organization value
2-
sonatypeProfileName := "com.github.conduktor"
2+
sonatypeProfileName := "io.conduktor"
33

44
// To sync with Maven central, you need to supply the following information:
55
publishMavenStyle := true
@@ -12,13 +12,4 @@ import xerial.sbt.Sonatype._
1212
sonatypeProjectHosting := Some(GitHubHosting("conduktor", "kafka-security-manager", "[email protected]"))
1313

1414
developers := List(Developer(id="conduktor",name="Stephane Maarek",email="[email protected]",url= url("https://github.com/conduktor")))
15-
16-
credentials ++= (for {
17-
username <- sys.env.get("SONATYPE_USERNAME")
18-
password <- sys.env.get("SONATYPE_PASSWORD")
19-
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)).toSeq
20-
21-
22-
pgpPublicRing := file("./travis/local.pubring.asc")
23-
pgpSecretRing := file("./travis/local.secring.asc")
24-
pgpPassphrase := sys.env.get("PGP_PASS").map(_.toCharArray)
15+
sonatypeCredentialHost := "s01.oss.sonatype.org"

travis/secrets.tar.enc

-8.02 KB
Binary file not shown.

0 commit comments

Comments
 (0)