Skip to content

Commit

Permalink
Merge pull request #289 from tethys-json/ci-release
Browse files Browse the repository at this point in the history
Add ci-release
  • Loading branch information
dos65 committed May 3, 2024
2 parents 6d72556 + 392ed4e commit 1c9c556
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 33 deletions.
47 changes: 28 additions & 19 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,36 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Cache jabba
uses: actions/[email protected]
- 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/[email protected]
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }}

- name: Cache SBT
uses: actions/[email protected]
- 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: [email protected]=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
11 changes: 0 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down Expand Up @@ -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
)

Expand Down
5 changes: 2 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.4")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")

0 comments on commit 1c9c556

Please sign in to comment.