diff --git a/Makefile b/Makefile index 2d55827..c8de359 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,16 @@ publish-local: build rm -rf $$HOME/.m2/repository/org/docstr/gwt ${PROJECT_DIR}/gradlew publishToMavenLocal --warning-mode all +publish-maven: build + rm -rf $$HOME/.m2/repository/org/docstr/gwt + git checkout tags/${LATEST_TAG} + ${PROJECT_DIR}/gradlew publishMavenJavaPublicationToMavenLocal publishMavenJavaPublicationToMavenRepository + git checkout main + publish: build + rm -rf $$HOME/.m2/repository/org/docstr/gwt ${PROJECT_DIR}/gradlew publishPlugins --warning-mode all + git checkout main site: cd ${PROJECT_DIR}/doc && docstr site build && cd ${PROJECT_DIR}/../dn-hosting-sites && make deploy-gwtgradle diff --git a/README.md b/README.md index 9ff621c..850a9ec 100644 --- a/README.md +++ b/README.md @@ -113,5 +113,5 @@ gradlew.bat clean build - Build and test the plugin locally - Commit all changes to the `main` branch -- Publish the plugin to the Gradle Plugin Portal with `make publish` - Create a new release on GitHub with `make release` +- Publish the plugin to the Gradle Plugin Portal with `make publish` diff --git a/plugin/build.gradle b/plugin/build.gradle index 4f41ade..c0b21c0 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -9,6 +9,7 @@ plugins { // developing Gradle plugins id 'java-gradle-plugin' + id 'signing' id 'maven-publish' alias(libs.plugins.plugin.publish) @@ -52,6 +53,13 @@ gradlePlugin { } } +signing { + sign publishing.publications +} + +def ossrU = project.hasProperty("ossrhToken") ? ossrhToken : "" +def ossrP = project.hasProperty("ossrhTokenPassword") ? ossrhTokenPassword : "" + publishing { publications { mavenJava(MavenPublication) { @@ -90,15 +98,15 @@ publishing { } repositories { mavenLocal() - //maven { - // def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" - // def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" - // url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - // credentials { - // username = ossrU - // password = ossrP - // } - //} + maven { + def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + credentials { + username = ossrU + password = ossrP + } + } } }