-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from guardian/an/release_1_4_0
Changes required to fully and correctly release 1.4.0
- Loading branch information
Showing
2 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,28 @@ val scala213 = "2.13.8" | |
|
||
ThisBuild / scalaVersion := scala213 | ||
|
||
// See below - the release process itself is correctly configured to publish the cross-built | ||
// subprojects, invoking sbt with + or sbt-release with "release cross" only serves to confuse things. | ||
// Always run release as `sbt clean release`! | ||
val checkRunCorrectly = ReleaseStep(action = st => { | ||
val allcommands = (st.history.executed ++ st.currentCommand ++ st.remainingCommands).map(_.commandLine) | ||
val crossCommands = allcommands.exists(_ contains "+") | ||
val releaseCommandWithArgs = allcommands.exists(cmd => cmd.contains("release") && cmd != "release") | ||
|
||
if (crossCommands) { | ||
st.log.error("Don't run release commands with cross building! Try again with 'sbt clean release'.") | ||
sys.exit(1) | ||
} else if (releaseCommandWithArgs) { | ||
st.log.error("Don't run the release command with arguments! Try again with 'sbt clean release'.") | ||
sys.exit(1) | ||
} | ||
|
||
st | ||
}) | ||
|
||
val commonSettings = | ||
Seq( | ||
scalaVersion := scala213, | ||
crossScalaVersions := Seq(scalaVersion.value, scala212), | ||
crossScalaVersions := List(scala212, scala213), | ||
organization := "com.gu", | ||
Test / fork := false, | ||
scalacOptions ++= Seq("-feature", "-deprecation", "-Xfatal-warnings"), | ||
|
@@ -29,14 +47,22 @@ val sonatypeReleaseSettings = { | |
url("https://github.com/guardian/pan-domain-authentication"), | ||
"scm:git:[email protected]:guardian/pan-domain-authentication.git" | ||
)), | ||
homepage := Some(url("https://github.com/guardian/pan-domain-authentication")), | ||
developers := List(Developer( | ||
id = "GuardianEdTools", | ||
name = "Guardian Editorial Tools", | ||
email = "[email protected]", | ||
url = url("https://github.com/orgs/guardian/teams/digital-cms") | ||
)), | ||
releaseCrossBuild := true, | ||
// sbt and sbt-release implement cross-building support differently. sbt does it better | ||
// (it supports each subproject having different crossScalaVersions), so disable sbt-release's | ||
// implementation, and do the publish step with a `+`, | ||
// ie. (`releaseStepCommandAndRemaining("+publishSigned")`) | ||
// See https://www.scala-sbt.org/1.x/docs/Cross-Build.html#Note+about+sbt-release | ||
// Never run with "release cross" or "+release"! Odd things start happening | ||
releaseCrossBuild := false, | ||
releaseProcess := Seq[ReleaseStep]( | ||
checkRunCorrectly, | ||
checkSnapshotDependencies, | ||
inquireVersions, | ||
runClean, | ||
|
@@ -130,7 +156,8 @@ lazy val root = Project("pan-domain-auth-root", file(".")).aggregate( | |
panDomainAuthPlay_2_9, | ||
panDomainAuthPlay_3_0, | ||
exampleApp | ||
).settings( | ||
).settings(sonatypeReleaseSettings) | ||
.settings( | ||
organization := "com.gu", | ||
publishArtifact := false, | ||
publish / skip := true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ThisBuild / version := "1.4.0-SNAPSHOT" | ||
version in ThisBuild := "1.4.1-SNAPSHOT" |