From e9d767c2c719251152ea7d77cb28a0b37faadf9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Wed, 2 Oct 2024 11:44:09 -0500 Subject: [PATCH] feat(maven): Tags automatically when pom version changes. (#289) Note: merging this to master will create a 3.1 tag. We intended to release 3.1 earlier, but we failed to create the tag resulting in the releases since the bump to 3.1 to be released to maven as 3.0. --- .github/workflows/maven.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4d6ea5fb..d722ec56 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -61,6 +61,27 @@ jobs: server-username: SONATYPE_USER server-password: SONATYPE_PW + - name: Install xmllint + shell: bash + run: | + sudo apt update + sudo apt install -y libxml2-utils + + - name: Set tag Version + id: sets-tag-version + run: | + MVNVER=$(xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" pom.xml) + TAG_NAME="v${MVNVER/-SNAPSHOT/}" + echo "Tag name: ${TAG_NAME}" + echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT + + - name: Create Tag + uses: rickstaa/action-create-tag@v1.7.2 + with: + tag_exists_error: false + tag: ${{ steps.sets-tag-version.outputs.TAG_NAME }} + message: "Automated tag" + - name: Set version run: | VERSION=`git describe --match "v[0-9\.]*" --long --dirty --always`