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