Updated to global gitTagAndPublish
@@ -121,7 +121,6 @@ stage('QA') {
stage('Publish') {
if (env.BRANCH_NAME == "master") {
node {
- checkout scm // re-checkout to be able to git tag
unstash name: 'built'
// read the version name and determine if it is a release build
version = readFile('VERSION').trim()
@@ -132,37 +131,9 @@ stage('Publish') {
sh './gradlew -Dsigning.keyId=$KEY_ID -Dsigning.password=$KEY_PASSWORD -Dsigning.secretKeyRingFile=$SIGNING_FILE -DossrhUsername=$OSSRH_USER -DossrhPassword=$OSSRH_PASSWORD upload'
}
- // if it is a release build then do the git tagging
- if (isReleaseVersion) {
-
- // Read the CHANGES.md to get the tag message
- changes = """"""
- changes += readFile('CHANGES.md')
- tagMessage = """"""
- for (line in changes.readLines()) {
- if (!"".equals(line)) {
- // append the line to the tagMessage
- tagMessage = "${tagMessage}${line}\n"
- } else {
- break
- }
- }
-
- // Use git to tag the release at the version
- try {
- // Awkward workaround until resolution of https://issues.jenkins-ci.org/browse/JENKINS-28335
- withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'github-token', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD']]) {
- sh "git config user.email \"nomail@hursley.ibm.com\""
- sh "git config user.name \"Jenkins CI\""
- sh "git config credential.username ${env.GIT_USERNAME}"
- sh "git config credential.helper '!echo password=\$GIT_PASSWORD; echo'"
- sh "git tag -a ${version} -m '${tagMessage}'"
- sh "git push origin ${version}"
- }
- } finally {
- sh "git config --unset credential.username"
- sh "git config --unset credential.helper"
- }
+ gitTagAndPublish {
+ isDraft=true
+ releaseApiUrl='https://api.github.com/repos/cloudant/sync-android/releases'
}
}
}
