From 96b01283df4d66bb00e00a37e90619468a30eb59 Mon Sep 17 00:00:00 2001 From: James Aman Date: Wed, 18 Dec 2024 11:25:20 -0600 Subject: [PATCH] setup for maven publish via github action --- .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ build.sbt | 7 +++++- project/plugins.sbt | 1 + 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e40d31a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release +on: + push: + branches: main + tags: ["*"] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout Metakit repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Checkout Tessellation repo + uses: actions/checkout@v4 + with: + repository: Constellation-Labs/tessellation + ref: v2.12.0 + path: tessellation + + - name: Setup Java, Scala, and SBT + uses: olafurpg/setup-scala@v14 + with: + java-version: openjdk@1.11 + + - name: Build and publish Tessellation artifacts locally + working-directory: tessellation + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + run: sbt publishLocal + + - name: Build and publish Metakit artifacts to Maven + run: sbt ci-release + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/build.sbt b/build.sbt index 5455af2..e3d2cb8 100755 --- a/build.sbt +++ b/build.sbt @@ -2,8 +2,13 @@ import Dependencies.* import sbt.* import sbt.Keys.* -ThisBuild / version := "0.1.0" ThisBuild / organization := "io.constellationnetwork" +ThisBuild / homepage := Some(url("https://github.com/Constellation-Labs/metakit")) +ThisBuild / licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")) + +ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org" +sonatypeRepository := "https://s01.oss.sonatype.org/service/local" + ThisBuild / scalaVersion := "2.13.15" ThisBuild / evictionErrorLevel := Level.Warn ThisBuild / scalafixDependencies += Libraries.organizeImports diff --git a/project/plugins.sbt b/project/plugins.sbt index 6143b7d..57fec77 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -9,5 +9,6 @@ addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.3") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0") addDependencyTreePlugin