@@ -121,7 +121,6 @@ stage('QA') {
121121stage(' Publish' ) {
122122 if (env. BRANCH_NAME == " master" ) {
123123 node {
124- checkout scm // re-checkout to be able to git tag
125124 unstash name : ' built'
126125 // read the version name and determine if it is a release build
127126 version = readFile(' VERSION' ). trim()
@@ -132,37 +131,9 @@ stage('Publish') {
132131 sh ' ./gradlew -Dsigning.keyId=$KEY_ID -Dsigning.password=$KEY_PASSWORD -Dsigning.secretKeyRingFile=$SIGNING_FILE -DossrhUsername=$OSSRH_USER -DossrhPassword=$OSSRH_PASSWORD upload'
133132 }
134133
135- // if it is a release build then do the git tagging
136- if (isReleaseVersion) {
137-
138- // Read the CHANGES.md to get the tag message
139- changes = """ """
140- changes + = readFile(' CHANGES.md' )
141- tagMessage = """ """
142- for (line in changes. readLines()) {
143- if (! " " . equals(line)) {
144- // append the line to the tagMessage
145- tagMessage = " ${ tagMessage}${ line} \n "
146- } else {
147- break
148- }
149- }
150-
151- // Use git to tag the release at the version
152- try {
153- // Awkward workaround until resolution of https://issues.jenkins-ci.org/browse/JENKINS-28335
154- withCredentials([[$class : ' UsernamePasswordMultiBinding' , credentialsId : ' github-token' , usernameVariable : ' GIT_USERNAME' , passwordVariable : ' GIT_PASSWORD' ]]) {
155- sh
" git config user.email \" [email protected] \" " 156- sh " git config user.name \" Jenkins CI\" "
157- sh " git config credential.username ${ env.GIT_USERNAME} "
158- sh " git config credential.helper '!echo password=\$ GIT_PASSWORD; echo'"
159- sh " git tag -a ${ version} -m '${ tagMessage} '"
160- sh " git push origin ${ version} "
161- }
162- } finally {
163- sh " git config --unset credential.username"
164- sh " git config --unset credential.helper"
165- }
134+ gitTagAndPublish {
135+ isDraft= true
136+ releaseApiUrl= ' https://api.github.com/repos/cloudant/sync-android/releases'
166137 }
167138 }
168139 }
0 commit comments