Skip to content

Commit 73257be

Browse files
authored
Merge pull request #34 from ligangty/main
Fix snapshot pushing issue
2 parents 30d2c00 + fb7c22c commit 73257be

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

.github/workflows/merge-build.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ on:
2727
paths:
2828
- 'src/**'
2929
- 'pom.xml'
30+
- '.github/workflows/merge-build.yml'
3031

3132
jobs:
3233
publish-snapshot:
@@ -47,19 +48,24 @@ jobs:
4748
architecture: x64
4849
java-version: 17
4950

50-
- name: maven-settings-xml-action
51-
uses: whelk-io/maven-settings-xml-action@v22
52-
if: ${{ github.event.repository.fork == false }}
51+
- uses: s4u/maven-settings-action@v4.0.0
5352
with:
54-
repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
55-
servers: '[{ "id": "sonatype", "username": "${{ secrets.SONATYPE_BOT_USERNAME}}", "password": "${{ secrets.SONATYPE_BOT_TOKEN}}" }]'
53+
sonatypeSnapshots: true
5654

57-
- name: "Maven Build & Deploy Snapshot to Sonatype OSSRH"
58-
if: ${{ github.event.repository.fork == false }}
59-
60-
run: mvn -B -e deploy -DaltDeploymentRepository=sonatype::default::https://oss.sonatype.org/content/repositories/snapshots/
55+
- uses: s4u/maven-settings-action@v4.0.0
56+
with:
57+
sonatypeSnapshots: true
6158

62-
- name: "Maven Build"
63-
if: ${{ github.event.repository.fork == true }}
59+
- uses: s4u/maven-settings-action@v4.0.0
60+
if: ${{ github.event_name == 'push' }}
61+
with:
62+
servers: |
63+
[{
64+
"id": "central-portal-snapshots",
65+
"username": "${{ secrets.SONATYPE_BOT_USERNAME }}",
66+
"password": "${{ secrets.SONATYPE_BOT_TOKEN }}"
67+
}]
6468
65-
run: mvn -B -e -Prun-its verify
69+
- name: "Maven Build & Deploy Snapshot to Sonatype OSSRH"
70+
if: ${{ github.event_name == 'push' }}
71+
run: mvn -B -e deploy -DaltDeploymentRepository=sonatype::default::https://oss.sonatype.org/content/repositories/snapshots/

0 commit comments

Comments
 (0)