From abe34e55a443193397c614264052510a55a07751 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Tue, 23 Sep 2025 15:48:06 +0530 Subject: [PATCH 1/5] Update release workflow and Gradle configuration for Maven Central publishing --- .github/workflows/publish-release.yml | 12 +++++++++--- contentstack/build.gradle | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 8f281843..af4c15a0 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -1,6 +1,9 @@ name: Publish - Release on: + push: + branches: + - fix/release-workflow release: types: [released] @@ -12,6 +15,7 @@ jobs: uses: actions/checkout@v3 - name: Setup Gradle uses: gradle/gradle-build-action@v2 + - name: Setup local.properties run: | cat << EOF >> local.properties @@ -23,15 +27,17 @@ jobs: contentType="${{ secrets.CONTENT_TYPE }}" assetUid="${{ secrets.ASSET_UID }}" EOF + - name: Gradle build and clean run: | ./gradlew clean build - - name: Publish the SDK + + - name: Publish to Maven Central run: | ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache env: - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.mavenCentralUsername }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.signingInMemoryKey }} ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signingInMemoryKeyId }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }} \ No newline at end of file diff --git a/contentstack/build.gradle b/contentstack/build.gradle index decfc052..1a414f7a 100755 --- a/contentstack/build.gradle +++ b/contentstack/build.gradle @@ -8,9 +8,9 @@ import com.vanniktech.maven.publish.SonatypeHost android.buildFeatures.buildConfig true mavenPublishing { - publishToMavenCentral(SonatypeHost.DEFAULT) + publishToMavenCentral("OSSRH") // Use OSSRH for Sonatype OSSRH (Maven Central) signAllPublications() - coordinates("com.contentstack.sdk", "android", "4.1.0") + coordinates("com.contentstack.sdk", "android", "4.1.0-beta") pom { name = "contentstack-android" From 64b16306b6a5c32ef8d006baa07bece0a2696cd4 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Tue, 23 Sep 2025 16:07:42 +0530 Subject: [PATCH 2/5] Enhance Gradle configuration for Maven Central publishing and update release workflow --- .github/workflows/publish-release.yml | 1 + contentstack/build.gradle | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index af4c15a0..05d8cb2b 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -13,6 +13,7 @@ jobs: steps: - name: Checkout project sources uses: actions/checkout@v3 + - name: Setup Gradle uses: gradle/gradle-build-action@v2 diff --git a/contentstack/build.gradle b/contentstack/build.gradle index 1a414f7a..72e15b70 100755 --- a/contentstack/build.gradle +++ b/contentstack/build.gradle @@ -3,12 +3,11 @@ plugins { id "com.android.library" } -import com.vanniktech.maven.publish.SonatypeHost - android.buildFeatures.buildConfig true mavenPublishing { - publishToMavenCentral("OSSRH") // Use OSSRH for Sonatype OSSRH (Maven Central) + // Use OSSRH staging API for Maven Central publishing + publishToMavenCentral("OSSRH", "https://s01.oss.sonatype.org/service/local/") signAllPublications() coordinates("com.contentstack.sdk", "android", "4.1.0-beta") @@ -56,7 +55,8 @@ tasks.register('jacocoTestReport', JacocoReport) { } android { - //namespace "com.contentstack.sdk" + namespace "com.contentstack.sdk" + compileSdk 34 // Using latest stable Android SDK version packagingOptions { exclude("META-INF/DEPENDENCIES") exclude("META-INF/LICENSE") From 24d4ad5a2a5da8860bfcb6c319daa149581c5ac0 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Tue, 23 Sep 2025 16:22:10 +0530 Subject: [PATCH 3/5] Update release workflow to include JDK and Maven setup, and refine Gradle publishing configuration --- .github/workflows/publish-release.yml | 10 ++++++++++ contentstack/build.gradle | 7 +++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 05d8cb2b..932c37ee 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -14,6 +14,16 @@ jobs: - name: Checkout project sources uses: actions/checkout@v3 + - name: Set up JDK and Maven Central + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + cache: 'gradle' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Setup Gradle uses: gradle/gradle-build-action@v2 diff --git a/contentstack/build.gradle b/contentstack/build.gradle index 72e15b70..2acc3c0e 100755 --- a/contentstack/build.gradle +++ b/contentstack/build.gradle @@ -2,12 +2,12 @@ plugins { id "com.vanniktech.maven.publish" version "0.27.0" id "com.android.library" } - +import com.vanniktech.maven.publish.SonatypeHost android.buildFeatures.buildConfig true mavenPublishing { - // Use OSSRH staging API for Maven Central publishing - publishToMavenCentral("OSSRH", "https://s01.oss.sonatype.org/service/local/") + // Use S01 host for Maven Central publishing + publishToMavenCentral(SonatypeHost.S01) signAllPublications() coordinates("com.contentstack.sdk", "android", "4.1.0-beta") @@ -97,7 +97,6 @@ android { keyPassword 'android' } } - compileSdk 30 defaultConfig { // Required when setting minSdkVersion to 20 or lower multiDexEnabled true From 12505d17bde99ecafbe1000fd2b529180a59bc87 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Tue, 23 Sep 2025 16:29:10 +0530 Subject: [PATCH 4/5] Enhance Gradle properties for Maven Central publishing with additional configuration options --- gradle.properties | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 64b7045d..6ba96609 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,16 @@ android.useAndroidX=true android.enableJetifier=true android.enableR8.fullMode=false -org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m \ No newline at end of file +org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m +android.suppressUnsupportedCompileSdk=34 + +# Maven Central Publishing Configuration +SONATYPE_HOST=S01 +RELEASE_SIGNING_ENABLED=true + +# These values should be provided by environment variables in CI +mavenCentralUsername= +mavenCentralPassword= +signing.keyId= +signing.password= +signing.secretKeyRingFile= \ No newline at end of file From 99273ec2e6ea8f5400a634b7dc4305eadd497f61 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Wed, 22 Oct 2025 18:32:22 +0530 Subject: [PATCH 5/5] testing release --- .github/workflows/publish-release.yml | 6 +++--- contentstack/build.gradle | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 932c37ee..7a6514e0 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -20,9 +20,9 @@ jobs: java-version: '11' distribution: 'adopt' cache: 'gradle' - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD + server-id: central + server-username: ${{ secrets.MAVEN_USERNAME }} + server-password: ${{ secrets.MAVEN_PASSWORD }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 diff --git a/contentstack/build.gradle b/contentstack/build.gradle index 2acc3c0e..3d978496 100755 --- a/contentstack/build.gradle +++ b/contentstack/build.gradle @@ -1,5 +1,5 @@ plugins { - id "com.vanniktech.maven.publish" version "0.27.0" + id "com.vanniktech.maven.publish" version "0.28.0" id "com.android.library" } import com.vanniktech.maven.publish.SonatypeHost