From 98af6c85c86267575fece03aa37c04ba4c8c41cd Mon Sep 17 00:00:00 2001 From: Matthew Horridge Date: Tue, 14 May 2024 12:16:53 -0700 Subject: [PATCH] Set maven version from GitHub tag on release --- .github/workflows/pub-docker-hub.yaml | 3 +++ .github/workflows/pub.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/pub-docker-hub.yaml b/.github/workflows/pub-docker-hub.yaml index 3095f57..22e6071 100644 --- a/.github/workflows/pub-docker-hub.yaml +++ b/.github/workflows/pub-docker-hub.yaml @@ -22,6 +22,9 @@ jobs: server-id: docker.io server-username: DOCKER_USERNAME server-password: DOCKER_PASSWORD + - if: github.event.release + name: Update version in pom.xml (Release only) + run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false - name: Publish package run: mvn --batch-mode -Prelease package dockerfile:push env: diff --git a/.github/workflows/pub.yaml b/.github/workflows/pub.yaml index 15a617a..6bff372 100644 --- a/.github/workflows/pub.yaml +++ b/.github/workflows/pub.yaml @@ -18,6 +18,9 @@ jobs: server-password: OSSRH_TOKEN gpg-private-key: ${{secrets.GPG_PRIVATE_KEY}} gpg-passphrase: GPG_PASSPHRASE + - if: github.event.release + name: Update version in pom.xml (Release only) + run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false - name: Publish package run: mvn --batch-mode -Prelease deploy env: