Skip to content

Commit

Permalink
Maven publish added
Browse files Browse the repository at this point in the history
  • Loading branch information
reeshika-h committed Oct 24, 2024
1 parent efa92cf commit f94cbef
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/maven--package-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publishing to Maven Packages
#on: [ push ] # Trigger the workflow when a push (commit) event occurs
on:
release:
types: [ created ]
jobs:
publish-maven:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Publish to Maven Central Repository
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

# run: mvn --batch-mode deploy

0 comments on commit f94cbef

Please sign in to comment.