diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml new file mode 100644 index 00000000..5daee1da --- /dev/null +++ b/.github/workflows/publishing.yml @@ -0,0 +1,35 @@ +name: Publish the Java SDK +on: + workflow_dispatch: + inputs: + deploy: + description: 'Deploy?' + required: true + type: boolean +jobs: + build: + name: Build and Test + if: ${{ inputs.deploy }} + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'corretto' + + - name: Build and Test with Gradle + run: ./gradlew build + + - name: Publish SDK Library to Maven Central + run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_KEY_ID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} diff --git a/gradle.properties b/gradle.properties index e942df64..baba749b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -30,10 +30,5 @@ POM_LICENCE_DIST=repo POM_DEVELOPER_NAME=Countly -#SIGNING SECTION -signing.keyId=xx -signing.password=xx -signing.secretKeyRingFile=xx - -mavenCentralUsername=xx -mavenCentralPassword=xx +# Publishing properties +SONATYPE_AUTOMATIC_RELEASE=true