From d21091b0492181af76fa7be30f7744400c3ea6fa Mon Sep 17 00:00:00 2001 From: Hanns Holger Rutz Date: Fri, 4 Dec 2020 17:34:43 +0100 Subject: [PATCH 1/2] build.sh: try to support # tags for single Scala version releases again --- build.sh | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 63a0959f..903227d3 100755 --- a/build.sh +++ b/build.sh @@ -14,7 +14,7 @@ set -e # - check out the tag for the version that needs to be published # - change `.travis.yml` to adjust the version numbers and trim down the build matrix as necessary # - commit the changes and tag this new revision with an arbitrary suffix after a hash, e.g., -# `v1.2.3#dotty-0.27` (the suffix is ignored, the version will be `1.2.3`) +# `v1.2.3#3.0.0-M2` (the suffix is ignored, the version will be `1.2.3`) # We release on JDK 8 (for Scala 2.x and 3.x) isReleaseJob() { @@ -25,6 +25,15 @@ isReleaseJob() { fi } +# For tags that define a Scala version, we pick the jobs of one Scala version (2.13.x) to do the releases +isTagScalaReleaseJob() { + if [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^2\.13\.[0-9]+$ ]]; then + true + else + false + fi +} + if [[ "$SCALAJS_VERSION" == "" ]]; then projectPrefix="swing/" else @@ -32,13 +41,23 @@ else fi verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?" -tagPat="^v$verPat(#.*)?$" +tagPat="^v$verPat(#$verPat)?$" if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then releaseTask="ci-release" - if ! isReleaseJob; then - echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION" - exit 0 + tagScalaVer=$(echo $TRAVIS_TAG | sed s/[^#]*// | sed s/^#//) + if [[ "$tagScalaVer" == "" ]]; then + if ! isReleaseJob; then + echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION" + exit 0 + fi + else + if isTagScalaReleaseJob; then + setTagScalaVersion='set every scalaVersion := "'$tagScalaVer'"' + else + echo "The releases for Scala $tagScalaVer are built by other jobs in the travis job matrix" + exit 0 + fi fi fi @@ -51,4 +70,4 @@ export CI_SNAPSHOT_RELEASE="${projectPrefix}publish" # for now, until we're confident in the new release scripts, just close the staging repo. export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose" -sbt clean ${projectPrefix}test ${projectPrefix}publishLocal $releaseTask +sbt "$setTagScalaVersion" clean ${projectPrefix}test ${projectPrefix}publishLocal $releaseTask From 4b3110effe73b4098fdf570f5e6878abc79c7c15 Mon Sep 17 00:00:00 2001 From: Hanns Holger Rutz Date: Sat, 5 Dec 2020 22:26:09 +0100 Subject: [PATCH 2/2] v3.0.0 for Scala 3.0.0-M2 --- .travis.yml | 8 ++++---- build.sh | 31 ++++++------------------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b23b18b..f3d168ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,14 +5,14 @@ import: scala/scala-dev:travis/default.yml language: scala scala: - - 2.11.12 - - 2.12.11 - - 2.13.3 + # - 2.11.12 + # - 2.12.11 + # - 2.13.3 - 3.0.0-M2 env: - ADOPTOPENJDK=8 - - ADOPTOPENJDK=11 + # - ADOPTOPENJDK=11 install: - git fetch --tags # get all tags for sbt-dynver diff --git a/build.sh b/build.sh index 903227d3..63a0959f 100755 --- a/build.sh +++ b/build.sh @@ -14,7 +14,7 @@ set -e # - check out the tag for the version that needs to be published # - change `.travis.yml` to adjust the version numbers and trim down the build matrix as necessary # - commit the changes and tag this new revision with an arbitrary suffix after a hash, e.g., -# `v1.2.3#3.0.0-M2` (the suffix is ignored, the version will be `1.2.3`) +# `v1.2.3#dotty-0.27` (the suffix is ignored, the version will be `1.2.3`) # We release on JDK 8 (for Scala 2.x and 3.x) isReleaseJob() { @@ -25,15 +25,6 @@ isReleaseJob() { fi } -# For tags that define a Scala version, we pick the jobs of one Scala version (2.13.x) to do the releases -isTagScalaReleaseJob() { - if [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^2\.13\.[0-9]+$ ]]; then - true - else - false - fi -} - if [[ "$SCALAJS_VERSION" == "" ]]; then projectPrefix="swing/" else @@ -41,23 +32,13 @@ else fi verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?" -tagPat="^v$verPat(#$verPat)?$" +tagPat="^v$verPat(#.*)?$" if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then releaseTask="ci-release" - tagScalaVer=$(echo $TRAVIS_TAG | sed s/[^#]*// | sed s/^#//) - if [[ "$tagScalaVer" == "" ]]; then - if ! isReleaseJob; then - echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION" - exit 0 - fi - else - if isTagScalaReleaseJob; then - setTagScalaVersion='set every scalaVersion := "'$tagScalaVer'"' - else - echo "The releases for Scala $tagScalaVer are built by other jobs in the travis job matrix" - exit 0 - fi + if ! isReleaseJob; then + echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION" + exit 0 fi fi @@ -70,4 +51,4 @@ export CI_SNAPSHOT_RELEASE="${projectPrefix}publish" # for now, until we're confident in the new release scripts, just close the staging repo. export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose" -sbt "$setTagScalaVersion" clean ${projectPrefix}test ${projectPrefix}publishLocal $releaseTask +sbt clean ${projectPrefix}test ${projectPrefix}publishLocal $releaseTask