From d2cc7c744fe0523ba6bb2634c1c4ca012253c4e8 Mon Sep 17 00:00:00 2001 From: Matthew Madson Date: Tue, 29 Jun 2021 15:17:41 -0700 Subject: [PATCH] Update maven-publish.yml --- .github/workflows/maven-publish.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index ba38f7d..50ed8e7 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -26,6 +26,9 @@ jobs: server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD + + - name: Set pom versions to version specified by release tag + run: mvn versions:set -DnewVersion=${{ github.event.release.tag_name }} versions:commit - name: Install GPG Secret Key run: cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import @@ -50,3 +53,16 @@ jobs: run: mvn -P github -B deploy -s $GITHUB_WORKSPACE/settings.xml env: GITHUB_TOKEN: ${{ github.token }} + + - name: Roll pom version to next patch version + run: mvn build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit + + - name: Commit New Snapshot Version (if changed) + run: | + if [[ `git status --porcelain` ]]; then + git config --global user.name 'mmadson' + git config --global user.email 'code@matthewmadson.com' + git add -A + git commit -m "Rolling Maven Version to next snapshot" + git push + fi