This is an automated email from the ASF dual-hosted git repository.

rantunes pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/incubator-kie-drools.git


The following commit(s) were added to refs/heads/10.0.x by this push:
     new 79332e3d6e kie-issues#1397 - Adjust git tag creation for Apache 10 
release (#6032)
79332e3d6e is described below

commit 79332e3d6ed437c254d26fa7142beb80511cf4a7
Author: Rodrigo Antunes <[email protected]>
AuthorDate: Mon Jul 29 08:02:17 2024 -0300

    kie-issues#1397 - Adjust git tag creation for Apache 10 release (#6032)
    
    * Adjust git tag creation for Apache 10 release
    
    * Adjust git tag creation for Apache 10 release
---
 .ci/jenkins/Jenkinsfile.deploy | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy
index 8f32664d19..b503afb8ab 100644
--- a/.ci/jenkins/Jenkinsfile.deploy
+++ b/.ci/jenkins/Jenkinsfile.deploy
@@ -82,7 +82,7 @@ pipeline {
         }
         stage('Prepare for PR') {
             when {
-                expression { return isRelease() || isCreatePr() }
+                expression { return isCreatePr() }
             }
             steps {
                 script {
@@ -149,7 +149,7 @@ pipeline {
         }
         stage('Create PR') {
             when {
-                expression { return isRelease() || isCreatePr() }
+                expression { return isCreatePr() }
             }
             steps {
                 script {
@@ -159,11 +159,6 @@ pipeline {
                         } else {
                             println '[WARN] no changes to commit'
                         }
-
-                        // Create a new tag
-                        
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
-                        githubscm.tagRepository(getGitTagName())
-                        githubscm.pushRemoteTag('origin', getGitTagName(), 
getGitAuthorPushCredsId())
                     }
                 }
             }
@@ -178,6 +173,29 @@ pipeline {
                 }
             }
         }
+        stage('Commit and Create Tag') {
+            when {
+                expression { return isRelease() }
+            }
+            steps {
+                script {
+                    dir(getRepoName()) {
+                        if (githubscm.isThereAnyChanges()) {
+                            def commitMsg = "[${getBuildBranch()}] Update 
version to ${getProjectVersion()}"
+                            
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
+                            githubscm.commitChanges(commitMsg, {
+                                
githubscm.findAndStageNotIgnoredFiles('pom.xml')
+                                
githubscm.findAndStageNotIgnoredFiles('antora.yml')
+                            })
+                        } else {
+                            println '[WARN] no changes to commit'
+                        }
+                        githubscm.tagRepository(getGitTagName())
+                        githubscm.pushRemoteTag('origin', getGitTagName(), 
getGitAuthorPushCredsId())
+                    }
+                }
+            }
+        }
     }
     post {
         always {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to