Skip to content

Commit 60cd057

Browse files
committed
chore: update release to publish to central portal
1 parent f247427 commit 60cd057

File tree

8 files changed

+38
-132
lines changed

8 files changed

+38
-132
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,11 @@ jobs:
7979
GIT_COMMITTER_NAME: amplitude-sdk-bot
8080
GIT_COMMITTER_EMAIL: amplitude-sdk-bot@users.noreply.github.com
8181
# Sonatype Publishing
82-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
83-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
84-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
85-
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
86-
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
87-
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
82+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
83+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
84+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
85+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID }}
86+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}
8887
run: |
8988
npx \
9089
-p lodash \

analytics-connector/build.gradle

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
2+
13
plugins {
24
id 'com.android.library'
5+
id 'com.vanniktech.maven.publish' version '0.34.0'
36
id 'kotlin-android'
47
}
58

@@ -11,8 +14,6 @@ ext {
1114
PUBLISH_ARTIFACT_ID = 'analytics-connector'
1215
}
1316

14-
apply from: "${rootDir}/gradle/publish-module.gradle"
15-
1617
android {
1718
compileSdkVersion 30
1819

@@ -39,6 +40,17 @@ android {
3940
namespace 'com.amplitude.analytics.connector'
4041
}
4142

43+
mavenPublishing {
44+
coordinates(PUBLISH_GROUP_ID, PUBLISH_ARTIFACT_ID, PUBLISH_VERSION)
45+
46+
pom {
47+
name.set(PUBLISH_NAME)
48+
description.set(PUBLISH_DESCRIPTION)
49+
}
50+
51+
configure(new AndroidSingleVariantLibrary("release", false, false))
52+
}
53+
4254
dependencies {
4355
testImplementation 'junit:junit:4.13.2'
4456
testImplementation 'org.json:json:20201115'

build.gradle

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,3 @@ allprojects {
3434
task clean(type: Delete) {
3535
delete rootProject.buildDir
3636
}
37-
38-
apply from: "${rootDir}/gradle/publish-root.gradle"
39-
40-
41-
42-
43-

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ org.gradle.jvmargs=-Xmx2048m
1616
android.useAndroidX=true
1717
android.enableJetifier=true
1818

19+
GROUP=com.amplitude
1920
POM_URL=https\://github.com/amplitude/experiment-android-client
2021
POM_SCM_URL=https\://github.com/amplitude/experiment-android-client
2122
POM_SCM_CONNECTION=scm\:git@github.com\:amplitude/experiment-android-client.git

gradle/publish-module.gradle

Lines changed: 0 additions & 84 deletions
This file was deleted.

gradle/publish-root.gradle

Lines changed: 0 additions & 10 deletions
This file was deleted.

release.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module.exports = {
4141
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
4242
}],
4343
["@semantic-release/exec", {
44-
"publishCmd": "./gradlew sdk:publishReleasePublicationToSonatypeRepository",
44+
"publishCmd": "./gradlew publishToMavenCentral",
4545
}],
4646
],
4747
}

sdk/build.gradle

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
2+
13
plugins {
24
id 'com.android.library'
5+
id 'com.vanniktech.maven.publish' version '0.34.0'
36
id 'kotlin-android'
47
id 'org.jetbrains.dokka'
58
id 'org.jetbrains.kotlin.plugin.serialization' version '1.6.0'
@@ -13,8 +16,6 @@ ext {
1316
PUBLISH_ARTIFACT_ID = 'experiment-android-client'
1417
}
1518

16-
apply from: "${rootDir}/gradle/publish-module.gradle"
17-
1819
android {
1920
compileSdkVersion 30
2021

@@ -43,6 +44,20 @@ android {
4344
namespace 'com.amplitude.experiment'
4445
}
4546

47+
mavenPublishing {
48+
coordinates(PUBLISH_GROUP_ID, PUBLISH_ARTIFACT_ID, PUBLISH_VERSION)
49+
50+
pom {
51+
name.set(PUBLISH_NAME)
52+
description.set(PUBLISH_DESCRIPTION)
53+
}
54+
55+
configure(new AndroidSingleVariantLibrary("release", false, true))
56+
57+
publishToMavenCentral()
58+
signAllPublications()
59+
}
60+
4661
dependencies {
4762
implementation 'com.amplitude:analytics-connector:1.0.0'
4863
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
@@ -55,23 +70,3 @@ dependencies {
5570
testImplementation project(path: ':sdk')
5671
testImplementation "io.mockk:mockk:1.12.0"
5772
}
58-
59-
task docs(dependsOn: dokkaHtml) {
60-
dokkaHtml {
61-
outputDirectory.set(new File(rootDir, "docs"))
62-
moduleName.set("experiment-android-client")
63-
dokkaSourceSets {
64-
named("main") {
65-
includeNonPublic.set(false)
66-
skipEmptyPackages.set(true)
67-
skipDeprecated.set(true)
68-
reportUndocumented.set(true)
69-
}
70-
}
71-
}
72-
}
73-
afterEvaluate {
74-
generateMetadataFileForReleasePublication.dependsOn androidSourcesJar
75-
}
76-
77-

0 commit comments

Comments
 (0)