Skip to content

Commit

Permalink
feat(maven): Tags automatically when pom version changes. (#289)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
damencho authored Oct 2, 2024
1 parent a982207 commit e9d767c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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`
Expand Down

0 comments on commit e9d767c

Please sign in to comment.