Skip to content

Commit

Permalink
Add action for maven push
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhiguo committed Jun 27, 2024
1 parent b500672 commit 936e3ba
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/maven-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish package to the Maven Central Repository

on:
workflow_dispatch:
branches:
- "*"
-
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn --batch-mode deploy -P sonatype-oss-release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

0 comments on commit 936e3ba

Please sign in to comment.