diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dabcef12..4d433ce6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -49,6 +49,15 @@ jobs: distribution: 'temurin' cache: maven + - name: Set maven version + run: | + TAG_VERSION=${{ github.ref }} # e.g., refs/tags/v1.2.3 + VERSION=${TAG_VERSION#refs/tags/} # Strip the prefix to get v1.2.3 + VERSION=${VERSION#v} # Strip the 'v' to get 1.2.3 + echo "Version: ${{version}}" + mvn versions:set -DnewVersion=$VERSION + mvn versions:commit # Commit the new version + - name: Build with Maven run: mvn package