From 0c68e723416d9c3b22b97f5132041998f753543f Mon Sep 17 00:00:00 2001 From: PJ Date: Sat, 18 Apr 2026 00:16:33 +0700 Subject: [PATCH] feat(sdk-android): publish to GitHub Packages at maven.pkg.github.com Coordinates: dev.uatu:sdk-android:0.0.1. Credentials read from GH_TOKEN/GH_USERNAME (or GITHUB_TOKEN/GITHUB_ACTOR for CI). .env is gitignored so local tokens stay out of git. Consumers add the maven repo + debugImplementation in their build.gradle and we're done. --- .gitignore | 4 ++++ sdk/android/build.gradle.kts | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/.gitignore b/.gitignore index cd7169c..02b4f83 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,7 @@ local.properties # Node node_modules/ + +# Secrets +.env +.env.local diff --git a/sdk/android/build.gradle.kts b/sdk/android/build.gradle.kts index a64475a..2b9dac8 100644 --- a/sdk/android/build.gradle.kts +++ b/sdk/android/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("com.android.library") version "8.11.0" kotlin("android") version "2.1.21" + `maven-publish` } android { @@ -24,6 +25,35 @@ android { testOptions { unitTests.isReturnDefaultValues = true } + + publishing { + singleVariant("release") { + withSourcesJar() + } + } +} + +publishing { + publications { + register("release") { + groupId = "dev.uatu" + artifactId = "sdk-android" + version = "0.0.1" + afterEvaluate { + from(components["release"]) + } + } + } + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/priyanshujain/uatu") + credentials { + username = System.getenv("GH_USERNAME") ?: System.getenv("GITHUB_ACTOR") ?: "priyanshujain" + password = System.getenv("GH_TOKEN") ?: System.getenv("GITHUB_TOKEN") ?: "" + } + } + } } dependencies {