14
14
# - check out the tag for the version that needs to be published
15
15
# - change `.travis.yml` to adjust the version numbers and trim down the build matrix as necessary
16
16
# - commit the changes and tag this new revision with an arbitrary suffix after a hash, e.g.,
17
- # `v1.2.3#dotty-0.27 ` (the suffix is ignored, the version will be `1.2.3`)
17
+ # `v1.2.3#3.0.0-M2 ` (the suffix is ignored, the version will be `1.2.3`)
18
18
19
19
# We release on JDK 8 (for Scala 2.x and 3.x)
20
20
isReleaseJob () {
@@ -25,20 +25,39 @@ isReleaseJob() {
25
25
fi
26
26
}
27
27
28
+ # For tags that define a Scala version, we pick the jobs of one Scala version (2.13.x) to do the releases
29
+ isTagScalaReleaseJob () {
30
+ if [[ " $ADOPTOPENJDK " == " 8" && " $TRAVIS_SCALA_VERSION " =~ ^2\. 13\. [0-9]+$ ]]; then
31
+ true
32
+ else
33
+ false
34
+ fi
35
+ }
36
+
28
37
if [[ " $SCALAJS_VERSION " == " " ]]; then
29
38
projectPrefix=" swing/"
30
39
else
31
40
projectPrefix=" swingJS/"
32
41
fi
33
42
34
43
verPat=" [0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
35
- tagPat=" ^v$verPat (#.* )?$"
44
+ tagPat=" ^v$verPat (#$verPat )?$"
36
45
37
46
if [[ " $TRAVIS_TAG " =~ $tagPat ]]; then
38
47
releaseTask=" ci-release"
39
- if ! isReleaseJob; then
40
- echo " Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION "
41
- exit 0
48
+ tagScalaVer=$( echo $TRAVIS_TAG | sed s/[^# ]*// | sed s/^#//)
49
+ if [[ " $tagScalaVer " == " " ]]; then
50
+ if ! isReleaseJob; then
51
+ echo " Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION "
52
+ exit 0
53
+ fi
54
+ else
55
+ if isTagScalaReleaseJob; then
56
+ setTagScalaVersion=' set every scalaVersion := "' $tagScalaVer ' "'
57
+ else
58
+ echo " The releases for Scala $tagScalaVer are built by other jobs in the travis job matrix"
59
+ exit 0
60
+ fi
42
61
fi
43
62
fi
44
63
@@ -51,4 +70,4 @@ export CI_SNAPSHOT_RELEASE="${projectPrefix}publish"
51
70
# for now, until we're confident in the new release scripts, just close the staging repo.
52
71
export CI_SONATYPE_RELEASE= " ; sonatypePrepare; sonatypeBundleUpload; sonatypeClose"
53
72
54
- sbt clean ${projectPrefix} test ${projectPrefix} publishLocal $releaseTask
73
+ sbt " $setTagScalaVersion " clean ${projectPrefix} test ${projectPrefix} publishLocal $releaseTask
0 commit comments