Skip to content

Commit

Permalink
Deploy master to sonatype repo
Browse files Browse the repository at this point in the history
  • Loading branch information
akuhtz committed Dec 31, 2024
1 parent ba1427b commit 45df4d5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Java CI

on: [push, pull_request]
on:
- push
- pull_request

jobs:
build:
Expand All @@ -27,4 +29,25 @@ jobs:
- name: Show Maven version
run: mvn --version
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
run: mvn --batch-mode --update-snapshots verify
deploy:
if: contains( github.ref, 'master')
needs: build
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
server-id: ossrh
gpg-private-key: "${{ secrets.GPG_SIGNING_KEY }}"
overwrite-settings: false
- name: Deploy snapshot artifacts
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: mvn --batch-mode deploy --settings .github/workflows/settings.xml -Dpgp.keyname=${{ secrets.GPG_KEY_NAME }} -DskipTests=true -Prelease-sign-artifacts
14 changes: 14 additions & 0 deletions .github/workflows/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<settings>
<servers>
<!-- Sonatype Nexus -->
<server>
<id>ossrh</id>
<username>${env.OSSRH_USERNAME}</username>
<password>${env.OSSRH_PASSWORD}</password>
</server>
<server>
<id>gpg.passphrase</id>
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
</server>
</servers>
</settings>

0 comments on commit 45df4d5

Please sign in to comment.