Skip to content

Commit

Permalink
Scala 3.0.0-M2 (#54)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mpilquist authored Nov 27, 2020
1 parent c573649 commit cfc9f4d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 53 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@ 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:
name: Build and Test
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:
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
56 changes: 12 additions & 44 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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")
Expand All @@ -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."))
)
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit cfc9f4d

Please sign in to comment.