Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ci-release #289

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
Loading