This guide covers how to publish the Gate/AI Android SDK for distribution.
Maven Central is the standard repository for Android libraries and provides the best developer experience.
- Sonatype Account: Create an account at issues.sonatype.org
- Group ID Verification: Verify ownership of
com.gateaior similar domain - GPG Key: Generate a GPG key for signing artifacts
- Credentials: Store in
~/.gradle/gradle.properties
- Add credentials to
~/.gradle/gradle.properties:
signing.keyId=YOUR_KEY_ID
signing.password=YOUR_KEY_PASSWORD
signing.secretKeyRingFile=/path/to/secring.gpg
ossrhUsername=YOUR_SONATYPE_USERNAME
ossrhPassword=YOUR_SONATYPE_PASSWORD- Publish to Maven Central:
cd gate-android
./gradlew publishToMavenCentral --no-configuration-cache- Release on Sonatype:
- Log in to s01.oss.sonatype.org
- Navigate to "Staging Repositories"
- Close and release your staging repository
- Artifacts will sync to Maven Central within ~10 minutes
Developers can then add to their build.gradle.kts:
dependencies {
implementation("com.gateai.sdk:gateai:1.0.0")
}JitPack builds directly from GitHub releases, requiring minimal setup.
-
Create a release on GitHub:
- Tag your release (e.g.,
v1.0.0) - Push the tag:
git tag v1.0.0 && git push origin v1.0.0 - Create a GitHub release from the tag
- Tag your release (e.g.,
-
JitPack automatically builds from your release tag
Add to your app's settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}Add to your app's build.gradle.kts:
dependencies {
implementation("com.github.YOUR_ORG:gate-android:v1.0.0")
}Good for internal distribution or private releases.
- Add GitHub token to
~/.gradle/gradle.properties:
gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_GITHUB_TOKEN- Publish:
cd gate-android
./gradlew publishAdd to your app's settings.gradle.kts:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/YOUR_ORG/GateAI")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}For local testing before publishing.
cd gate-android
./gradlew publishToMavenLocalThis installs to ~/.m2/repository/
Add to your app's settings.gradle.kts:
dependencyResolutionManagement {
repositories {
mavenLocal()
google()
mavenCentral()
}
}Add to your app's build.gradle.kts:
dependencies {
implementation("com.gateai.sdk:gateai:1.0.0-LOCAL")
}Update the version in gate-android/gradle.properties:
VERSION_NAME=1.0.0
GROUP=com.gateai.sdkFollow semantic versioning:
- Major (1.0.0 → 2.0.0): Breaking API changes
- Minor (1.0.0 → 1.1.0): New features, backward compatible
- Patch (1.0.0 → 1.0.1): Bug fixes
Before publishing a new version:
- Update
VERSION_NAMEingradle.properties - Update
CHANGELOG.mdwith release notes - Run full test suite:
./gradlew test - Run lint checks:
./gradlew lint - Build release AAR:
./gradlew assembleRelease - Test sample app with new version
- Update README with new version number
- Create Git tag:
git tag v1.0.0 - Push tag:
git push origin v1.0.0 - Create GitHub release with release notes
- Publish artifacts (Maven Central, JitPack, etc.)
- Verify installation in a fresh project
- Ensure the repository is added to your
settings.gradle.ktsorbuild.gradle.kts - For Maven Central, wait ~10 minutes after release for sync
- For JitPack, check build status at
https://jitpack.io/#YOUR_ORG/gate-android
- Verify GPG key is installed:
gpg --list-keys - Check
gradle.propertieshas correct signing credentials - Ensure key hasn't expired:
gpg --list-keys --keyid-format LONG
- Clear Gradle cache:
./gradlew clean - Delete
~/.gradle/caches/and rebuild - Use
--no-configuration-cacheflag if needed