From 96e3dd5062d958305a9bd4a88859736634a188b6 Mon Sep 17 00:00:00 2001 From: marcus-daily <111281783+marcus-daily@users.noreply.github.com> Date: Mon, 19 Aug 2024 13:57:33 +0100 Subject: [PATCH] Preparing for publishing --- .github/workflows/ci.yaml | 11 +++- LICENSE | 24 +++++++++ gradle/libs.versions.toml | 2 + rtvi-client-android-daily/build.gradle.kts | 58 +++++++++++++++++++++- 4 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 LICENSE diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a5fc391..1f8c213 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,4 +34,13 @@ jobs: java-version: '17' - name: Build Daily transport - run: ./gradlew :rtvi-client-android-daily:assembleRelease \ No newline at end of file + run: ./gradlew :rtvi-client-android-daily:assembleRelease + + - name: Generate Maven repo + run: ./gradlew :rtvi-client-android-daily:publishAllPublicationsToRTVILocalRepoRepository + + - name: Upload Maven repo + uses: actions/upload-artifact@v4 + with: + name: RTVIClientAndroidDaily-Repo + path: build/RTVILocalRepo diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..cd6220d --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +BSD 2-Clause License + +Copyright (c) 2024, Daily + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index af3f527..2609865 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,6 +9,7 @@ kotlinxSerializationJson = "1.7.1" kotlinxSerializationPlugin = "2.0.0" dokka = "1.9.20" androidxTest = "1.6.1" +rtviClient = "0.1.0" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -18,6 +19,7 @@ daily-android-client = { module = "co.daily:client", version.ref = "daily-androi androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesTest" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } +rtvi-client = { module = "ai.rtvi:client", version.ref = "rtviClient" } [plugins] android-library = { id = "com.android.library", version.ref = "agp" } diff --git a/rtvi-client-android-daily/build.gradle.kts b/rtvi-client-android-daily/build.gradle.kts index 56afe4d..5c3c468 100644 --- a/rtvi-client-android-daily/build.gradle.kts +++ b/rtvi-client-android-daily/build.gradle.kts @@ -3,6 +3,8 @@ plugins { alias(libs.plugins.jetbrains.kotlin.android) alias(libs.plugins.jetbrains.kotlin.serialization) alias(libs.plugins.jetbrains.dokka) + `maven-publish` + signing } android { @@ -45,10 +47,64 @@ dependencies { implementation(libs.daily.android.client) //api(project(":rtvi-client-android")) - implementation("ai.rtvi:rtvi-client-android:0.1.0") + implementation(libs.rtvi.client) androidTestImplementation(libs.androidx.runner) androidTestImplementation(libs.androidx.rules) androidTestImplementation(libs.kotlinx.coroutines.test) +} + +publishing { + repositories { + maven { + url = rootProject.layout.buildDirectory.dir("RTVILocalRepo").get().asFile.toURI() + name = "RTVILocalRepo" + } + } + + publications { + register("release") { + groupId = "ai.rtvi" + artifactId = "client-daily" + version = "0.1.0" + + pom { + name.set("RTVI Client Daily Transport") + description.set("Daily RTVI client library for Android") + url.set("https://github.com/rtvi-ai/rtvi-client-android-daily") + + developers { + developer { + id.set("rtvi.ai") + name.set("rtvi.ai") + } + } + + licenses { + license { + name.set("BSD 2-Clause License") + url.set("https://github.com/rtvi-ai/rtvi-client-android-daily/blob/main/LICENSE") + } + } + + scm { + connection.set("scm:git:git://github.com/rtvi-ai/rtvi-client-android-daily.git") + developerConnection.set("scm:git:ssh://github.com:rtvi-ai/rtvi-client-android-daily.git") + url.set("https://github.com/rtvi-ai/rtvi-client-android-daily") + } + } + + afterEvaluate { + from(components["release"]) + } + } + } +} + +signing { + val signingKey = System.getenv("RTVI_GPG_SIGNING_KEY") + val signingPassphrase = System.getenv("RTVI_GPG_SIGNING_PASSPHRASE") + useInMemoryPgpKeys(signingKey, signingPassphrase) + sign(publishing.publications) } \ No newline at end of file