Skip to content

Commit 2862bed

Browse files
committed
feat: new semver bump workflow
1 parent 0fd325c commit 2862bed

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

.github/workflows/maven-bump-push-dockerhub.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
name: Build # To isolate BUMP_PAT
2121
url: ${{ steps.upload.outputs.artifact-url }}
2222
outputs:
23-
artifact_name: app-${{ steps.bump.outputs.tag }}
24-
new_tag: ${{ steps.bump.outputs.tag }}
23+
artifact_name: app-${{ steps.semver.outputs.nextStrict }}
24+
new_tag: ${{ steps.semver.outputs.nextStrict }}
2525

2626
steps:
2727
- name: Checkout
@@ -44,16 +44,17 @@ jobs:
4444
key: ${{ runner.os }}-sonar
4545
restore-keys: ${{ runner.os }}-sonar
4646

47-
- name: Run Tests
48-
run: mvn test -B -P prod "-Dstyle.color=always"
49-
50-
- name: Bump Maven version
51-
id: bump
52-
uses: soat-tech-challenge/gh-action-bump-maven-version@main
47+
- name: Get Version Information
48+
id: semver
49+
uses: ietf-tools/semver-action@v1
5350
with:
54-
commit-message: "[skip ci] Bump version to"
51+
token: ${{ github.token }}
52+
patchAll: true
53+
54+
- name: Set Next Version # So app can be packaged with correct version
55+
run: mvn org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=${{ steps.semver.outputs.nextStrict }}
5556

56-
- name: Verify with Maven
57+
- name: Verify and Scan with Maven
5758
env:
5859
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5960
run: |
@@ -65,11 +66,18 @@ jobs:
6566
-Dsonar.organization=soat-tech-challenge \
6667
-Dsonar.projectKey=soat-tech-challenge_$REPO_NAME
6768
69+
- name: Commit, Tag and Push New Version
70+
id: bump
71+
uses: soat-tech-challenge/gh-action-bump-maven-version@main
72+
with:
73+
commit-message: "[skip ci] Bump version to"
74+
version: ${{ steps.semver.outputs.nextStrict }}
75+
6876
- name: Upload Artifact
6977
id: upload
7078
uses: actions/upload-artifact@v4
7179
with:
72-
name: app-${{ steps.bump.outputs.tag }}
80+
name: app-${{ steps.semver.outputs.nextStrict }}
7381
path: target/app.jar
7482
if-no-files-found: error
7583

0 commit comments

Comments
 (0)