1616
1717name : maven push
1818
19- on : [push]
19+ on :
20+ push :
21+ branches :
22+ - ' main'
23+ - ' 1.x'
2024
2125jobs :
2226 build :
@@ -25,29 +29,22 @@ jobs:
2529 env :
2630 MAVEN_OPTS : " -Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m"
2731 steps :
28- - uses : actions/checkout@v4
32+ - uses : actions/checkout@v6
2933
3034 - name : Set up JDK 11 for x64
31- uses : actions/setup-java@v3
35+ uses : actions/setup-java@v5
3236 with :
33- java-version : ' 11 '
37+ java-version : ' 17 '
3438 distribution : ' temurin'
3539 architecture : x64
3640
37- - uses : s4u/maven-settings-action@v2.8.0
41+ - name : maven-settings-xml-action
42+ uses : whelk-io/maven-settings-xml-action@v22
43+ if : ${{ github.event.repository.fork == false }}
3844 with :
39- sonatypeSnapshots : true
40-
41- - uses : s4u/maven-settings-action@v2.8.0
42- if : ${{ github.event_name == 'push' }}
43- with :
44- servers : |
45- [{
46- "id": "central-portal-snapshots",
47- "username": "${{ secrets.SONATYPE_BOT_USERNAME }}",
48- "password": "${{ secrets.SONATYPE_BOT_TOKEN }}"
49- }]
50-
45+ repositories : ' [{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
46+ servers : ' [{ "id": "sonatype", "username": "${{ secrets.SONATYPE_BOT_USERNAME}}", "password": "${{ secrets.SONATYPE_BOT_TOKEN}}" }]'
47+
5148 - name : Deploy the artifact
5249 if : ${{ github.event_name == 'push' }}
5350 run : mvn help:effective-settings -B -V clean deploy -e
0 commit comments