# See:
# https://docs.github.com/en/free-pro-team@latest/actions/guides/publishing-java-packages-with-maven
# https://central.sonatype.org/pages/apache-maven.html
# https://github.com/actions/setup-java

name: release

on:
  workflow_dispatch:

jobs:
  release:
    environment: maven_central
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Set up Maven Central repository
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
          server-id: ossrh
          server-username: MAVEN_USERNAME # env variable to use for username in release
          server-password: MAVEN_PASSWORD # env variable to use for password in release
          gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
          gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable to use for passphrase in release

      - name: Set up Git user
        run: |
          git config --global user.name "${{ secrets.GIT_USER_NAME }}"
          git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"

      - name: Release
        run: mvn -B release:prepare release:perform
        env:
          MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
          MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
          MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

# See:
# https://docs.github.com/en/free-pro-team@latest/actions/guides/publishing-java-packages-with-maven
# https://central.sonatype.org/pages/apache-maven.html
# https://github.com/actions/setup-java

name: release

on:
  workflow_dispatch:

jobs:
  release:
    environment: maven_central
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Set up Maven Central repository
        uses: actions/setup-java@v1
        with:
          java-version: 1.8
          server-id: ossrh
          server-username: MAVEN_USERNAME # env variable to use for username in release
          server-password: MAVEN_PASSWORD # env variable to use for password in release
          gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
          gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable to use for passphrase in release

      - name: Set up Git user
        run: |
          git config --global user.name "${{ secrets.GIT_USER_NAME }}"
          git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"

      - name: Release
        uses: actions/checkout@v2
        run: mvn -B release:prepare release:perform
        env:
          MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
          MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
          MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

Use "actions/checkout@v2" to be able to push (maybe)
Use "actions/checkout@v2" to be able to push (maybe)
