From 09b7cc6fa4b6b4a530ffbd70901e94f50c4f6336 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Tue, 16 Jul 2024 13:41:46 +0530 Subject: [PATCH 1/3] fix : publish-snapshot workflow has been added --- .github/workflows/publish-snapshot.yml | 46 ++++++++++++++++++++++++++ contentstack/build.gradle | 4 +-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-snapshot.yml diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml new file mode 100644 index 00000000..fff95448 --- /dev/null +++ b/.github/workflows/publish-snapshot.yml @@ -0,0 +1,46 @@ +name: Publish - Snapshot + +on: + push: + branches: + - fix/DX-653-publish-snapshot + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout project sources + uses: actions/checkout@v3 + - name: Check whether the version is a snapshot + run: | + if grep -q "\-SNAPSHOT" ./contentstack/build.gradle + then + : + else + exit 1 + fi + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Setup local.properties + run: | + cat << EOF >> local.properties + sdk.dir=$ANDROID_HOME + host="${{ secrets.HOST }}" + APIKey="${{ secrets.API_KEY }}" + deliveryToken="${{ secrets.DELIVERY_TOKEN }}" + environment="${{ secrets.ENVIRONMENT }}" + contentType="${{ secrets.CONTENT_TYPE }}" + assetUid="${{ secrets.ASSET_UID }}" + EOF + - name: Build the SDK - Snapshot + run: | + ./gradlew clean build + - name: Publish the SDK - Snapshot + run: | + ./gradlew publishAllPublicationsToMavenCentralRepository + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.mavenCentralUsername }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }} + 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 9e9f1fb9..c65cfa87 100755 --- a/contentstack/build.gradle +++ b/contentstack/build.gradle @@ -10,7 +10,7 @@ android.buildFeatures.buildConfig true mavenPublishing { publishToMavenCentral(SonatypeHost.DEFAULT) signAllPublications() - coordinates("com.contentstack.sdk", "android", "3.15.1") + coordinates("com.contentstack.sdk", "android", "3.15.1-SNAPSHOT") pom { name = "contentstack-android" @@ -99,7 +99,7 @@ android { defaultConfig { // Required when setting minSdkVersion to 20 or lower multiDexEnabled true - minSdkVersion 23 + minSdk 24 versionCode 1 versionName "1.0" useLibrary 'org.apache.http.legacy' From c430866716132c1f5b57f5da3aeb5b8a7745b903 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Thu, 18 Jul 2024 10:02:46 +0530 Subject: [PATCH 2/3] chore: publish SDK step changed --- .github/workflows/publish-snapshot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index fff95448..254a3ef1 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -37,7 +37,7 @@ jobs: ./gradlew clean build - name: Publish the SDK - Snapshot run: | - ./gradlew publishAllPublicationsToMavenCentralRepository + ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.mavenCentralUsername }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }} From 7fc2cb25094443235541a2698a6065202780ba91 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Tue, 23 Jul 2024 11:12:13 +0530 Subject: [PATCH 3/3] chore: snapshot testing --- .github/workflows/publish-snapshot.yml | 46 -------------------------- 1 file changed, 46 deletions(-) delete mode 100644 .github/workflows/publish-snapshot.yml diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml deleted file mode 100644 index 254a3ef1..00000000 --- a/.github/workflows/publish-snapshot.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Publish - Snapshot - -on: - push: - branches: - - fix/DX-653-publish-snapshot - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - name: Checkout project sources - uses: actions/checkout@v3 - - name: Check whether the version is a snapshot - run: | - if grep -q "\-SNAPSHOT" ./contentstack/build.gradle - then - : - else - exit 1 - fi - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - - name: Setup local.properties - run: | - cat << EOF >> local.properties - sdk.dir=$ANDROID_HOME - host="${{ secrets.HOST }}" - APIKey="${{ secrets.API_KEY }}" - deliveryToken="${{ secrets.DELIVERY_TOKEN }}" - environment="${{ secrets.ENVIRONMENT }}" - contentType="${{ secrets.CONTENT_TYPE }}" - assetUid="${{ secrets.ASSET_UID }}" - EOF - - name: Build the SDK - Snapshot - run: | - ./gradlew clean build - - name: Publish the SDK - Snapshot - run: | - ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache - env: - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.mavenCentralUsername }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.mavenCentralPassword }} - ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.signingInMemoryKey }} - ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signingInMemoryKeyId }} - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signingInMemoryKeyPassword }} \ No newline at end of file