File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 1
1
plugins {
2
2
alias(libs.plugins.android.library)
3
3
alias(libs.plugins.kotlin.android)
4
+ id(" maven-publish" )
4
5
}
5
6
6
7
android {
@@ -38,6 +39,65 @@ android {
38
39
kotlinOptions {
39
40
jvmTarget = " 11"
40
41
}
42
+
43
+ publishing {
44
+ singleVariant(" release" ) {
45
+ withSourcesJar()
46
+ }
47
+ }
48
+ }
49
+
50
+ publishing {
51
+ publications {
52
+ create<MavenPublication >(" release" ) {
53
+ groupId = " org.sessionfoundation"
54
+ artifactId = " libsession-util-android"
55
+ version = System .getenv(" VERSION" ) ? : " dev-snapshot"
56
+
57
+ pom {
58
+ url = " getsession.org"
59
+
60
+ licenses {
61
+ license {
62
+ name = " GNU GENERAL PUBLIC LICENSE, Version 3"
63
+ url = " https://www.gnu.org/licenses/gpl-3.0.txt"
64
+ }
65
+ }
66
+
67
+ scm {
68
+ connection = " scm:git:https://github.com/session-foundation/libsession-android"
69
+ url = " https://github.com/session-foundation/libsession-android"
70
+ }
71
+ }
72
+
73
+ afterEvaluate {
74
+ from(components[" release" ])
75
+ }
76
+ }
77
+
78
+ repositories {
79
+ maven {
80
+ name = " libsession-util-android"
81
+ url = uri(layout.buildDirectory.dir(" repo" ))
82
+ }
83
+
84
+ val githubUser = System .getenv(" GITHUB_USER" ).orEmpty()
85
+ val githubToken = System .getenv(" GITHUB_TOKEN" ).orEmpty()
86
+
87
+ // Only enable the github remote repository if credentials are given
88
+ if (githubUser.isNotBlank() && githubToken.isNotBlank()) {
89
+ maven {
90
+ name = " libsession-util-android"
91
+ url =
92
+ uri(" https://maven.pkg.github.com/session-foundation/libsession-android" )
93
+ credentials {
94
+ username = githubUser
95
+ password = githubToken
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
41
101
}
42
102
43
103
dependencies {
You can’t perform that action at this time.
0 commit comments