From 3a62b7cbf049f2ff3bdeae4fb5c9e093b0664771 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Mon, 28 Dec 2020 10:13:56 -0500 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=E5=B9=B6?= =?UTF-8?q?=E4=B8=94=E6=8F=90=E4=BA=A4=20OSSRH=20=E7=9A=84=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E4=B8=8A=E4=BC=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 63 ++++++++++++++++++++++++++++++++++++++++++++--- gradle.properties | 2 +- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index d5c71a6..188cfe8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,14 @@ plugins { id 'distribution' id 'maven-publish' + id 'maven' + id 'signing' id 'com.github.node-gradle.node' version '2.2.4' } -group = 'com.ossez.docresources' -description = 'Ossez 文档资源库' +group = 'com.ossez' +archivesBaseName = "doc-resources" +description = 'OSSEZ 文档资源库' node { version = '14.15.3' @@ -15,9 +18,17 @@ node { npm_run_build.dependsOn(npm_install) distZip.dependsOn npm_run_build +artifacts { + archives distZip +} + +signing { + sign configurations.archives +} + distributions { main { - baseName = 'ossez-doc-resources' + baseName = 'doc-resources' contents { from { "${buildDir}/dist" } into '/' @@ -25,6 +36,7 @@ distributions { } } + publishing { publications { maven(MavenPublication) { @@ -42,3 +54,48 @@ publishing { } } } + +uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + pom.project { + name 'Example Application' + packaging 'jar' + // optionally artifactId can be defined here + description 'A application used as an example on how to set up pushing its components to the Central Repository.' + url 'http://www.example.com/example-application' + + scm { + connection 'scm:svn:http://foo.googlecode.com/svn/trunk/' + developerConnection 'scm:svn:https://foo.googlecode.com/svn/trunk/' + url 'http://foo.googlecode.com/svn/trunk/' + } + + licenses { + license { + name 'The Apache License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + + developers { + developer { + id 'manfred' + name 'Manfred Moser' + email 'manfred@sonatype.com' + } + } + } + } + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 5e70b56..6b09920 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.2.6-SNAPSHOT +version=0.0.1-SNAPSHOT