11#! /bin/bash
22
3- echo " Publishing... "
3+ echo " Publishing for branch $TRAVIS_BRANCH JDK: $TRAVIS_JDK_VERSION "
44
55EXIT_STATUS=0
66
7+ # Only JDK8 execution will publish the release
8+ if [ " ${TRAVIS_JDK_VERSION} " == " openjdk11" ] ; then
9+ exit $EXIT_STATUS
10+ fi
11+
712if [[ $TRAVIS_REPO_SLUG == " grails/grails-data-mapping" && $TRAVIS_PULL_REQUEST == ' false' && $EXIT_STATUS -eq 0 ]]; then
813
914 echo " Publishing archives"
@@ -13,20 +18,10 @@ if [[ $TRAVIS_REPO_SLUG == "grails/grails-data-mapping" && $TRAVIS_PULL_REQUEST
1318
1419 export GRADLE_OPTS=" -XX:MaxPermSize=1024m -Xmx1500m -Dfile.encoding=UTF-8"
1520
16- gpg --keyserver keyserver.ubuntu.com --recv-key $SIGNING_KEY
17- if [[ $TRAVIS_TAG =~ ^v[[:digit:]] ]]; then
18- # for releases we upload to Bintray and Sonatype OSS
19- ./gradlew --stop
20- ./gradlew -Psigning.keyId=" $SIGNING_KEY " -Psigning.password=" $SIGNING_PASSPHRASE " -Psigning.secretKeyRingFile=" ${TRAVIS_BUILD_DIR} /secring.gpg" uploadArchives || EXIT_STATUS=$?
21-
22- if [[ $EXIT_STATUS -eq 0 ]]; then
23- ./gradlew --stop
24- ./gradlew -Psigning.keyId=" $SIGNING_KEY " -Psigning.password=" $SIGNING_PASSPHRASE " -Psigning.secretKeyRingFile=" ${TRAVIS_BUILD_DIR} /secring.gpg" publish || EXIT_STATUS=$?
25- fi
21+ if [[ -n $TRAVIS_TAG ]]; then
22+ ./gradlew publish bintrayUpload --no-daemon --stacktrace || EXIT_STATUS=$?
2623 else
27- # for snapshots only to repo.grails.org
28- ./gradlew --stop
29- ./gradlew -Psigning.keyId=" $SIGNING_KEY " -Psigning.password=" $SIGNING_PASSPHRASE " -Psigning.secretKeyRingFile=" ${TRAVIS_BUILD_DIR} /secring.gpg" publish || EXIT_STATUS=$?
24+ ./gradlew publish --no-daemon --stacktrace || EXIT_STATUS=$?
3025 fi
3126
3227 if [[ $EXIT_STATUS -eq 0 ]]; then
@@ -44,25 +39,6 @@ if [[ $TRAVIS_REPO_SLUG == "grails/grails-data-mapping" && $TRAVIS_PULL_REQUEST
4439 git push
4540 cd ..
4641
47- echo " Triggering Hibernate 4 build"
48- git clone https://${GH_TOKEN} @github.com/grails/gorm-hibernate4.git gorm-hibernate4
49- cd gorm-hibernate4
50- echo " $( date) " > .snapshot
51- git add .snapshot
52- git commit -m " New Core Snapshot: $( date) "
53- git push
54- cd ..
55-
56-
57- echo " Triggering REST Client build"
58- git clone https://${GH_TOKEN} @github.com/grails/gorm-rest-client.git gorm-rest-client
59- cd gorm-rest-client
60- echo " $( date) " > .snapshot
61- git add .snapshot
62- git commit -m " New Core Snapshot: $( date) "
63- git push
64- cd ..
65-
6642 echo " Triggering Neo4j build"
6743 git clone https://${GH_TOKEN} @github.com/grails/gorm-neo4j.git gorm-neo4j
6844 cd gorm-neo4j
@@ -85,21 +61,25 @@ if [[ $TRAVIS_REPO_SLUG == "grails/grails-data-mapping" && $TRAVIS_PULL_REQUEST
8561 # If there is a tag present then this becomes the latest
8662 if [[ $TRAVIS_TAG =~ ^v[[:digit:]] ]]; then
8763 echo " Triggering documentation build"
88- git clone https://${GH_TOKEN} @github.com/grails/gorm-docs.git gorm-docs
64+ git clone -b 6.1.x https://${GH_TOKEN} @github.com/grails/gorm-docs.git gorm-docs
8965 cd gorm-docs
9066
91- if [[ $TRAVIS_TAG =~ [M\d | RC\d ] ]]; then
92- echo " gormVersion=${TRAVIS_TAG: 1} " > gradle.properties
93- else
67+ if [[ $TRAVIS_TAG =~ [M\d | RC\d ] ]]; then
68+ echo " gormVersion=${TRAVIS_TAG: 1} " > gradle.properties
69+ else
9470 echo " gormVersion=${TRAVIS_TAG: 1} .RELEASE" > gradle.properties
95- fi
71+ fi
9672
9773 git add gradle.properties
9874 git commit -m " Release $TRAVIS_TAG docs"
9975 git tag $TRAVIS_TAG
10076 git push --tags
10177 git push
10278 cd ..
79+
80+ if [[ $EXIT_STATUS -eq 0 ]]; then
81+ ./gradlew synchronizeWithMavenCentral --no-daemon
82+ fi
10383 fi
10484
10585 else
11191if [[ $EXIT_STATUS -eq 0 ]]; then
11292 echo " Publishing Successful."
11393fi
114- exit $EXIT_STATUS
94+ exit $EXIT_STATUS
0 commit comments