|
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 | +RELEASE_COMBO=true |
18 | 20 |
|
19 | 21 | verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
|
20 |
| -tagPat="^v$verPat(#$verPat#[0-9]+)?$" |
| 22 | +tagPat="^v$verPat(#.*)?$" |
21 | 23 |
|
22 | 24 | 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 | 25 | tagVer=$(echo $TRAVIS_TAG | sed s/#.*// | sed s/^v//)
|
26 | 26 | publishVersion='set every version := "'$tagVer'"'
|
27 | 27 |
|
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 |
| 28 | + if [ "$RELEASE_COMBO" = "true" ]; then |
| 29 | + currentJvmVer=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | sed 's/^1\.//' | sed 's/[^0-9].*//') |
| 30 | + echo "Releasing $tagVer with Scala $TRAVIS_SCALA_VERSION on Java version $currentJvmVer." |
41 | 31 |
|
42 |
| - extraTarget="+publish-signed" |
43 |
| - cat admin/gpg.sbt >> project/plugins.sbt |
44 |
| - cp admin/publish-settings.sbt . |
| 32 | + publishTask="publish-signed" |
45 | 33 |
|
46 |
| - # Copied from the output of genKeyPair.sh |
47 |
| - K=$encrypted_1ce132863fa7_key |
48 |
| - IV=$encrypted_1ce132863fa7_iv |
| 34 | + cat admin/gpg.sbt >> project/plugins.sbt |
| 35 | + cp admin/publish-settings.sbt . |
49 | 36 |
|
50 |
| - openssl aes-256-cbc -K $K -iv $IV -in admin/secring.asc.enc -out admin/secring.asc -d |
| 37 | + # Copied from the output of genKeyPair.sh |
| 38 | + K=$encrypted_1ce132863fa7_key |
| 39 | + IV=$encrypted_1ce132863fa7_iv |
| 40 | + openssl aes-256-cbc -K $K -iv $IV -in admin/secring.asc.enc -out admin/secring.asc -d |
| 41 | + fi |
51 | 42 | fi
|
52 | 43 |
|
53 |
| -sbt "$publishVersion" "$publishScalaVersion" clean update +test +publishLocal $extraTarget |
| 44 | +sbt "++$TRAVIS_SCALA_VERSION" "$publishVersion" clean test publishLocal "$publishTask" |
0 commit comments