Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Publish - Release

on:
push:
branches:
- fix/release-workflow
release:
types: [released]

Expand All @@ -10,8 +13,20 @@ jobs:
steps:
- 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: central
server-username: ${{ secrets.MAVEN_USERNAME }}
server-password: ${{ secrets.MAVEN_PASSWORD }}

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Setup local.properties
run: |
cat << EOF >> local.properties
Expand All @@ -23,15 +38,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 }}
13 changes: 6 additions & 7 deletions contentstack/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
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

android.buildFeatures.buildConfig true

mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT)
// Use S01 host for Maven Central publishing
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
coordinates("com.contentstack.sdk", "android", "4.1.0")
coordinates("com.contentstack.sdk", "android", "4.1.0-beta")

pom {
name = "contentstack-android"
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -97,7 +97,6 @@ android {
keyPassword 'android'
}
}
compileSdk 30
defaultConfig {
// Required when setting minSdkVersion to 20 or lower
multiDexEnabled true
Expand Down
14 changes: 13 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
android.useAndroidX=true
android.enableJetifier=true
android.enableR8.fullMode=false
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m
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=
Loading