@@ -89,6 +89,24 @@ tasks.named<Javadoc>("javadoc") {
8989 exclude(" samples/**" )
9090}
9191
92+ // Task to zip the local repository folder after publishing
93+ tasks.register<Zip >(" zipRepo" ) {
94+ dependsOn(" publish" ) // Ensure repo is published before zipping
95+ from(" file://${project.layout.buildDirectory.get()} /repo" )
96+ archiveFileName.set(" bundle.zip" )
97+ destinationDirectory.set(layout.buildDirectory)
98+ }
99+
100+ // Task to delete the repo directory before publishing
101+ tasks.register<Delete >(" cleanRepo" ) {
102+ delete(layout.buildDirectory.dir(" repo" ))
103+ }
104+
105+ // Make sure the repo is cleaned before publishing
106+ tasks.named(" publish" ) {
107+ dependsOn(" cleanRepo" )
108+ }
109+
92110publishing {
93111 publications {
94112 create<MavenPublication >(" mavenJava" ) {
@@ -108,11 +126,6 @@ publishing {
108126 url.set(" https://opensource.org/licenses/MIT" )
109127 }
110128 }
111- developers {
112- developer {
113- 114- }
115- }
116129 scm {
117130 connection.set(" scm:git:https://github.com/BackendStack21/realtime-pubsub-client-java.git" )
118131 developerConnection.set(
" scm:git:ssh://[email protected] :BackendStack21/realtime-pubsub-client-java.git" )
@@ -126,5 +139,13 @@ publishing {
126139 // local repository
127140 url = uri(" file://${project.layout.buildDirectory.get()} /repo" )
128141 }
142+ maven {
143+ name = " GitHubPackages"
144+ url = uri(" https://maven.pkg.github.com/BackendStack21/realtime-pubsub-client-java" )
145+ credentials {
146+ username = System .getenv(" GITHUB_ACTOR" )
147+ password = System .getenv(" GITHUB_TOKEN" )
148+ }
149+ }
129150 }
130151}
0 commit comments