Skip to content

Commit 40c556a

Browse files
authored
Create maven-publish.yml
1 parent 70b9621 commit 40c556a

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish package to the Maven Central Repository and GitHub Packages
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
packages: write
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Java for publishing to Maven Central Repository
14+
uses: actions/setup-java@v3
15+
with:
16+
java-version: '11'
17+
distribution: 'adopt'
18+
server-id: ossrh
19+
server-username: MAVEN_USERNAME
20+
server-password: MAVEN_PASSWORD
21+
- name: Publish to the Maven Central Repository
22+
run: mvn --batch-mode deploy
23+
env:
24+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
25+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

0 commit comments

Comments
 (0)