From cfc9f4d14547285c18c10a0ea45ea8443baeb95b Mon Sep 17 00:00:00 2001 From: Michael Pilquist Date: Fri, 27 Nov 2020 17:06:27 -0500 Subject: [PATCH] Scala 3.0.0-M2 (#54) * Prepare for Scala 3.0.0-M2 - need new sbt-spiewak and cats releases first though * More preparation * More preparation * Upgrace to cats 2.3.0 * Update workflow * Bump cats-effect version --- .github/workflows/ci.yml | 15 +++++------ build.sbt | 56 +++++++++------------------------------- project/plugins.sbt | 1 - 3 files changed, 19 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0bdce3..dcd2dfc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,10 @@ on: tags: [v*] env: - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} PGP_SECRET: ${{ secrets.PGP_SECRET }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: build: @@ -27,7 +26,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [0.27.0-RC1, 3.0.0-M1, 2.12.11, 2.13.3] + scala: [3.0.0-M2, 3.0.0-M1, 2.12.11, 2.13.3] java: [adopt@1.8] runs-on: ${{ matrix.os }} steps: @@ -70,7 +69,7 @@ jobs: publish: name: Publish Artifacts needs: [build] - if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') strategy: matrix: os: [ubuntu-latest] @@ -100,12 +99,12 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - name: Download target directories (0.27.0-RC1) + - name: Download target directories (3.0.0-M2) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-0.27.0-RC1-${{ matrix.java }} + name: target-${{ matrix.os }}-3.0.0-M2-${{ matrix.java }} - - name: Inflate target directories (0.27.0-RC1) + - name: Inflate target directories (3.0.0-M2) run: | tar xf targets.tar rm targets.tar diff --git a/build.sbt b/build.sbt index 89bdbcd..ee8112a 100644 --- a/build.sbt +++ b/build.sbt @@ -9,35 +9,23 @@ ThisBuild / organizationName := "Typelevel" ThisBuild / publishGithubUser := "mpilquist" ThisBuild / publishFullName := "Michael Pilquist" -ThisBuild / crossScalaVersions := List("0.27.0-RC1", "3.0.0-M1", "2.12.11", "2.13.3") +ThisBuild / crossScalaVersions := List("3.0.0-M2", "3.0.0-M1", "2.12.11", "2.13.3") ThisBuild / versionIntroduced := Map( - "0.27.0-RC1" -> "0.1.99", // Disable for now due to bug in sbt-spiewak with RCs - "3.0.0-M1" -> "0.1.99" // Disable for now due to bug in sbt-spiewak with RCs + "3.0.0-M1" -> "0.1.99", // Disable for now due to bug in sbt-spiewak with RCs + "3.0.0-M2" -> "0.1.99" // Disable for now due to bug in sbt-spiewak with RCs ) -ThisBuild / githubWorkflowPublishTargetBranches := Seq( - RefPredicate.Equals(Ref.Branch("main")), - RefPredicate.StartsWith(Ref.Tag("v")) -) -ThisBuild / githubWorkflowEnv ++= Map( - "SONATYPE_USERNAME" -> s"$${{ secrets.SONATYPE_USERNAME }}", - "SONATYPE_PASSWORD" -> s"$${{ secrets.SONATYPE_PASSWORD }}", - "PGP_SECRET" -> s"$${{ secrets.PGP_SECRET }}", - "PGP_PASSPHRASE" -> s"$${{ secrets.PGP_PASSPHRASE }}" -) -ThisBuild / githubWorkflowTargetTags += "v*" - -ThisBuild / githubWorkflowPublishPreamble += - WorkflowStep.Run( - List("echo $PGP_SECRET | base64 -d | gpg --import"), - name = Some("Import signing key") - ) +ThisBuild / spiewakCiReleaseSnapshots := true -ThisBuild / githubWorkflowPublish := Seq(WorkflowStep.Sbt(List("release"))) +ThisBuild / spiewakMainBranches := List("main") ThisBuild / homepage := Some(url("https://github.com/typelevel/scalacheck-effect")) +ThisBuild / licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")) + +ThisBuild / scalafmtOnCompile := true + ThisBuild / scmInfo := Some( ScmInfo( url("https://github.com/typelevel/scalacheck-effect"), @@ -48,40 +36,24 @@ ThisBuild / scmInfo := Some( lazy val root = project .in(file(".")) .aggregate(core.jvm, core.js, munit.jvm, munit.js) - .settings(noPublishSettings) - -val commonSettings = Seq( - homepage := Some(url("https://github.com/typelevel/scalacheck-effect")), - licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), - libraryDependencies ++= { - if (isDotty.value) Nil - else Seq(scalafixSemanticdb) - }, - scalafmtOnCompile := true -) + .enablePlugins(NoPublishPlugin, SonatypeCiRelease) lazy val core = crossProject(JSPlatform, JVMPlatform) - .settings(commonSettings) .settings( name := "scalacheck-effect", Compile / scalacOptions ~= { _.filterNot(_ == "-Xfatal-warnings") } // we need to turn this off because scalacheck's API uses Stream, which is deprecated ) - .settings(dottyLibrarySettings) .settings(dottyJsSettings(ThisBuild / crossScalaVersions)) .settings( libraryDependencies ++= List( "org.scalacheck" %%% "scalacheck" % "1.15.1", - "org.typelevel" %%% "cats-core" % "2.3.0-M2" + "org.typelevel" %%% "cats-core" % "2.3.0" ) ) - .jsSettings( - crossScalaVersions := crossScalaVersions.value.filter(_.startsWith("2.")) - ) lazy val munit = crossProject(JSPlatform, JVMPlatform) - .settings(commonSettings) .settings( name := "scalacheck-effect-munit", testFrameworks += new TestFramework("munit.Framework") @@ -90,14 +62,10 @@ lazy val munit = crossProject(JSPlatform, JVMPlatform) scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)) ) .dependsOn(core) - .settings(dottyLibrarySettings) .settings(dottyJsSettings(ThisBuild / crossScalaVersions)) .settings( libraryDependencies ++= List( "org.scalameta" %%% "munit-scalacheck" % "0.7.19", - "org.typelevel" %%% "cats-effect" % "2.3.0-M1" % Test + "org.typelevel" %%% "cats-effect" % "2.3.0" % Test ) ) - .jsSettings( - crossScalaVersions := crossScalaVersions.value.filter(_.startsWith("2.")) - ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 98a4374..2733676 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,4 +3,3 @@ addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "0.18.3") addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.9.5") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.23")