Skip to content

Commit dece98c

Browse files
committed
docs(readme): 添加github action
添加github action
1 parent 379f215 commit dece98c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish package to the Maven Central Repository
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Maven Central Repository
12+
uses: actions/setup-java@v2
13+
with:
14+
java-version: '17'
15+
distribution: 'adopt'
16+
server-id: ossrh
17+
server-username: MAVEN_USERNAME
18+
server-password: MAVEN_PASSWORD
19+
- id: install-secret-key
20+
name: Install gpg secret key
21+
run: |
22+
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
23+
gpg --list-secret-keys --keyid-format LONG
24+
- name: Publish package
25+
env:
26+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
27+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
28+
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} clean deploy

0 commit comments

Comments
 (0)