Skip to content

Commit

Permalink
branch-merge-5.0.x (f5c914b) (#528)
Browse files Browse the repository at this point in the history
branch-merge-5.0.x (f5c914b)
  • Loading branch information
octonato authored Dec 19, 2019
2 parents eeaf98e + 3b561c6 commit d5af795
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 18 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ scala:
- 2.12.10
- 2.13.1


git:
depth: false # Avoid sbt-dynver not seeing the tag

env:
- TRAVIS_JDK=8
- TRAVIS_JDK=11
Expand Down
17 changes: 5 additions & 12 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,22 @@ Releasing a new version of play-slick is truly simple.
* Log in vegemite.
* type `sudo su - play`, and enter your account's password.
* type `cd deploy`.
* and finally type `./release --project play-slick --branch <branch-to-release>`, where <branch-to-release> is the name of the branch you want to release.
* and finally type `./release --project play-slick --branch <branch-to-release> --tag <tag-name>`, where <branch-to-release> is the name of the branch you want to release and <tag-name> is the version tag.

That will start the build. The output should be similar to

```
play ▶ [] ~/deploy$ ./release --project play-slick --branch master
```shell
play ▶ [] ~/deploy$ ./release --project play-slick --branch master --tag 5.0.0
This will release play-slick from branch master using JDK8, continue? [y/n] y
java version "1.8.0_31"
...
```

The script will eventually stop and ask you the version number of the release, and the next version you want your branch to be moved to.

```
...
Release version [1.0.1] :
Next version [1.0.2-SNAPSHOT] :
```
Type ENTER if the version between square brackets suits you. If it doesn't, provide the desired version to release.

Once the binaries are successfully deployed, you will be prompted if you wish to push your changes to the remote repository:

```
```shell
...
[info] Dropping staging repository [comtypesafe-1354] status:released, profile:com.typesafe(34c112e991655)
[info] Dropped successfully: comtypesafe-1354
Expand All @@ -45,4 +38,4 @@ Once the binaries are successfully deployed, you will be prompted if you wish to
Push changes to the remote repository (y/n)? [y]
```

Typing `y` will create a tag in the remote repository and push a commit to update the branch version number.
Typing `y` will create a tag in the remote repository and push a commit to update the branch version number.
37 changes: 32 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ import interplay.ScalaVersions._

resolvers in ThisBuild += Resolver.sonatypeRepo("releases")

// Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed
dynverVTagPrefix in ThisBuild := false

// Sanity-check: assert that version comes from a tag (e.g. not a too-shallow clone)
// https://github.com/dwijnand/sbt-dynver/#sanity-checking-the-version
Global / onLoad := (Global / onLoad).value.andThen { s =>
val v = version.value
if (dynverGitDescribeOutput.value.hasNoTags)
throw new MessageOnlyException(
s"Failed to derive version from git tags. Maybe run `git fetch --unshallow`? Version: $v"
)
s
}

lazy val commonSettings = Seq(
// Work around https://issues.scala-lang.org/browse/SI-9311
scalacOptions ~= (_.filterNot(_ == "-Xfatal-warnings")),
Expand All @@ -19,6 +33,22 @@ lazy val `play-slick-root` = (project in file("."))
`play-slick-evolutions`
)
.settings(commonSettings)
.settings(
Seq(
// this overrides releaseProcess to make it work with sbt-dynver
releaseProcess := {
import ReleaseTransformations._
Seq[ReleaseStep](
checkSnapshotDependencies,
runClean,
releaseStepCommandAndRemaining("+test"),
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
pushChanges // <- this needs to be removed when releasing from tag
)
}
)
)

lazy val `play-slick` = (project in file("src/core"))
.enablePlugins(PlayLibrary, Playdoc)
Expand Down Expand Up @@ -49,15 +79,12 @@ playBuildExtraTests := {
}

// Binary compatibility is tested against this version
val previousVersion: Option[String] = None
val previousVersion: Option[String] = Some("5.0.0")

ThisBuild / mimaFailOnNoPrevious := false

def mimaSettings = mimaDefaultSettings ++ Seq(
mimaPreviousArtifacts := previousVersion.fold(Set.empty[ModuleID]) { pv =>
if (scala213.equals(scalaVersion.value)) Set.empty
else Set(organization.value % moduleName.value % pv)
}
mimaPreviousArtifacts := previousVersion.map(organization.value %% moduleName.value % _).toSet
)

lazy val samples = project
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ addSbtPlugin("com.typesafe.play" % "interplay" % sys.props.get("inter

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1")

addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
1 change: 0 additions & 1 deletion version.sbt

This file was deleted.

0 comments on commit d5af795

Please sign in to comment.