name: Deploy version to Maven Central
on: workflow_dispatch

jobs:
  build_and_deploy_library:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: '11'

      - name: Build Ok2Curl
        run: ./gradlew clean ok2curl:build

      - name: Publish release to Sonatype Repository
        run: ./gradlew ok2curl:publishReleasePublicationToSonatypeRepository
        env:
          OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
          OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
          SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
          SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
          SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
          SIGNING_GPG_KEY: ${{ secrets.SIGNING_GPG_KEY }}

      - name: Close and Release Sonatype Staging Repository
        run: ./gradlew closeAndReleaseSonatypeStagingRepository
        env:
          OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
          OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
          SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
          SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
          SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
          SIGNING_GPG_KEY: ${{ secrets.SIGNING_GPG_KEY }}

name: Deploy version to Maven Central
on: workflow_dispatch

jobs:
  build_and_deploy_library:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: '11'

      - name: Build Ok2Curl
        run: ./gradlew clean ok2curl:build

      - name: Publish release to Sonatype Repository
        run: ./gradlew ok2curl:publishReleasePublicationToSonatypeRepository
        env:
          OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
          OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
          SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
          SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
          SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
          SIGNING_GPG_KEY: ${{ secrets.SIGNING_GPG_KEY }}

Make closing staging repository step a manual one
Make closing staging repository step a manual one
