@@ -89,6 +89,24 @@ tasks.named<Javadoc>("javadoc") {
89
89
exclude(" samples/**" )
90
90
}
91
91
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
+
92
110
publishing {
93
111
publications {
94
112
create<MavenPublication >(" mavenJava" ) {
@@ -108,11 +126,6 @@ publishing {
108
126
url.set(" https://opensource.org/licenses/MIT" )
109
127
}
110
128
}
111
- developers {
112
- developer {
113
-
114
- }
115
- }
116
129
scm {
117
130
connection.set(" scm:git:https://github.com/BackendStack21/realtime-pubsub-client-java.git" )
118
131
developerConnection.set(
" scm:git:ssh://[email protected] :BackendStack21/realtime-pubsub-client-java.git" )
@@ -126,5 +139,13 @@ publishing {
126
139
// local repository
127
140
url = uri(" file://${project.layout.buildDirectory.get()} /repo" )
128
141
}
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
+ }
129
150
}
130
151
}
0 commit comments