Skip to content

Commit b649b16

Browse files
committed
fix(packages/android): update Gradle configuration for Maven Central publishing
1 parent 84ca515 commit b649b16

File tree

2 files changed

+61
-4
lines changed

2 files changed

+61
-4
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,18 @@ jobs:
252252
fi
253253
done
254254
255+
- uses: actions/setup-java@v4
256+
if: steps.tag.outputs.version != ''
257+
with:
258+
distribution: 'temurin'
259+
java-version: '17'
260+
255261
- name: release android aar to maven central
256-
if: false # maven central namespace needs to be verified first steps.tag.outputs.version != ''
257-
run: cd packages/android && gradle publishReleasePublicationToOSSRHRepository -PVERSION=${{ steps.tag.outputs.version }}
262+
if: steps.tag.outputs.version != ''
263+
run: cd packages/android && ./gradlew publishAllPublicationsToMavenCentral -PVERSION=${{ steps.tag.outputs.version }}
258264
env:
259-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
260-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
265+
SONATYPE_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
266+
SONATYPE_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
261267
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
262268
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
263269

packages/android/build.gradle

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ buildscript {
88
}
99
}
1010

11+
plugins {
12+
id 'com.gradleup.nmcp' version '1.2.0'
13+
}
14+
1115
apply plugin: 'com.android.library'
1216
apply plugin: 'maven-publish'
1317

@@ -56,7 +60,54 @@ afterEvaluate {
5660
version = project.hasProperty('VERSION') ? project.VERSION : ['make', 'version'].execute(null, file('../..')).text.trim()
5761

5862
artifact bundleReleaseAar
63+
64+
pom {
65+
name = 'SQLite Vector'
66+
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.'
67+
url = 'https://github.com/sqliteai/sqlite-vector'
68+
69+
licenses {
70+
license {
71+
name = 'Elastic License 2.0'
72+
url = 'https://www.elastic.co/licensing/elastic-license'
73+
}
74+
}
75+
76+
developers {
77+
developer {
78+
id = 'sqliteai'
79+
name = 'SQLite Cloud, Inc.'
80+
81+
organization = 'SQLite Cloud, Inc.'
82+
organizationUrl = 'https://sqlite.ai'
83+
}
84+
}
85+
86+
scm {
87+
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+
}
91+
}
5992
}
6093
}
6194
}
95+
}
96+
97+
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)
103+
sign publishing.publications.release
104+
}
105+
}
106+
107+
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"
112+
}
62113
}

0 commit comments

Comments
 (0)