diff --git a/.github/workflows/release-and-deploy-release.yml b/.github/workflows/release-and-deploy-release.yml index 74beea4..21d44f2 100644 --- a/.github/workflows/release-and-deploy-release.yml +++ b/.github/workflows/release-and-deploy-release.yml @@ -71,4 +71,17 @@ jobs: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} nexus_username: ${{ secrets.OSSRH_USER }} - nexus_password: ${{ secrets.OSSRH_PASSWORD }} \ No newline at end of file + nexus_password: ${{ secrets.OSSRH_PASSWORD }} + # Install xmllint + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install libxml2-utils + # Set git user name and email + - name: Set up Git + run: | + chmod +x ci/setup-git.sh + ci/setup-git.sh + # Set the next SNAPSHOT version + - name: Release (versioning/tag) + run: | + chmod +x ci/mvn-post-release.sh + ci/mvn-post-release.sh diff --git a/ci/mvn-post-release.sh b/ci/mvn-post-release.sh new file mode 100644 index 0000000..79ca1aa --- /dev/null +++ b/ci/mvn-post-release.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +CURRENT_VERSION=`xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' pom.xml` + +if [[ $CURRENT_VERSION != *-SNAPSHOT ]]; then + NEXT_VERSION=`bash ci/semver.sh -p CURRENT_VERSION` + NEXT_SNAPSHOT="$NEXT_VERSION-SNAPSHOT" + + mvn versions:set -DnewVersion=$NEXT_SNAPSHOT versions:commit --no-transfer-progress + + echo "commit new snapshot version" + git commit -a -m "Release $NEW_VERSION: set 6.2 to next development version $NEXT_SNAPSHOT" + + git push --all +fi diff --git a/ci/mvn-release.sh b/ci/mvn-release.sh index 7de0110..6f69d15 100755 --- a/ci/mvn-release.sh +++ b/ci/mvn-release.sh @@ -20,11 +20,6 @@ if [[ $CURRENT_VERSION == *-SNAPSHOT ]]; then echo "create tag for new release" git tag -a $NEW_VERSION -m "Release $NEW_VERSION: tag release" - mvn versions:set -DnewVersion=$NEXT_SNAPSHOT versions:commit --no-transfer-progress - - echo "commit new snapshot version" - git commit -a -m "Release $NEW_VERSION: set 6.2 to next development version $NEXT_SNAPSHOT" - git push --all git push --tags fi