Skip to content

Commit

Permalink
fix : publish-snapshot workflow has been added
Browse files Browse the repository at this point in the history
  • Loading branch information
reeshika-h committed Jul 16, 2024
1 parent a3306c9 commit 09b7cc6
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 2 additions & 2 deletions contentstack/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 09b7cc6

Please sign in to comment.