diff --git a/.circleci/config.yml b/.circleci/config.yml index e5421d3..bee7939 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,6 +25,32 @@ jobs: - checkout - android/start-emulator-and-run-tests: system-image: system-images;android-30;google_apis;x86 + release-build: + executor: + name: android/android-machine + resource-class: large + tag: default + steps: + - checkout + - android/restore-gradle-cache + - android/restore-build-cache + - run: + name: Assemble release build + command: ./gradlew assembleRelease + - store_artifacts: + path: core/build/outputs/aar + publish_maven: + executor: + name: android/android-machine + resource-class: large + tag: default + steps: + - checkout + - gradle/with_cache: + steps: + - run: + name: "Publish Artifacts to Maven" + command: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository workflows: test: diff --git a/build.gradle.kts b/build.gradle.kts index f319e3a..bcb40f0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,4 +3,14 @@ plugins { alias(libs.plugins.jetbrains.kotlin.android) apply false alias(libs.plugins.android.library) apply false alias(libs.plugins.android.application) apply false + alias(libs.plugins.publish.plugin) +} + +nexusPublishing { + repositories { + sonatype { + username.set(System.getenv("OSSRH_USERNAME")) + password.set(System.getenv("OSSRH_PASSWORD")) + } + } } diff --git a/core/build.gradle.kts b/core/build.gradle.kts index bc45480..af7d334 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,4 +1,5 @@ plugins { + `maven-publish` alias(libs.plugins.android.library) alias(libs.plugins.jetbrains.kotlin.android) } @@ -9,6 +10,9 @@ android { defaultConfig { minSdk = 21 + aarMetadata { + minCompileSdk = 21 + } buildConfigField("String","HONEYCOMB_DISTRO_VERSION","\"0.0.1-alpha\"") @@ -73,3 +77,17 @@ dependencies { androidTestImplementation(libs.opentelemetry.sdk) androidTestImplementation(libs.opentelemetry.android.agent) } + +publishing { + publications { + register("release") { + groupId = "io.honeycomb.android" + artifactId = "honeycomb-opentelemetry-android" + version = "0.0.1-alpha" + + afterEvaluate { + from(components["release"]) + } + } + } +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 21600eb..46c508c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,19 +1,20 @@ [versions] +activityCompose = "1.9.0" agp = "8.5.0" +composeBom = "2024.04.01" coreKtx = "1.13.1" desugarLibs = "2.0.4" espressoCore = "3.6.1" junit = "4.13.2" junitVersion = "1.2.1" kotlin = "1.9.0" +lifecycleRuntimeKtx = "2.8.3" mockitoCore = "4.11.0" mockitoKotlin = "4.1.0" opentelemetry = "1.38.0" opentelemetryAndroid = "0.7.0-alpha" opentelemetryInstrumentation = "2.7.0" -lifecycleRuntimeKtx = "2.8.3" -activityCompose = "1.9.0" -composeBom = "2024.04.01" +publish = "1.3.0" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -44,7 +45,7 @@ androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit androidx-material3 = { group = "androidx.compose.material3", name = "material3" } [plugins] +android-application = { id = "com.android.application", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" } jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -android-application = { id = "com.android.application", version.ref = "agp" } - +publish-plugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "publish" }