From ccf6b80843f2c1c49cee1fbbae50bc8ee12a1bc4 Mon Sep 17 00:00:00 2001 From: Jules Ivanic Date: Sun, 12 Feb 2023 03:07:32 +0800 Subject: [PATCH] Give some love to the project (#150) * Give some love to the project - Update dependencies - Update sbt and its plugins - Add dependabot to help us maintain the CI scripts (copied from zio-kafka) - Add Scala Steward to help us maintain the project updated (copied from zio-kafka) - Add ReleaseDrafter to automate the changelog (copied from zio-kafka) - Update the CI scripts - Update GraalVM default version in `installer.sh` * Try fix CI --- .github/dependabot.yml | 6 +++ .github/release-drafter.yml | 19 +++++++++ .github/workflows/ci.yml | 61 +++++++++++++++------------ .github/workflows/release-drafter.yml | 13 ++++++ .github/workflows/scala-steward.yml | 16 +++++++ build.sbt | 12 +++--- installer.sh | 2 +- project/BuildHelper.scala | 6 +-- project/build.properties | 2 +- project/plugins.sbt | 12 +++--- 10 files changed, 106 insertions(+), 43 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release-drafter.yml create mode 100644 .github/workflows/scala-steward.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..120c6893 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..7e2bf446 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,19 @@ +name-template: 'v$NEXT_PATCH_VERSION' +tag-template: 'v$NEXT_PATCH_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - title: '🐛 Bug Fixes' + labels: + - 'bug' + - title: '🧰 Maintenance' + labels: + - 'build' + - title: '🌱 Dependency Updates' + labels: + - 'dependency-update' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +template: | + ## Changes + $CHANGES diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55af4cc2..8b1e41da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ env: on: pull_request: push: - branches: ['master'] + branches: [ 'master' ] release: types: - published @@ -18,13 +18,17 @@ jobs: timeout-minutes: 30 steps: - name: Checkout current branch - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup Scala and Java - uses: olafurpg/setup-scala@v10 - name: Cache scala dependencies uses: coursier/cache-action@v6 + - name: Setup Java + uses: actions/setup-java@v3.9.0 + with: + distribution: temurin + java-version: 17 + check-latest: true - name: Lint code run: sbt check @@ -33,11 +37,17 @@ jobs: timeout-minutes: 60 steps: - name: Checkout current branch - uses: actions/checkout@v2.3.4 - - name: Setup Scala and Java - uses: olafurpg/setup-scala@v10 + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Cache scala dependencies uses: coursier/cache-action@v6 + - name: Setup Java + uses: actions/setup-java@v3.9.0 + with: + distribution: temurin + java-version: 17 + check-latest: true - name: Check Document Generation run: sbt docs/compileDocs @@ -47,20 +57,22 @@ jobs: strategy: fail-fast: false matrix: - java: ['adopt@1.8', 'adopt@1.11'] - scala: ['2.12.17', '2.13.9', '3.2.0'] - platform: ['JVM', 'JS', 'Native'] + java: [ '8', '11', '17' ] + scala: [ '2.12.17', '2.13.10', '3.2.2' ] + platform: [ 'JVM', 'JS', 'Native' ] steps: - name: Checkout current branch - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup Scala and Java - uses: olafurpg/setup-scala@v10 - with: - java-version: ${{ matrix.java }} - name: Cache scala dependencies uses: coursier/cache-action@v6 + - name: Setup Java + uses: actions/setup-java@v3.9.0 + with: + distribution: temurin + java-version: ${{ matrix.java }} + check-latest: true - name: Run tests if: ${{ !startsWith(matrix.scala, '3.2.') }} run: sbt ++${{ matrix.scala }}! test @@ -68,27 +80,24 @@ jobs: if: ${{ startsWith(matrix.scala, '3.2.') && matrix.platform == 'JVM' }} run: sbt ++${{ matrix.scala }}! test - ci: - runs-on: ubuntu-20.04 - needs: [lint, website, test] - steps: - - name: Aggregate of lint, and all tests - run: echo "ci passed" - publish: runs-on: ubuntu-20.04 timeout-minutes: 30 - needs: [ci] + needs: [ lint, website, test ] if: github.event_name != 'pull_request' steps: - name: Checkout current branch - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup Scala and Java - uses: olafurpg/setup-scala@v10 - name: Cache scala dependencies uses: coursier/cache-action@v6 + - name: Setup Java + uses: actions/setup-java@v3.9.0 + with: + distribution: temurin + java-version: 17 + check-latest: true - name: Release artifacts run: sbt ci-release env: diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 00000000..58bddceb --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,13 @@ +name: Release Drafter + +on: + push: + branches: ['master'] + +jobs: + update_release_draft: + runs-on: ubuntu-20.04 + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/scala-steward.yml b/.github/workflows/scala-steward.yml new file mode 100644 index 00000000..a9d59b2f --- /dev/null +++ b/.github/workflows/scala-steward.yml @@ -0,0 +1,16 @@ +name: Scala Steward + +# This workflow will launch everyday at 00:00 +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: {} + +jobs: + scala-steward: + timeout-minutes: 45 + runs-on: ubuntu-latest + name: Scala Steward + steps: + - name: Scala Steward + uses: scala-steward-org/scala-steward-action@v2.49.0 diff --git a/build.sbt b/build.sbt index d056ee8e..99da6196 100644 --- a/build.sbt +++ b/build.sbt @@ -28,7 +28,7 @@ inThisBuild( addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt") addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck") -val zioVersion = "2.0.0" +val zioVersion = "2.0.6" lazy val root = project .in(file(".")) @@ -52,10 +52,10 @@ lazy val zioCli = crossProject(JSPlatform, JVMPlatform) .settings( libraryDependencies ++= Seq( "dev.zio" %% "zio" % zioVersion, - "dev.zio" %% "zio-process" % "0.7.0", + "dev.zio" %% "zio-process" % "0.7.1", "dev.zio" %% "zio-streams" % zioVersion, - "dev.zio" %% "zio-test" % zioVersion % "test", - "dev.zio" %% "zio-test-sbt" % zioVersion % "test" + "dev.zio" %% "zio-test" % zioVersion % Test, + "dev.zio" %% "zio-test-sbt" % zioVersion % Test ) ) .settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework")) @@ -107,9 +107,9 @@ lazy val sbtZioCli = project .settings( name := "sbt-zio-cli", organization := "zio.cli.sbt", - scalaVersion := "2.12.14", + scalaVersion := "2.12.17", version := "0.0.0-SNAPSHOT", - addSbtPlugin("org.scalameta" %% "sbt-native-image" % "0.2.2") + addSbtPlugin("org.scalameta" %% "sbt-native-image" % "0.3.2") ) .enablePlugins(SbtPlugin) diff --git a/installer.sh b/installer.sh index 24b77618..d3a696a1 100644 --- a/installer.sh +++ b/installer.sh @@ -19,7 +19,7 @@ version="VERSION" downloadUrl="DOWNLOAD_URL" shouldEnsureNativeImage="${ENSURE_NATIVE_IMAGE}" -graalvmVersion="${GRAALVM_VERSION:-22.3.0}" +graalvmVersion="${GRAALVM_VERSION:-22.3.1}" javaVersion="${GRAALVM_JAVA_VERSION:-java8}" xdgUsrHome="${XDG_DATA_HOME:-"$HOME/.local/share"}" diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index 6853f57e..5f8833f5 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -12,10 +12,10 @@ import scalafix.sbt.ScalafixPlugin.autoImport._ object BuildHelper { private val Scala212 = "2.12.17" - private val Scala213 = "2.13.9" - val Scala3 = "3.2.0" + private val Scala213 = "2.13.10" + val Scala3 = "3.2.2" - val SilencerVersion = "1.7.11" + val SilencerVersion = "1.7.12" def buildInfoSettings(packageName: String) = Seq( diff --git a/project/build.properties b/project/build.properties index f4f743cc..f344c148 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.5.8 +sbt.version = 1.8.2 diff --git a/project/plugins.sbt b/project/plugins.sbt index 5e60f62c..25a49ef0 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,16 +2,16 @@ addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.3") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11") addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.0") -addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0") +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.0") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.2") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") -addSbtPlugin("org.scalameta" % "sbt-native-image" % "0.3.1") +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.4") +addSbtPlugin("org.scalameta" % "sbt-native-image" % "0.3.2") addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.6") resolvers += Resolver.sonatypeRepo("public")