-
Notifications
You must be signed in to change notification settings - Fork 7
38 lines (34 loc) · 1.1 KB
/
oss-release-deploy.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
32
33
34
35
36
37
38
name: Publish SNAPSHOT Maven Package
on:
workflow_dispatch:
push:
tags:
- 'v*' # 只在推送以 "v" 开头的标签时触发,如 "v1.0.0"
jobs:
oss-release-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Setup Maven Central
uses: actions/setup-java@v3
with: # overwrite settings.xml
java-version: '8'
distribution: 'adopt'
server-id: sonatype
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Maven Central
run: mvn clean deploy -P release -Dmaven.test.skip=true
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}