Skip to content

Commit

Permalink
Create publish2MavenCentral.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
irzinfante committed May 13, 2023
1 parent c7cf6ad commit 33a3adb
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish2MavenCentral.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish package to the Maven Central Repository
on:
release:
types: [created]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
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
- id: install-secret-key
name: Install GPG secret key
run: |
cat <(echo -e "${{ secrets.GPG_SIGNING_KEY }}") | gpg --batch --import
- name: Publish package
run: |
mvn --batch-mode \
-Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
-DstagingProgressTimeoutMinutes=20 \
deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

0 comments on commit 33a3adb

Please sign in to comment.