Skip to content

Commit c2ca2b4

Browse files
committed
fix(packages/android): update Gradle nmcp publish command
1 parent b649b16 commit c2ca2b4

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ jobs:
260260

261261
- name: release android aar to maven central
262262
if: steps.tag.outputs.version != ''
263-
run: cd packages/android && ./gradlew publishAllPublicationsToMavenCentral -PVERSION=${{ steps.tag.outputs.version }}
263+
run: cd packages/android && ./gradlew publishToCentralPortal -PVERSION=${{ steps.tag.outputs.version }}
264264
env:
265265
SONATYPE_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
266266
SONATYPE_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }}

packages/android/build.gradle

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ plugins {
1414

1515
apply plugin: 'com.android.library'
1616
apply plugin: 'maven-publish'
17+
apply plugin: 'signing'
1718

1819
android {
1920
namespace 'ai.sqlite.vector'
@@ -59,10 +60,11 @@ afterEvaluate {
5960
artifactId = 'vector'
6061
version = project.hasProperty('VERSION') ? project.VERSION : ['make', 'version'].execute(null, file('../..')).text.trim()
6162

62-
artifact bundleReleaseAar
63+
artifact tasks.named("bundleReleaseAar").get().outputs.files.singleFile
6364

65+
// Maven Central metadata
6466
pom {
65-
name = 'SQLite Vector'
67+
name = 'sqlite-vector'
6668
description = 'A cross-platform, ultra-efficient SQLite extension that brings vector search capabilities to your embedded database. Works seamlessly on iOS, Android, Windows, Linux, and macOS, using just 30MB of memory by default.'
6769
url = 'https://github.com/sqliteai/sqlite-vector'
6870

@@ -85,29 +87,34 @@ afterEvaluate {
8587

8688
scm {
8789
connection = 'scm:git:git://github.com/sqliteai/sqlite-vector.git'
88-
developerConnection = 'scm:git:ssh://github.com/sqliteai/sqlite-vector.git'
89-
url = 'https://github.com/sqliteai/sqlite-vector'
90+
developerConnection = 'scm:git:ssh://github.com:sqliteai/sqlite-vector.git'
91+
url = 'https://github.com/sqliteai/sqlite-vector/tree/main'
9092
}
9193
}
9294
}
9395
}
9496
}
9597
}
9698

99+
// Signing configuration for Maven Central
97100
signing {
98-
def signingKey = project.findProperty("SIGNING_KEY") ?: System.getenv("SIGNING_KEY")
99-
def signingPassword = project.findProperty("SIGNING_PASSWORD") ?: System.getenv("SIGNING_PASSWORD")
100-
101-
if (signingKey && signingPassword) {
102-
useInMemoryPgpKeys(signingKey, signingPassword)
101+
required { project.hasProperty("SIGNING_KEY") }
102+
if (project.hasProperty("SIGNING_KEY")) {
103+
useInMemoryPgpKeys(
104+
project.property("SIGNING_KEY").toString(),
105+
project.property("SIGNING_PASSWORD").toString()
106+
)
103107
sign publishing.publications.release
104108
}
105109
}
106110

111+
// Maven Central publishing via NMCP
107112
nmcp {
108-
publishAllPublications {
109-
username = project.findProperty("SONATYPE_USERNAME") ?: System.getenv("SONATYPE_USERNAME")
110-
password = project.findProperty("SONATYPE_PASSWORD") ?: System.getenv("SONATYPE_PASSWORD")
111-
publicationType = "USER_MANAGED"
113+
if (project.hasProperty("SONATYPE_USERNAME") && project.hasProperty("SONATYPE_PASSWORD")) {
114+
publishAllPublications {
115+
username = project.property("SONATYPE_USERNAME")
116+
password = project.property("SONATYPE_PASSWORD")
117+
publicationType = "AUTOMATIC"
118+
}
112119
}
113120
}

0 commit comments

Comments
 (0)