# This is a basic workflow to help you get started with Actions

name: Publish to Maven Central

# Controls when the workflow will run
on:
  push:
    branches:
      - master

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - uses: actions/checkout@v3
        # fetch all history for all branches and tags, so that our `make` targets can get tags
        with:
          fetch-depth: 0
      - name: Set up Maven Central Repository
        uses: actions/setup-java@v2
        with:
          java-version: "11"
          distribution: "adopt"
          server-id: ossrh
          server-username: MAVEN_USERNAME
          server-password: MAVEN_PASSWORD
      - name: Publish package
        run: |
          mkdir -p ~/.gradle
          ./gradlew -i publishToMavenCentral
        env:
          MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
          MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

# This is a basic workflow to help you get started with Actions

name: Publish to Maven Central

# Controls when the workflow will run
on:
  push:
    branches:
      - master

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - uses: actions/checkout@v3
        # fetch all history for all branches and tags, so that our `make` targets can get tags
        with:
          fetch-depth: 0
      - name: Set up JDK 11
        uses: actions/setup-java@v2
        with:
          java-version: "11"
          distribution: "adopt"
      - name: Publish package
        run: |
          mkdir -p ~/.gradle
          ./gradlew -i publishToMavenCentral
        env:
          ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SIGNING_KEY }}
          ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_SIGNING_PASSWORD }}
          ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
          ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

Fix Github action for publshing to Maven Central
INS-448: Fix Github action for publshing to Maven Central
