Skip to content

Commit

Permalink
Update maven-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mmadson authored Jun 29, 2021
1 parent fd8b280 commit d2cc7c7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 '[email protected]'
git add -A
git commit -m "Rolling Maven Version to next snapshot"
git push
fi

0 comments on commit d2cc7c7

Please sign in to comment.