Skip to content

Commit 6c99529

Browse files
authored
Update maven-publish-on-push.yml
1 parent 6417b47 commit 6c99529

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/maven-publish-on-push.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ jobs:
2727
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
2828
settings-path: ${{ github.workspace }} # location for the settings.xml file
2929

30-
- name: Build with Maven
31-
run: mvn -B package --file pom.xml
32-
33-
- name: Publish to GitHub Packages Apache Maven
34-
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
35-
env:
36-
GITHUB_TOKEN: ${{ github.token }}
37-
3830
- name: Read Maven project version
3931
id: read_version
4032
run: |
@@ -55,6 +47,16 @@ jobs:
5547
else
5648
echo "has_tag=false" >> $GITHUB_OUTPUT
5749
fi
50+
51+
- name: Build with Maven
52+
run: mvn -B package --file pom.xml
53+
54+
- name: Publish to GitHub Packages Apache Maven
55+
if: steps.check_release.outputs.is_snapshot == 'true' || steps.check_release.outputs.is_snapshot == 'false' && steps.check_release.outputs.has_tag == 'true'
56+
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
57+
env:
58+
GITHUB_TOKEN: ${{ github.token }}
59+
5860

5961
- name: Set up JDK 1.8 for NERZ-Snapshot-Deployment
6062
uses: actions/setup-java@v3

0 commit comments

Comments
 (0)