Skip to content
This repository was archived by the owner on Jun 23, 2020. It is now read-only.

[WIP] release for Scala 2.12.1 #29

Merged
merged 2 commits into from
Apr 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 27 additions & 8 deletions admin/build.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
#!/bin/bash

# prep environment for publish to sonatype staging if the HEAD commit is tagged
set -e

# git on travis does not fetch tags, but we have TRAVIS_TAG
# headTag=$(git describe --exact-match ||:)
# Builds of tagged revisions are published to sonatype staging.

if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)? ]]; then
# Travis runs a build on new revisions and on new tags, so a tagged revision is built twice.
# Builds for a tag have TRAVIS_TAG defined, which we use for identifying tagged builds.
# Checking the local git clone would not work because git on travis does not fetch tags.

# The version number to be published is extracted from the tag, e.g., v1.2.3 publishes
# version 1.2.3 using all Scala versions in build.sbt's `crossScalaVersions`.

# When a new, binary incompatible Scala version becomes available, a previously released version
# can be released using that new Scala version by creating a new tag containing the Scala version
# after a hash, e.g., v1.2.3#2.13.0-M1.

verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
tagPat="^v$verPat(#$verPat)?$"

if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
echo "Going to release from tag $TRAVIS_TAG!"
myVer=$(echo $TRAVIS_TAG | sed -e s/^v//)
publishVersion='set every version := "'$myVer'"'

tagVer=$(echo $TRAVIS_TAG | sed s/#.*// | sed s/^v//)
publishVersion='set every version := "'$tagVer'"'
scalaVer=$(echo $TRAVIS_TAG | sed s/[^#]*// | sed s/^#//)
if [ "$scalaVer" != "" ]; then
publishScalaVersion='set every crossScalaVersions := Seq("'$scalaVer'")'
fi
extraTarget="+publish-signed"
cat admin/gpg.sbt >> project/plugins.sbt
admin/decrypt.sh sensitive.sbt
(cd admin/ && ./decrypt.sh secring.asc)
fi
# the concurrentRestrictions should prevent spurious test failures, see https://github.com/spray/spray/pull/233
sbt "$publishVersion" clean update +compile +test +publishLocal $extraTarget
sbt "$publishVersion" "$publishScalaVersion" clean update +test +publishLocal $extraTarget
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ lazy val commonSettings = scalaModuleSettings ++ Seq(
if (java.startsWith("1.6.") || java.startsWith("1.7."))
Seq("2.11.8")
else if (java.startsWith("1.8.") || java.startsWith("1.9."))
Seq("2.12.0")
Seq("2.12.0", "2.12.1")
else
sys.error(s"don't know what Scala versions to build on $java")
},
Expand Down Expand Up @@ -63,8 +63,8 @@ lazy val library = project settings (scalaModuleOsgiSettings: _*) settings (Mima
s"-Jdummy=${pluginJar.value.lastModified}"),
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-compiler" % scalaVersion.value % "test",
"junit" % "junit" % "4.11" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"),
"junit" % "junit" % "4.12" % "test",
"com.novocode" % "junit-interface" % "0.11" % "test"),
testOptions += Tests.Argument(
TestFrameworks.JUnit,
s"-Dscala-continuations-plugin.jar=${pluginJar.value.getAbsolutePath}"
Expand Down