Skip to content

Commit

Permalink
try some other gradle plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
lony2003 committed May 28, 2024
1 parent f03b393 commit 29eca24
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 22 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ jobs:
if: ${{ matrix.java == '17' }}
uses: gradle/actions/setup-gradle@v3
with:
arguments: --scan build jreleaserPackage -x check -Djreleaser.gpg.keyname=${{ secrets.GPG_NAME }} -Djreleaser.gpg.passphrase=${{ secrets.GPG_PASSWORD }} -Djreleaser.github.token=${{ secrets.GITHUB_TOKEN }}
arguments: --scan publish -x check -Psigning.gnupg.executable=gpg -Psigning.gnupg.keyName=${{ secrets.GPG_NAME }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSWORD }}
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_PASS: ${{ secrets.OSSRH_PASS }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea

.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {
maven {
url 'https://plugins.gradle.org/m2/'
}
mavenCentral()
}
ext {
projectVersion = '0.1.0-SNAPSHOT'
Expand Down Expand Up @@ -42,7 +43,7 @@ plugins {
id 'com.github.ben-manes.versions' version "${versionsPluginVersion}" // gradle dependencyUpdates
id 'com.diffplug.spotless' version '6.25.0'
id 'org.jetbrains.kotlin.jvm' version "${kotlinVersion}" apply false
id 'org.jreleaser' version '1.12.0'
id "eu.kakde.gradle.sonatype-maven-central-publisher" version "1.0.6" apply false
}

// If you attempt to build without the `--scan` parameter in `gradle 6.0+` it will cause a build error that it can't find
Expand Down
77 changes: 58 additions & 19 deletions deploy.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'org.jreleaser'
apply plugin: "eu.kakde.gradle.sonatype-maven-central-publisher"

ext {
isReleaseVersion = !(projectVersion =~ /-SNAPSHOT$/)
Expand Down Expand Up @@ -77,25 +77,64 @@ publishing {
}
}

jreleaser {
signing {
mode = 'COMMAND'
active = 'ALWAYS'
armored = true
}
deploy {
maven {
mavenCentral {
sonatype {
active = 'ALWAYS'
url = 'https://central.sonatype.com/api/v1/publisher'
stagingRepository('target/staging-deploy')
username = System.getenv('OSSRH_USER')
password = System.getenv('OSSRH_PASS')

applyMavenCentralRules = true
}
sonatypeCentralPublishExtension {
groupId = project.group
artifactId = project.name
version = project.version
componentType = "java"
publishingType = "USER_MANAGED"
shaAlgorithms = List.of("SHA-512")


username = System.getenv("OSSRH_USER")
password = System.getenv("OSSRH_PASS")

// from components.java
// artifact sourcesJar
// artifact javadocJar

pom {
name = 'Dapr Spring Boot Starter'
description = 'Dapr Spring Boot Starter'
url = 'https://github.com/fangkehou-team/dapr-spring'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://opensource.org/licenses/Apache-2.0'
distribution = 'repo'
}
}
developers {
developer {
id = 'lony2003'
name = 'Lony Zhang'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/fangkehou-team/dapr-spring.git'
developerConnection = 'scm:git:[email protected]:fangkehou-team/dapr-spring.git'
url = 'https://github.com/fangkehou-team/dapr-spring'
}
}

versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}

//sonatypePortalPublisher {
// authentication {
// username = System.getenv("OSSRH_USER")
// password = System.getenv("OSSRH_PASS")
// }
//
// settings {
// autoPublish = false
// }
//}

0 comments on commit 29eca24

Please sign in to comment.