From 91f5c47fd79d27ab6d4de24057011ee3ae4e4c70 Mon Sep 17 00:00:00 2001 From: Anton Sviridov Date: Thu, 15 Sep 2022 21:19:38 +0100 Subject: [PATCH] Use sbt-ci-release and setup-java GHA --- .github/workflows/ci.yml | 38 +++++++++++++++++--------------------- project/WeaverPlugin.scala | 16 +--------------- project/plugins.sbt | 4 +--- 3 files changed, 19 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f8f60fa..46309077 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - java: [adopt@1.8] + java: [8] scalaVersion: ["2_12", "2_13", "3"] scalaPlatform: ["jvm", "js", "native"] runs-on: ${{ matrix.os }} @@ -33,10 +33,11 @@ jobs: with: extraKey: ${{ env.BUILD_KEY }} - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v10 + - uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: ${{ matrix.java }} + cache: 'sbt' - name: Run tests run: | @@ -71,15 +72,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout current branch - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Cache - uses: coursier/cache-action@v6 - - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v10 + - uses: actions/setup-java@v3 with: - java-version: adopt@1.8 + distribution: 'temurin' + java-version: '8' + cache: 'sbt' - name: Run mdoc run: sbt "docs/mdoc" @@ -87,21 +86,19 @@ jobs: publish: name: Publish needs: [documentation, build] - if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main')) runs-on: ubuntu-latest steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v10 + - uses: actions/setup-java@v3 with: - java-version: adopt@1.8 - - - name: Cache - uses: coursier/cache-action@v6 + distribution: 'temurin' + java-version: '8' + cache: 'sbt' - name: Download compilation cache uses: actions/download-artifact@v2 @@ -113,8 +110,7 @@ jobs: - name: Publish ${{ github.ref }} run: | - echo $PGP_SECRET | base64 --decode | gpg --import --no-tty --batch --yes - sbt 'pullRemoteCache; release' + sbt 'pullRemoteCache; ci-release' env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} PGP_SECRET: ${{ secrets.PGP_SECRET }} @@ -128,7 +124,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 lfs: true diff --git a/project/WeaverPlugin.scala b/project/WeaverPlugin.scala index 33aa42c5..763102f1 100644 --- a/project/WeaverPlugin.scala +++ b/project/WeaverPlugin.scala @@ -375,21 +375,7 @@ object WeaverPlugin extends AutoPlugin { email = "anton.sviridov@disneystreaming.com", url = url("https://github.com/keynmol") ) - ), - credentials ++= - sys.env - .get("SONATYPE_USER") - .zip(sys.env.get("SONATYPE_PASSWORD")) - .map { - case (username, password) => - Credentials( - "Sonatype Nexus Repository Manager", - "oss.sonatype.org", - username, - password - ) - } - .toSeq + ) ) def createBuildCommands(projects: Seq[ProjectReference]) = { diff --git a/project/plugins.sbt b/project/plugins.sbt index c696ed65..b66bf23b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,9 +3,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.1" addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7") addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.0") -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.1.1") -addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.3") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")