Skip to content

Commit

Permalink
Merge pull request #176 from ligangty/main
Browse files Browse the repository at this point in the history
Disable sonatype push for snapshot builds
  • Loading branch information
ligangty authored Mar 4, 2024
2 parents 9a5eb11 + 31f4aaa commit ba769bc
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/merge-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,21 @@ jobs:
architecture: x64
java-version: 11

- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v14
if: ${{ github.event.repository.fork == false }}
with:
repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
servers: '[{ "id": "sonatype", "username": "${{ secrets.SONATYPE_BOT_USERNAME}}", "password": "${{ secrets.SONATYPE_BOT_TOKEN}}" }]'
# - name: maven-settings-xml-action
# uses: whelk-io/maven-settings-xml-action@v14
# if: ${{ github.event.repository.fork == false }}
# with:
# repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
# servers: '[{ "id": "sonatype", "username": "${{ secrets.SONATYPE_BOT_USERNAME}}", "password": "${{ secrets.SONATYPE_BOT_TOKEN}}" }]'

- name: "Maven Verify"
if: ${{ github.event.repository.fork == true }}
run: mvn -B -e verify

- name: "Maven Build & Deploy Snapshot to Sonatype OSSRH"
# For service app we don't need to push it to sonatype
- name: "Maven Build"
if: ${{ github.event.repository.fork == false }}
run: mvn -B -e clean deploy -DskipTests -DaltDeploymentRepository=sonatype::default::https://oss.sonatype.org/content/repositories/snapshots/
run: mvn -B -e clean install -DskipTests

- name: Checkout tools repo
uses: actions/checkout@v4
Expand Down

0 comments on commit ba769bc

Please sign in to comment.