-
Notifications
You must be signed in to change notification settings - Fork 15
31 lines (31 loc) · 1.02 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 相当于脚本用途的一个声明
name: Maven Central Repo Deployment
# 触发脚本的事件 这里为发布release之后触发
on:
release:
types: [released]
# 定义一个发行任务
jobs:
publish:
# 任务运行的环境
runs-on: ubuntu-latest
# 任务的步骤
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up Maven Central
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
server-id: sonatype-nexus-staging
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_SECRET }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Maven Central
run: mvn --activate-profiles sonatype-nexus-staging clean deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }}