From 9425dbbedb89e829e9e09a1a8f8f5886b8323ae7 Mon Sep 17 00:00:00 2001 From: Sylvain Carisey Date: Fri, 6 Sep 2024 17:25:54 +0200 Subject: [PATCH] ci(publish nexus):workflow for publishing to nexus Signed-off-by: Sylvain Carisey --- .github/workflows/nexus-release.yml | 30 +++++++++++++++++++++++++++++ build.sbt | 11 ++++++++++- project/plugins.sbt | 2 +- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/nexus-release.yml diff --git a/.github/workflows/nexus-release.yml b/.github/workflows/nexus-release.yml new file mode 100644 index 0000000..af255e7 --- /dev/null +++ b/.github/workflows/nexus-release.yml @@ -0,0 +1,30 @@ +name: Release +on: + workflow_dispatch: + push: + branches: + - 'feat/**' #will publish snapshots +# - 'main' #will also publish snapshots - useful before releasing + tags: + - '**' #will publish a release +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + cache: sbt + - name: Tests + run: sbt test + - name: Release + run: sbt ci-release + env: + PGP_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + PGP_SECRET : ${{ secrets.GPG_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.NEXUS_USERNAME }} diff --git a/build.sbt b/build.sbt index b114f97..1288db8 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,17 @@ ThisBuild / scalaVersion := "2.13.14" -ThisBuild / organization := "com.lectra.kafka" +ThisBuild / organization := "com.lectra.kapoeira" ThisBuild / organizationName := "lectra" +ThisBuild / licenses += "Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt") ThisBuild / publishConfiguration := publishConfiguration.value.withOverwrite(true) ThisBuild / publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true) +ThisBuild / scmInfo := Some( + ScmInfo( + url("https://github.com/lectra-tech/kapoeira"), + "scm:git:git@github.com/lectra-tech/kapoeira.git" + ) +) +ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" +sonatypeRepository := "https://s01.oss.sonatype.org/service/local" resolvers += "confluent" at "https://packages.confluent.io/maven/" diff --git a/project/plugins.sbt b/project/plugins.sbt index 5e980a5..3f98a49 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.1") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.2.0") -addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.1")