name: Release new version to the Maven Central Repository
on:
  workflow_dispatch:
    inputs:
      tag:
        description: 'Release Tag'
        required: true
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Maven Central Repository
        uses: actions/setup-java@v2
        with:
          java-version: '11'
          distribution: 'adopt'
          server-id: sonatype-nexus-staging
          server-username: MAVEN_USERNAME
          server-password: MAVEN_PASSWORD
          gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
          gpg-passphrase: MAVEN_GPG_PASSPHRASE
      - name: Publish to Apache Maven Central
        run: mvn clean deploy -Prelease -Drevision=${{ github.event.inputs.tag }}
        env:
          MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
          MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
          MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
      - name: Tag release on Github
        id: release-snapshot
        uses: actions/create-release@latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.event.inputs.tag }}
          release_name: ${{ github.event.inputs.tag }} Release
          draft: false
          prerelease: false

name: Release new version to the Maven Central Repository
on:
  workflow_dispatch:
    inputs:
      tag:
        description: 'Release Tag'
        required: true
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Maven Central Repository
        uses: actions/setup-java@v2
        with:
          java-version: '8'
          distribution: 'temurin'
          server-id: sonatype-nexus-staging
          server-username: MAVEN_USERNAME
          server-password: MAVEN_PASSWORD
          gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
          gpg-passphrase: MAVEN_GPG_PASSPHRASE
      - name: Publish to Apache Maven Central
        run: mvn clean deploy -Prelease -Drevision=${{ github.event.inputs.tag }}
        env:
          MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
          MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
          MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
      - name: Tag release on Github
        id: release-snapshot
        uses: actions/create-release@latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.event.inputs.tag }}
          release_name: ${{ github.event.inputs.tag }} Release
          draft: false
          prerelease: false

Change JDK due to javadoc errors
Change JDK due to javadoc errors
