File tree Expand file tree Collapse file tree 3 files changed +17
-17
lines changed
Expand file tree Collapse file tree 3 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,26 @@ jobs:
2828 distribution : ' temurin'
2929 server-id : github
3030
31+ - name : Set snapshot version for main branch
32+ if : startsWith(github.ref, 'refs/heads/main')
33+ id : vars
34+ run : echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
35+
36+ - name : Update POM for snapshot version
37+ if : startsWith(github.ref, 'refs/heads/main')
38+ run : mvn -B -ntp versions:set -DnewVersion=1.0-${{ steps.vars.outputs.sha }}-SNAPSHOT -DprocessAllModules -DgenerateBackupPoms=false
39+
40+ - name : Set release version from tag
41+ if : startsWith(github.ref, 'refs/tags/v')
42+ run : |
43+ TAG=${{ github.ref_name }}
44+ VERSION=${TAG#v}
45+ mvn -B -ntp versions:set -DnewVersion=${VERSION} -DprocessAllModules -DgenerateBackupPoms=false
46+
3147 - name : Display Calculated Version
3248 run : mvn -B --no-transfer-progress help:evaluate -Dexpression=project.version -q -DforceStdout
3349
3450 - name : Build and Publish Package
3551 run : mvn -B --no-transfer-progress deploy
3652 env :
37- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments