From a565c89eee4fa8bb5655f4b4dc2122bbb3e84d9e Mon Sep 17 00:00:00 2001 From: Dominick Leppich Date: Fri, 3 May 2024 13:19:36 +0200 Subject: [PATCH] ci: update to latest CI scripts --- .github/workflows/develop-build.yml | 2 +- .github/workflows/release-build.yml | 9 ++------- Jenkinsfile | 23 +++++++++++++++++++++-- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/develop-build.yml b/.github/workflows/develop-build.yml index d9c62d8..78664d9 100644 --- a/.github/workflows/develop-build.yml +++ b/.github/workflows/develop-build.yml @@ -43,5 +43,5 @@ jobs: draft: false prerelease: true files: | - **/target/*.war + **/target/*.jar install/* diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 2ff7685..e3a9552 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -1,9 +1,4 @@ -name: Publish Development Build - -permissions: - contents: write - -name: Publish Development Build +name: Publish Release Build permissions: contents: write @@ -41,5 +36,5 @@ jobs: draft: false prerelease: false files: | - **/target/*.war + **/target/*.jar install/* diff --git a/Jenkinsfile b/Jenkinsfile index d2f4b4b..13cb478 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,7 +21,6 @@ pipeline { sh 'git reset --hard HEAD && git clean -fdx' } } - stage('build-snapshot') { when { not { @@ -72,7 +71,6 @@ pipeline { } } } - stage('deploy-libs') { when { anyOf { @@ -89,6 +87,27 @@ pipeline { } } } + stage('tag release') { + when { branch 'master' } + steps { + withCredentials([gitUsernamePassword(credentialsId: '93f7e7d3-8f74-4744-a785-518fc4d55314', + gitToolName: 'git-tool')]) { + sh '''#!/bin/bash -xe + projectversion=$(mvn org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate -Dexpression=project.version -q -DforceStdout) + if [ $? != 0 ] + then + exit 1 + elif [[ "${projectversion}" =~ "SNAPSHOT" ]] + then + echo "This is a SNAPSHOT version" + exit 1 + fi + echo "${projectversion}" + git tag -a "v${projectversion}" -m "releasing v${projectversion}" && git push origin v"${projectversion}" + ''' + } + } + } } post {