Skip to content

Commit 9fcbf81

Browse files
committed
Added publush functionality
1 parent af87397 commit 9fcbf81

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ jobs:
1818
- name: Run Tests
1919
run: ./gradlew testDebugUnitTest
2020

21-
# need to apply for sonartype.
21+
- name: Run Tests
22+
run: ./gradlew publishAllPublicationsToGitHubPackagesRepository
23+
24+
# need to apply for sonartype?

build.gradle.kts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ val project_version: String by project
1111
group = "uk.co.andrewreed"
1212
version = project_version
1313

14+
val projectGithubUrl: String by project
15+
val projectGithubSCM: String by project
16+
val projectGithubSCMSSL: String by project
17+
val projectDescription: String by project
18+
19+
val developerId: String by project
20+
val developerName: String by project
21+
val developerEmail: String by project
22+
1423
repositories {
1524
google()
1625
jcenter()
@@ -94,6 +103,50 @@ android {
94103
}
95104
}
96105

106+
publishing {
107+
repositories {
108+
maven {
109+
name = "GitHubPackages"
110+
url = uri("https://maven.pkg.github.com/gitliveapp/packages")
111+
credentials {
112+
username = System.getenv("USERNAME")
113+
password = System.getenv("TOKEN")
114+
}
115+
}
116+
}
117+
118+
publications.all {
119+
this as MavenPublication
120+
121+
pom {
122+
name.set(group as String)
123+
description.set(projectDescription)
124+
url.set(projectGithubUrl)
125+
126+
licenses {
127+
license {
128+
name.set("MIT License")
129+
url.set("http://opensource.org/licenses/MIT")
130+
}
131+
}
132+
133+
developers {
134+
developer {
135+
id.set(developerId)
136+
name.set(developerName)
137+
email.set(developerEmail)
138+
}
139+
}
140+
141+
scm {
142+
url.set(projectGithubUrl)
143+
connection.set(projectGithubSCM)
144+
developerConnection.set(projectGithubSCMSSL)
145+
}
146+
}
147+
}
148+
}
149+
97150
ktlint {
98151
version.set("0.41.0")
99152
}

gradle.properties

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,14 @@ android_target_sdk_version=28
2222
android.useAndroidX=true
2323
kotlin.mpp.enableGranularSourceSetsMetadata=true
2424
kotlin.native.enableDependencyPropagation=false
25+
26+
#publishing
27+
projectGithubUrl=https://github.com/Reedyuk/jsonrpc-kotlin-client
28+
projectGithubSCM=scm:git:git://git@github.com:reedyuk/jsonrpc-kotlin-client.git
29+
projectGithubSCMSSL=scm:git:ssh://git@github.com:reedyuk/jsonrpc-kotlin-client.git
30+
projectDescription=A Kotlin Multiplatform Library for performing JSON-RPC 2.0 commands
31+
32+
developerId=Reedyuk
33+
developerName=Andrew Reed
34+
developerEmail=andrew_reed@hotmail.com
35+
developerOrganisationUrl=https://github.com/Reedyuk/

0 commit comments

Comments
 (0)