Skip to content

Commit

Permalink
Merge pull request #79 from sh0hei/hello-scala3
Browse files Browse the repository at this point in the history
Hello, Scala3 🎉
  • Loading branch information
yanns authored Jun 20, 2021
2 parents 5159482 + e4633e4 commit 73f79ac
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 9 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.14, 2.13.6]
scala: [2.12.14, 2.13.6, 3.0.0]
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.6]
scala: [3.0.0]
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -123,6 +123,16 @@ jobs:
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.0.0)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-3.0.0-${{ matrix.java }}

- name: Inflate target directories (3.0.0)
run: |
tar xf targets.tar
rm targets.tar
- env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
25 changes: 25 additions & 0 deletions HOW-TO-RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Release process

How to create a new [release](../../releases).

## Releasing

The release process is automated thanks to:
- https://github.com/djspiewak/sbt-github-actions#integration-with-sbt-ci-release
- https://github.com/olafurpg/sbt-ci-release

To release, push a git tag:

```
git tag -a v0.1.0 -m "v0.1.0"
git push origin v0.1.0
```
Note that the tag version MUST start with `v`.

Wait for the [CI pipeline](../../actions) to release the new version. Publishing the artifacts on maven central can take time.

## Updating the release notes

Open the [releases](../../releases). A draft should already be prepared.

Edit the draft release to set the released version. Complete the release notes if necessary. And save it.
21 changes: 17 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
val isScala3 = Def.setting(
CrossVersion.partialVersion(scalaVersion.value).exists(_._1 == 3)
)

name := "sangria-monix"
organization := "org.sangria-graphql"
mimaPreviousArtifacts := Set("org.sangria-graphql" %% "sangria-monix" % "2.0.0")

mimaPreviousArtifacts := {
if (isScala3.value)
Set.empty
else
Set("org.sangria-graphql" %% "sangria-monix" % "2.0.0")
}
description := "Sangria monix integration"
homepage := Some(url("https://sangria-graphql.github.io/"))
licenses := Seq(
"Apache License, ASL Version 2.0" url("https://www.apache.org/licenses/LICENSE-2.0"))

ThisBuild / crossScalaVersions := Seq("2.12.14", "2.13.6")
ThisBuild / crossScalaVersions := Seq("2.12.14", "2.13.6", "3.0.0")
ThisBuild / scalaVersion := crossScalaVersions.value.last
ThisBuild / githubWorkflowPublishTargetBranches := List()
ThisBuild / githubWorkflowBuildPreamble ++= List(
WorkflowStep.Sbt(List("mimaReportBinaryIssues"), name = Some("Check binary compatibility")),
WorkflowStep.Sbt(List("scalafmtCheckAll"), name = Some("Check formatting"))
)

scalacOptions ++= Seq("-deprecation", "-feature", "-target:jvm-1.8")
scalacOptions ++= {
if (isScala3.value)
Seq("-Xtarget:8")
else
Seq("-target:jvm-1.8")
} ++ Seq("-deprecation", "-feature")
javacOptions ++= Seq("-source", "8", "-target", "8")

libraryDependencies ++= Seq(
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.2")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1")
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.12.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
6 changes: 3 additions & 3 deletions src/main/scala/sangria/streaming/monix.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ object monix {
Observable.fromFuture(future).mergeMap(resultFn)

def merge[T](streams: Vector[Observable[T]]): Observable[T] =
if (streams.nonEmpty)
Observable(streams: _*).merge
else
if (streams.nonEmpty) {
Observable.merge(streams: _*)
} else
throw new IllegalStateException("No streams produced!")

def recover[T](stream: Observable[T])(fn: Throwable => T): Observable[T] =
Expand Down

0 comments on commit 73f79ac

Please sign in to comment.