Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to Maven Central

# Publishes the :dotlottie library to the Maven Central Portal.
# Triggered when a GitHub Release is published, or manually.

on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"

- name: Set up Android SDK
uses: android-actions/setup-android@v3

- name: Install NDK and CMake
run: sdkmanager "ndk;29.0.14206865" "cmake;3.22.1"

- name: Publish to Maven Central
run: ./gradlew :dotlottie:publishToMavenCentral --no-daemon --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,21 @@ You can find and run the sample application in the `sample` directory.

## Installation

To add DotLottie Android, you need to add this dependency to your module's gradle file:
### Maven Central (recommended)

```kotlin
repositories {
mavenCentral()
}
```

```kotlin
dependencies {
implementation("com.lottiefiles:dotlottie-android:0.5.0")
}
```

### JitPack

```kotlin
repositories {
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.androidLibrary) apply false
// id("com.google.devtools.ksp") version "1.9.22-1.0.16" apply false
alias(libs.plugins.mavenPublish) apply false
id("maven-publish")
}
true // Needed to make the Suppress annotation work for the plugins block
50 changes: 38 additions & 12 deletions dotlottie/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
`maven-publish`
id("com.vanniktech.maven.publish")
id("com.lottiefiles.dotlottie-rust")
}

Expand Down Expand Up @@ -36,7 +38,7 @@ dotlottieRust {
// apiLevel = 21
}

group = "com.github.LottieFiles"
group = "com.lottiefiles"
version = "0.15.0"

android {
Expand Down Expand Up @@ -114,19 +116,43 @@ android {
}
}

publishing {
publications {
register<MavenPublication>("release") {
groupId = "com.github.LottieFiles"
artifactId = "dotlottie-android"
version = version
afterEvaluate {
from(components["release"])
mavenPublishing {
coordinates("com.lottiefiles", "dotlottie-android", version.toString())

pom {
name.set("dotLottie Android")
description.set(
"A powerful Android library for rendering Lottie and dotLottie animations " +
"with advanced features like interactivity, theming, and state machines."
)
inceptionYear.set("2024")
url.set("https://github.com/LottieFiles/dotlottie-android")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/LottieFiles/dotlottie-android/blob/main/LICENSE")
distribution.set("repo")
}
}
developers {
developer {
id.set("lottiefiles")
name.set("LottieFiles")
url.set("https://lottiefiles.com")
}
}
scm {
url.set("https://github.com/LottieFiles/dotlottie-android")
connection.set("scm:git:git://github.com/LottieFiles/dotlottie-android.git")
developerConnection.set("scm:git:ssh://git@github.com/LottieFiles/dotlottie-android.git")
}
}
repositories {
mavenLocal()

val hasSigningKey = providers.gradleProperty("signingInMemoryKey").isPresent ||
providers.environmentVariable("ORG_GRADLE_PROJECT_signingInMemoryKey").isPresent
if (hasSigningKey) {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = false)
signAllPublications()
}
}

Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ material = "1.9.0"
moshi = "1.15.0"
moshi-kotlin-codegen = "1.12.0"
okhttp = "4.12.0"
maven-publish = "0.30.0"
ui = "1.6.0"
ui-test-junit4 = "1.6.0"
ui-tooling-preview = "1.6.0"
Expand Down Expand Up @@ -55,4 +56,5 @@ material = { group = "com.google.android.material", name = "material", version.r
androidApplication = { id = "com.android.application", version.ref = "agp" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }

Loading