diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abc3b3e..0021413 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,72 +29,80 @@ jobs: matrix: os: [ubuntu-latest] scala: [3] - java: [corretto@21] + java: [temurin@21] project: [rootJVM] runs-on: ${{ matrix.os }} timeout-minutes: 60 steps: + - name: Install sbt + if: contains(runner.os, 'macos') + run: brew install sbt + - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup Java (corretto@21) - id: setup-java-corretto-21 - if: matrix.java == 'corretto@21' + - name: Setup Java (temurin@21) + id: setup-java-temurin-21 + if: matrix.java == 'temurin@21' uses: actions/setup-java@v4 with: - distribution: corretto + distribution: temurin java-version: 21 cache: sbt - name: sbt update - if: matrix.java == 'corretto@21' && steps.setup-java-corretto-21.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false' run: sbt +update - name: Check that workflows are up to date run: sbt githubWorkflowCheck - name: Check headers and formatting - if: matrix.java == 'corretto@21' && matrix.os == 'ubuntu-latest' + if: matrix.java == 'temurin@21' && matrix.os == 'ubuntu-latest' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck - name: Test run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test - name: Check binary compatibility - if: matrix.java == 'corretto@21' && matrix.os == 'ubuntu-latest' + if: matrix.java == 'temurin@21' && matrix.os == 'ubuntu-latest' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues - name: Generate API documentation - if: matrix.java == 'corretto@21' && matrix.os == 'ubuntu-latest' + if: matrix.java == 'temurin@21' && matrix.os == 'ubuntu-latest' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc dependency-submission: name: Submit Dependencies - if: github.event_name != 'pull_request' + if: github.event.repository.fork == false && github.event_name != 'pull_request' strategy: matrix: os: [ubuntu-latest] - java: [corretto@21] + java: [temurin@21] runs-on: ${{ matrix.os }} steps: + - name: Install sbt + if: contains(runner.os, 'macos') + run: brew install sbt + - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup Java (corretto@21) - id: setup-java-corretto-21 - if: matrix.java == 'corretto@21' + - name: Setup Java (temurin@21) + id: setup-java-temurin-21 + if: matrix.java == 'temurin@21' uses: actions/setup-java@v4 with: - distribution: corretto + distribution: temurin java-version: 21 cache: sbt - name: sbt update - if: matrix.java == 'corretto@21' && steps.setup-java-corretto-21.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false' run: sbt +update - name: Submit Dependencies @@ -108,25 +116,29 @@ jobs: strategy: matrix: os: [ubuntu-latest] - java: [corretto@21] + java: [temurin@21] runs-on: ${{ matrix.os }} steps: + - name: Install sbt + if: contains(runner.os, 'macos') + run: brew install sbt + - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup Java (corretto@21) - id: setup-java-corretto-21 - if: matrix.java == 'corretto@21' + - name: Setup Java (temurin@21) + id: setup-java-temurin-21 + if: matrix.java == 'temurin@21' uses: actions/setup-java@v4 with: - distribution: corretto + distribution: temurin java-version: 21 cache: sbt - name: sbt update - if: matrix.java == 'corretto@21' && steps.setup-java-corretto-21.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false' run: sbt +update - name: Generate site @@ -134,7 +146,7 @@ jobs: - name: Publish site if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' - uses: peaceiris/actions-gh-pages@v3.9.3 + uses: peaceiris/actions-gh-pages@v4.0.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: site/target/docs/site diff --git a/build.sbt b/build.sbt index cebcc0c..1953de5 100644 --- a/build.sbt +++ b/build.sbt @@ -24,9 +24,9 @@ ThisBuild / githubWorkflowPublishTargetBranches := Seq() // publish website from this branch ThisBuild / tlSitePublishBranch := Some("main") -ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.corretto("21")) +ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("21")) -val Scala3 = "3.3.3" +val Scala3 = "3.5.1" ThisBuild / crossScalaVersions := Seq(Scala3) ThisBuild / scalaVersion := Scala3 // the default Scala @@ -38,18 +38,18 @@ lazy val core = crossProject(JVMPlatform) .settings( name := "scalanews", libraryDependencies ++= Seq( - "org.typelevel" %% "cats-core" % "2.10.0", + "org.typelevel" %% "cats-core" % "2.12.0", "org.typelevel" %% "cats-effect" % "3.5.4", "com.monovore" %% "decline-effect" % "2.4.1", - "com.github.pureconfig" %% "pureconfig-core" % "0.17.6", - "com.github.pureconfig" %% "pureconfig-cats-effect" % "0.17.6", - "org.http4s" %% "http4s-ember-client" % "0.23.26", - "org.http4s" %% "http4s-dsl" % "0.23.26", - "co.fs2" %% "fs2-core" % "3.10.2", - "co.fs2" %% "fs2-io" % "3.10.2", + "com.github.pureconfig" %% "pureconfig-core" % "0.17.7", + "com.github.pureconfig" %% "pureconfig-cats-effect" % "0.17.7", + "org.http4s" %% "http4s-ember-client" % "0.23.28", + "org.http4s" %% "http4s-dsl" % "0.23.28", + "co.fs2" %% "fs2-core" % "3.11.0", + "co.fs2" %% "fs2-io" % "3.11.0", "com.rometools" % "rome" % "2.1.0", - "org.scalameta" %% "munit" % "1.0.0-RC1" % Test, - "org.typelevel" %% "munit-cats-effect" % "2.0.0-M5" % Test + "org.scalameta" %% "munit" % "1.0.2" % Test, + "org.typelevel" %% "munit-cats-effect" % "2.0.0" % Test ), Compile / mainClass := Some("com.softinio.scalanews.Main"), nativeImageVersion := "21.0.1", diff --git a/core/src/main/scala/com/softinio/scalanews/Bloggers.scala b/core/src/main/scala/com/softinio/scalanews/Bloggers.scala index 2c256c5..1c86624 100644 --- a/core/src/main/scala/com/softinio/scalanews/Bloggers.scala +++ b/core/src/main/scala/com/softinio/scalanews/Bloggers.scala @@ -19,7 +19,6 @@ package com.softinio.scalanews import java.util.Date import cats.effect.* import fs2.io.file.* -import fs2.Stream import com.rometools.rome.feed.synd.SyndEntry import scala.jdk.CollectionConverters.* diff --git a/flake.lock b/flake.lock index 80c450b..3c05181 100644 --- a/flake.lock +++ b/flake.lock @@ -2,15 +2,17 @@ "nodes": { "devshell": { "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "typelevel-nix", + "nixpkgs" + ] }, "locked": { - "lastModified": 1708939976, - "narHash": "sha256-O5+nFozxz2Vubpdl1YZtPrilcIXPcRAjqNdNE8oCRoA=", + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", "owner": "numtide", "repo": "devshell", - "rev": "5ddecd67edbd568ebe0a55905273e56cc82aabe3", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", "type": "github" }, "original": { @@ -24,29 +26,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1709126324, - "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "d465f4819400de7c8d874d50b982301f28a84605", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -57,27 +41,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1704161960, - "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "63143ac2c9186be6d9da6035fa22620018c85932", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1710097495, - "narHash": "sha256-B7Ea7q7hU7SE8wOPJ9oXEBjvB89yl2csaLjf5v/7jr8=", + "lastModified": 1725194671, + "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d40e866b1f98698d454dad8f592fe7616ff705a4", + "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", "type": "github" }, "original": { @@ -115,33 +83,18 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "typelevel-nix": { "inputs": { "devshell": "devshell", - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1710188850, - "narHash": "sha256-KbNmyxEvcnq5h/wfeL1ZxO9RwoNRjJ0IgYlUZpdSlLo=", + "lastModified": 1725377366, + "narHash": "sha256-MhIqd8DyUBLrNfAVC/sBhKdfLHCnLWIRbhNIrCf5/lo=", "owner": "typelevel", "repo": "typelevel-nix", - "rev": "60c3868688cb8f5f7ebc781f6e122c061ae35d4d", + "rev": "8cfcc7d06402b98fed90ee4cbb4e10afc2c22bc0", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ca09d74..7b0e482 100644 --- a/flake.nix +++ b/flake.nix @@ -5,12 +5,19 @@ flake-utils.follows = "typelevel-nix/flake-utils"; }; - outputs = { self, nixpkgs, flake-utils, typelevel-nix }: - flake-utils.lib.eachDefaultSystem (system: + outputs = + { + self, + nixpkgs, + flake-utils, + typelevel-nix, + }: + flake-utils.lib.eachDefaultSystem ( + system: let pkgs = import nixpkgs { inherit system; - overlays = [ typelevel-nix.overlay ]; + overlays = [ typelevel-nix.overlays.default ]; }; in { @@ -23,14 +30,14 @@ }; commands = [ { - name = "ni"; - category = "development"; - help = "Create new scalanews executable"; - command = '' - sbt coreJVM/nativeImage - chmod +x scalanews - ./scalanews --help - ''; + name = "ni"; + category = "development"; + help = "Create new scalanews executable"; + command = '' + sbt coreJVM/nativeImage + chmod +x scalanews + ./scalanews --help + ''; } ]; }; diff --git a/project/plugins.sbt b/project/plugins.sbt index 57b5ef8..8dc7852 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,5 @@ +addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "2.0.2") addSbtPlugin("org.scalameta" % "sbt-native-image" % "0.3.4") -addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.0") -addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.7.0") +addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.3") +addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.7.3") addDependencyTreePlugin