diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index 6abcf88b..3c71c611 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -18,27 +18,36 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Cache jabba - uses: actions/cache@v3.2.4 + - uses: actions/setup-java@v3 with: - path: ~/.jabba - key: ${{ runner.os }}-jabba-cache-${{ hashFiles('**/workflows/scala.yml') }} + distribution: temurin + java-version: 17 - - name: Cache SBT ivy cache - uses: actions/cache@v3.2.4 - with: - path: ~/.ivy2/cache - key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }} - - - name: Cache SBT - uses: actions/cache@v3.2.4 + - name: Test + run: sbt ++${{matrix.scala}} test + + publish: + name: Publish Artifacts + needs: [test] + if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 with: - path: ~/.sbt - key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} + fetch-depth: 0 - - uses: olafurpg/setup-scala@v13 + - uses: actions/setup-java@v3 with: - java-version: graalvm@21.0.0=tgz+https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.0.0/graalvm-ce-java11-linux-amd64-21.0.0.tar.gz - - - name: Test - run: sbt ++${{matrix.scala}} test + distribution: temurin + java-version: 17 + + - name: coursier-cache + uses: coursier/cache-action@v6 + + - name: Publish artifacts + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + run: sbt ci-release diff --git a/build.sbt b/build.sbt index ae0b6df5..747f5c45 100644 --- a/build.sbt +++ b/build.sbt @@ -9,7 +9,6 @@ lazy val scala3 = "3.3.0" ThisBuild / scalaVersion := scala3 lazy val commonSettings = Seq( - version := "0.28.4", organization := "com.tethys-json", licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")), homepage := Some(url("https://github.com/tethys-json/tethys")), @@ -39,16 +38,6 @@ lazy val commonSettings = Seq( url = url("https://github.com/MrIrre") ) ), - credentials ++= Option(Path.userHome / ".config" / "sbt" / ".tethys-credentials") - .filter(_.exists()) - .map(Credentials(_)), - publishMavenStyle := true, - publishTo := { - if (isSnapshot.value) - Opts.resolver.sonatypeOssSnapshots.headOption - else - sonatypePublishToBundle.value - }, Test / publishArtifact := false ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 70cb7b59..a6b04437 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,2 @@ -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.4") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.18") -addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") \ No newline at end of file +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.4") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")