|
9 | 9 | # Checking the local git clone would not work because git on travis does not fetch tags. |
10 | 10 |
|
11 | 11 | # The version number to be published is extracted from the tag, e.g., v1.2.3 publishes |
12 | | -# version 1.2.3 using all Scala versions in build.sbt's `crossScalaVersions`. |
| 12 | +# version 1.2.3 on all combinations of the travis matrix where `[ "$RELEASE_COMBO" = "true" ]`. |
13 | 13 |
|
14 | | -# When a new, binary incompatible Scala version becomes available, a previously released version |
15 | | -# can be released using that new Scala version by creating a new tag containing the Scala and the |
16 | | -# JVM version after hashes, e.g., v1.2.3#2.13.0-M1#8. The JVM version needs to be listed in |
17 | | -# `.travis.yml`, otherwise the required build doesn't run. |
| 14 | +# In order to build a previously released version against a new (binary incompatible) Scala release, |
| 15 | +# a new commit that modifies (and prunes) the Scala versions in .travis.yml needs to be added on top |
| 16 | +# of the existing tag. Then a new tag can be created for that commit, e.g., `v1.2.3#2.13.0-M5`. |
| 17 | +# Everything after the `#` in the tag name is ignored. |
| 18 | + |
| 19 | +if [[ "$TRAVIS_JDK_VERSION" == "openjdk6" && "$TRAVIS_SCALA_VERSION" =~ 2\.11\..* || "$TRAVIS_JDK_VERSION" == "oraclejdk8" && "$TRAVIS_SCALA_VERSION" =~ 2\.1[23]\..* ]]; then |
| 20 | + RELEASE_COMBO=true; |
| 21 | +fi |
| 22 | + |
| 23 | +if [ "$SCALAJS_VERSION" = "" ]; then |
| 24 | + projectPrefix="xml" |
| 25 | +else |
| 26 | + projectPrefix="xmlJS" |
| 27 | +fi |
18 | 28 |
|
19 | 29 | verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?" |
20 | | -tagPat="^v$verPat(#$verPat#[0-9]+)?$" |
| 30 | +tagPat="^v$verPat(#.*)?$" |
21 | 31 |
|
22 | 32 | if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then |
23 | | - currentJvmVer=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | sed 's/^1\.//' | sed 's/[^0-9].*//') |
24 | | - |
25 | 33 | tagVer=$(echo $TRAVIS_TAG | sed s/#.*// | sed s/^v//) |
26 | 34 | publishVersion='set every version := "'$tagVer'"' |
27 | 35 |
|
28 | | - scalaAndJvmVer=$(echo $TRAVIS_TAG | sed s/[^#]*// | sed s/^#//) |
29 | | - if [ "$scalaAndJvmVer" != "" ]; then |
30 | | - scalaVer=$(echo $scalaAndJvmVer | sed s/#.*//) |
31 | | - jvmVer=$(echo $scalaAndJvmVer | sed s/[^#]*// | sed s/^#//) |
32 | | - if [ "$jvmVer" != "$currentJvmVer" ]; then |
33 | | - echo "Not publishing $TRAVIS_TAG on Java version $currentJvmVer." |
34 | | - exit 0 |
35 | | - fi |
36 | | - publishScalaVersion='set every ScalaModulePlugin.scalaVersionsByJvm := Map('$jvmVer' -> List("'$scalaVer'" -> true))' |
37 | | - echo "Releasing $tagVer using Scala $scalaVer on Java version $jvmVer." |
38 | | - else |
39 | | - echo "Releasing $tagVer on Java version $currentJvmVer according to 'scalaVersionsByJvm' in build.sbt." |
40 | | - fi |
| 36 | + if [ "$RELEASE_COMBO" = "true" ]; then |
| 37 | + currentJvmVer=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | sed 's/^1\.//' | sed 's/[^0-9].*//') |
| 38 | + echo "Releasing $tagVer with Scala $TRAVIS_SCALA_VERSION on Java version $currentJvmVer." |
41 | 39 |
|
42 | | - extraTarget="+publish-signed" |
43 | | - cat admin/gpg.sbt >> project/plugins.sbt |
44 | | - cp admin/publish-settings.sbt . |
| 40 | + publishTask="$projectPrefix/publish-signed" |
45 | 41 |
|
46 | | - # Copied from the output of genKeyPair.sh |
47 | | - K=$encrypted_6b8d67feaab7_key |
48 | | - IV=$encrypted_6b8d67feaab7_iv |
| 42 | + cat admin/gpg.sbt >> project/plugins.sbt |
| 43 | + cp admin/publish-settings.sbt . |
49 | 44 |
|
50 | | - openssl aes-256-cbc -K $K -iv $IV -in admin/secring.asc.enc -out admin/secring.asc -d |
| 45 | + # Copied from the output of genKeyPair.sh |
| 46 | + K=$encrypted_6b8d67feaab7_key |
| 47 | + IV=$encrypted_6b8d67feaab7_iv |
| 48 | + openssl aes-256-cbc -K $K -iv $IV -in admin/secring.asc.enc -out admin/secring.asc -d |
| 49 | + fi |
51 | 50 | fi |
52 | 51 |
|
53 | | -sbt "$publishVersion" "$publishScalaVersion" clean update +test +publishLocal $extraTarget |
| 52 | +sbt "++$TRAVIS_SCALA_VERSION" "$publishVersion" "$projectPrefix/clean" "$projectPrefix/test" "$projectPrefix/publishLocal" "$publishTask" |
0 commit comments