Skip to content

Commit 74f5010

Browse files
committed
Publish to maven central 2
1 parent 1d7112e commit 74f5010

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/workflows/publish-maven.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Publish package
2020
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
2121
with:
22-
arguments: publish
22+
arguments: publish closeAndReleaseRepository
2323
env:
2424
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
2525
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
plugins {
2+
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
3+
}
14
apply plugin: 'idea'
25
apply plugin: 'eclipse'
36
apply plugin: 'java'
@@ -116,6 +119,17 @@ if(hasProperty('target') && target == 'android') {
116119
}
117120
}
118121

122+
nexusPublishing {
123+
repositories {
124+
sonatype {
125+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
126+
snapshotRepositoryUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots/"))
127+
username = System.getenv("MAVEN_CENTRAL_USERNAME")
128+
password = System.getenv("MAVEN_CENTRAL_PASSWORD")
129+
}
130+
}
131+
}
132+
119133

120134
task execute(type:JavaExec) {
121135
main = System.getProperty('mainClass')
@@ -193,3 +207,4 @@ test {
193207
// }
194208
//
195209
//}
210+

0 commit comments

Comments
 (0)