Skip to content

Commit

Permalink
Github packages publish
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanSmudja committed Aug 22, 2024
1 parent efde567 commit b45cee3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
.externalNativeBuild
.cxx
local.properties
publishing.properties
6 changes: 0 additions & 6 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 30 additions & 2 deletions SlideView/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import java.util.Properties

plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin.android)
id("maven-publish")
}

val properties = Properties()
properties.load(project.rootProject.file("publishing.properties").inputStream())
val githubUser: String = properties.getProperty("GITHUB_USER") ?: ""
val githubToken: String = properties.getProperty("GITHUB_TOKEN") ?: ""

android {
namespace = "com.lilstiffy.slideview"
compileSdk = 34

defaultConfig {
minSdk = 23

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

Expand Down Expand Up @@ -38,6 +44,28 @@ android {
}
}

publishing {
publications {
create<MavenPublication>("release") {
groupId = "com.lilstiffy"
artifactId = "slideview"
version = "1.0.0"
artifact("$buildDir/outputs/aar/SlideView-release.aar")
}
}

repositories {
maven {
name = "GithubPackages"
url = uri("https://maven.pkg.github.com/lilstiffy/SlideView")
credentials {
username = githubUser
password = githubToken
}
}
}
}

dependencies {

implementation(libs.androidx.core.ktx)
Expand Down

0 comments on commit b45cee3

Please sign in to comment.