name: Maven Central Repo Deployment
# 当 release 的时候触发
#on:
#  release:
#    types: [released]
on:
  push:
    branches: [ release ]
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up Maven Central Repo
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
          server-id: sonatype-nexus-staging
          server-username: MAVEN_USERNAME
          server-password: MAVEN_PASSWORD
          gpg-passphrase: MAVEN_GPG_PASSPHRASE
      - name: Publish to Maven Central Repo
        uses: samuelmeuli/action-maven-publish@v1
        with:
          gpg_private_key: ${{ secrets.GPG_SECRET }}
          gpg_passphrase: ${{ secrets.GPG_PASSWORD }}
          nexus_username: ${{ secrets.OSSRH_USER }}
          nexus_password: ${{ secrets.OSSRH_PASSWORD }}

