From 6979aebb8fc9a019346842ae9a52d7056a89ff7d Mon Sep 17 00:00:00 2001 From: James Aman Date: Wed, 18 Dec 2024 14:20:37 -0600 Subject: [PATCH] setup for maven publish via github action --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ build.sbt | 7 +++++-- project/plugins.sbt | 1 + 3 files changed, 45 insertions(+), 2 deletions(-) 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..b74ee8e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release +on: + push: + 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..51b18b9 100755 --- a/build.sbt +++ b/build.sbt @@ -2,9 +2,12 @@ import Dependencies.* import sbt.* import sbt.Keys.* -ThisBuild / version := "0.1.0" -ThisBuild / organization := "io.constellationnetwork" ThisBuild / scalaVersion := "2.13.15" +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 := "central.sonatype.com" +ThisBuild / versionScheme := Some("early-semver") 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