Skip to content

Commit

Permalink
Give some love to the project (#150)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
guizmaii authored Feb 11, 2023
1 parent 30aa129 commit ccf6b80
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 43 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
19 changes: 19 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -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
61 changes: 35 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
on:
pull_request:
push:
branches: ['master']
branches: [ 'master' ]
release:
types:
- published
Expand All @@ -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

Expand All @@ -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

Expand All @@ -47,48 +57,47 @@ 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
- name: Run dotty tests
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:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -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 }}
16 changes: 16 additions & 0 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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("."))
Expand All @@ -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"))
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}"
Expand Down
6 changes: 3 additions & 3 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.5.8
sbt.version = 1.8.2
12 changes: 6 additions & 6 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit ccf6b80

Please sign in to comment.