Skip to content

Commit 50d5839

Browse files
committed
Add publish action
1 parent 74c0f42 commit 50d5839

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v3
1111
- name: Set up JDK ${{ matrix.java-version }}
12-
uses: actions/setup-java@v3
12+
uses: actions/setup-java@v4
1313
with:
1414
java-version: ${{ matrix.java-version }}
15-
distribution: 'adopt'
15+
distribution: 'temurin'
1616
cache: 'maven'
1717
- name: Build with Maven
1818
env:

.github/workflows/publish.yml

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

0 commit comments

Comments
 (0)