diff --git a/.github/mergify.yml b/.github/mergify.yml index 99a4cd9..04ad6c9 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -13,13 +13,17 @@ pull_request_rules: add: [bug] - name: Add label to scala-steward PRs conditions: - - author=scala-steward + - author=usommerl + - title~=(?i)Update + - body~=(?i)Configure Scala Steward for your repository actions: label: add: [dependency-update] - name: Automatically merge Scala Steward PRs on CI success conditions: - - author=scala-steward + - author=usommerl + - title~=(?i)Update + - body~=(?i)Configure Scala Steward for your repository - status-success=ci actions: merge: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 95b5b88..da8db82 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,16 +7,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.2 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: 11 - name: Run tests run: sbt coverage test coverageReport - name: Upload coverage reports - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: fail_ci_if_error: true verbose: true @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.2 - name: Create GitHub release draft uses: release-drafter/release-drafter@v5 env: @@ -39,14 +39,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3.0.2 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: 11 - name: Login to GitHub Container Registry - uses: docker/login-action@v1.13.0 + uses: docker/login-action@v2.0.0 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -64,7 +64,7 @@ jobs: docker tag $IMAGE_GHCR $IMAGE_GCR echo "image_gcr=$IMAGE_GCR" >> $GITHUB_ENV - name: Login to Google Container Registry - uses: docker/login-action@v1.13.0 + uses: docker/login-action@v2.0.0 with: registry: eu.gcr.io username: _json_key diff --git a/.scalafmt.conf b/.scalafmt.conf index 28b3d1f..03fbe60 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.4.3" +version = "3.5.9" maxColumn = 140 align.preset = most diff --git a/Dockerfile b/Dockerfile index 892ac68..19f6c76 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/graalvm/graalvm-ce:ol8-java17-22.0.0.2 as builder +FROM ghcr.io/graalvm/graalvm-ce:ol8-java17-22.2.0 as builder ARG upx_compression ARG print_reports @@ -18,8 +18,8 @@ RUN mkdir ${TOOLCHAIN_DIR} && \ ENV PATH="$PATH:${TOOLCHAIN_DIR}/bin" ENV CC="${TOOLCHAIN_DIR}/bin/gcc" - -RUN curl -L -o zlib.tar.gz https://zlib.net/zlib-1.2.11.tar.gz && \ + +RUN curl -L -o zlib.tar.gz https://zlib.net/fossils/zlib-1.2.12.tar.gz && \ mkdir zlib && tar -xvzf zlib.tar.gz -C zlib --strip-components 1 && cd zlib && \ ./configure --static --prefix=${TOOLCHAIN_DIR} && \ make && make install && \ diff --git a/build.sbt b/build.sbt index c86ac0b..b7e57fd 100644 --- a/build.sbt +++ b/build.sbt @@ -3,11 +3,12 @@ ThisBuild / organization := "dev.usommerl" ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.6.0" val v = new { - val circe = "0.14.1" - val ciris = "2.3.2" - val http4s = "0.23.10" + val apispec = "0.2.1" + val circe = "0.14.2" + val ciris = "2.3.3" + val http4s = "0.23.15" val odin = "0.13.0" - val tapir = "0.19.4" + val tapir = "1.0.6" val munit = "0.7.29" val munitCE = "1.0.7" } @@ -21,27 +22,27 @@ lazy val graalnative4s = project scalacOptions ++= Seq("-Xsource:3"), libraryDependencies ++= Seq( compilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1"), - "com.softwaremill.sttp.tapir" %% "tapir-core" % v.tapir, - "com.softwaremill.sttp.tapir" %% "tapir-http4s-server" % v.tapir, - "com.softwaremill.sttp.tapir" %% "tapir-json-circe" % v.tapir, - "com.softwaremill.sttp.tapir" %% "tapir-openapi-docs" % v.tapir, - "com.softwaremill.sttp.tapir" %% "tapir-openapi-circe-yaml" % v.tapir, - "com.softwaremill.sttp.tapir" %% "tapir-refined" % v.tapir, - "com.softwaremill.sttp.tapir" %% "tapir-swagger-ui" % v.tapir, - "com.github.valskalla" %% "odin-core" % v.odin, - "com.github.valskalla" %% "odin-json" % v.odin, - "com.github.valskalla" %% "odin-slf4j" % v.odin, - "io.circe" %% "circe-core" % v.circe, - "io.circe" %% "circe-generic" % v.circe, - "io.circe" %% "circe-parser" % v.circe, - "io.circe" %% "circe-literal" % v.circe, - "is.cir" %% "ciris" % v.ciris, - "is.cir" %% "ciris-refined" % v.ciris, - "org.http4s" %% "http4s-ember-server" % v.http4s, - "org.http4s" %% "http4s-circe" % v.http4s, - "org.http4s" %% "http4s-dsl" % v.http4s, - "org.scalameta" %% "munit" % v.munit % Test, - "org.typelevel" %% "munit-cats-effect-3" % v.munitCE % Test + "com.softwaremill.sttp.apispec" %% "openapi-circe-yaml" % v.apispec, + "com.softwaremill.sttp.tapir" %% "tapir-core" % v.tapir, + "com.softwaremill.sttp.tapir" %% "tapir-http4s-server" % v.tapir, + "com.softwaremill.sttp.tapir" %% "tapir-json-circe" % v.tapir, + "com.softwaremill.sttp.tapir" %% "tapir-openapi-docs" % v.tapir, + "com.softwaremill.sttp.tapir" %% "tapir-refined" % v.tapir, + "com.softwaremill.sttp.tapir" %% "tapir-swagger-ui" % v.tapir, + "com.github.valskalla" %% "odin-core" % v.odin, + "com.github.valskalla" %% "odin-json" % v.odin, + "com.github.valskalla" %% "odin-slf4j" % v.odin, + "io.circe" %% "circe-core" % v.circe, + "io.circe" %% "circe-generic" % v.circe, + "io.circe" %% "circe-parser" % v.circe, + "io.circe" %% "circe-literal" % v.circe, + "is.cir" %% "ciris" % v.ciris, + "is.cir" %% "ciris-refined" % v.ciris, + "org.http4s" %% "http4s-ember-server" % v.http4s, + "org.http4s" %% "http4s-circe" % v.http4s, + "org.http4s" %% "http4s-dsl" % v.http4s, + "org.scalameta" %% "munit" % v.munit % Test, + "org.typelevel" %% "munit-cats-effect-3" % v.munitCE % Test ), testFrameworks += new TestFramework("munit.Framework"), buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion, Test / libraryDependencies), diff --git a/project/build.properties b/project/build.properties index c8fcab5..22af262 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.2 +sbt.version=1.7.1 diff --git a/project/plugins.sbt b/project/plugins.sbt index e1e868d..fdf4b4c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,9 @@ -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.34") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.1") addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") -addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.9") -addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.22") +addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.11") +addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.1") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3") -addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.8.3") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.2") +addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.9.0") diff --git a/src/main/resources/META-INF/native-image/native-image.properties b/src/main/resources/META-INF/native-image/native-image.properties index 4334749..f406793 100644 --- a/src/main/resources/META-INF/native-image/native-image.properties +++ b/src/main/resources/META-INF/native-image/native-image.properties @@ -1,5 +1,4 @@ -Args = --verbose \ - --no-server \ +Args = --no-server \ --no-fallback \ --static \ --libc=musl \ diff --git a/src/main/scala/app/Api.scala b/src/main/scala/app/Api.scala index 3303a9b..a93976d 100644 --- a/src/main/scala/app/Api.scala +++ b/src/main/scala/app/Api.scala @@ -15,14 +15,16 @@ import org.http4s.headers.Location import org.http4s.implicits._ import org.http4s.server.middleware.CORS import sttp.model.StatusCode +import sttp.apispec.openapi.OpenAPI +import sttp.apispec.Tag +import sttp.apispec.openapi.Info as OpenApiInfo +import sttp.apispec.openapi.Server +import sttp.apispec.openapi.circe.yaml._ import sttp.tapir._ -import sttp.tapir.apispec.Tag import sttp.tapir.codec.refined._ import sttp.tapir.docs.openapi._ import sttp.tapir.generic.auto._ import sttp.tapir.json.circe.jsonBody -import sttp.tapir.openapi.{OpenAPI, Server} -import sttp.tapir.openapi.circe.yaml._ import sttp.tapir.server.ServerEndpoint import sttp.tapir.server.http4s.Http4sServerInterpreter import sttp.tapir.swagger.SwaggerUI @@ -36,7 +38,7 @@ object Api { val apis: List[TapirApi[F]] = List(Examples()) val docs: OpenAPI = OpenAPIDocsInterpreter() - .toOpenAPI(apis.flatMap(_.endpoints), openapi.Info(BuildInfo.name, BuildInfo.version, config.description)) + .toOpenAPI(apis.flatMap(_.endpoints), OpenApiInfo(BuildInfo.name, BuildInfo.version, config.description)) .servers(List(Server(config.serverUrl))) .tags(apis.map(_.tag))