Maven Central Repo Deployment #71
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 相当于脚本用途的一个声明 | |
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 }} |