Skip to content

Commit 458bcbe

Browse files
authored
Merge pull request #164 from jdaugherty/5.0.x
Updating for grails-publish changes
2 parents 5f4874e + a5c1a11 commit 458bcbe

File tree

5 files changed

+23
-135
lines changed

5 files changed

+23
-135
lines changed

.github/workflows/gradle.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ jobs:
4949
uses: gradle/gradle-build-action@v3
5050
env:
5151
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
52-
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
53-
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
52+
MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }}
53+
MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }}
54+
MAVEN_PUBLISH_URL: ${{ secrets.MAVEN_PUBLISH_SNAPSHOT_URL }}
5455
with:
55-
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
56+
arguments: publish
5657
- name: Build Docs
5758
id: docs
5859
if: success()

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
uses: gradle/gradle-build-action@v3
3535
env:
3636
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
37-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
38-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
39-
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
40-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
37+
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
38+
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
39+
NEXUS_PUBLISH_NEXUS_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }}
40+
NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }}
4141
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
4242
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
4343
SECRING_FILE: ${{ secrets.SECRING_FILE }}

build.gradle

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
1-
21
plugins {
32
id "java-library"
43
id "org.grails.grails-gsp"
54
id "org.grails.grails-plugin"
6-
id 'maven-publish'
7-
id 'io.github.gradle-nexus.publish-plugin'
85
}
96

107
version = project.projectVersion
118
group = 'org.grails.plugins'
129

13-
ext.set('isSnapshot', projectVersion.endsWith('-SNAPSHOT'))
14-
ext.set('isReleaseVersion', !isSnapshot)
15-
16-
ext.set('signing.keyId', project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY'))
17-
ext.set('signing.secretKeyRingFile', project.findProperty('signing.secretKeyRingFile') ?: System.getenv('SIGNING_PASSPHRASE') ?: "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg")
18-
ext.set('signing.password', project.findProperty("signing.password") ?: System.getenv('SIGNING_PASSPHRASE'))
19-
20-
21-
22-
2310
allprojects {
2411

2512
repositories {
@@ -32,23 +19,4 @@ allprojects {
3219
forkOptions.jvmArgs = ['-Xmx1024m']
3320
}
3421
}
35-
}
36-
37-
if (isReleaseVersion) {
38-
apply plugin: "io.github.gradle-nexus.publish-plugin"
39-
40-
nexusPublishing {
41-
repositories {
42-
sonatype {
43-
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
44-
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
45-
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
46-
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
47-
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
48-
username = ossUser
49-
password = ossPass
50-
stagingProfileId = ossStagingProfileId
51-
}
52-
}
53-
}
54-
}
22+
}

gradle.properties

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@ jredisVersion=5.2.0
1818
scaffoldingVersion=6.0.0-SNAPSHOT
1919
xmlBindApiVersion=4.0.2
2020

21-
title=Grails Redis Plugin
22-
authors=Puneet Behl
23-
projectDesc=This Plugin provides access to Redis and various utilities(service, annotations, etc) for caching.
24-
projectUrl=https://github.com/grails/grails-redis
25-
githubSlug=/grails/grails-redis
26-
githubBranch=5.0.x
27-
developers=Christian Oestreich, Puneet Behl
28-
29-
3021
org.gradle.caching=true
3122
org.gradle.daemon=true
3223
org.gradle.parallel=true

plugin/build.gradle

Lines changed: 14 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,19 @@ plugins {
33
id "eclipse"
44
id "idea"
55
id "org.grails.grails-plugin"
6-
id 'signing'
7-
id 'maven-publish'
86
}
97

108
version = project.projectVersion
119
group = "org.grails.plugins"
1210

11+
apply plugin: 'org.grails.grails-publish'
12+
1313
java {
1414
toolchain {
1515
languageVersion = JavaLanguageVersion.of(17)
1616
}
1717
}
1818

19-
def isGrailsPlugin = project.group == 'org.grails.plugins'
20-
def pomInfo = {
21-
delegate.name project.title
22-
delegate.description project.projectDesc
23-
delegate.url 'https://github.com/grails/grails-redis'
24-
25-
delegate.licenses {
26-
delegate.license {
27-
delegate.name 'Apache-2.0'
28-
delegate.url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
29-
delegate.distribution 'repo'
30-
}
31-
}
32-
33-
delegate.scm {
34-
delegate.url "scm:[email protected]:${githubSlug}.git"
35-
delegate.connection "https://github.com${githubSlug}"
36-
delegate.developerConnection "scm:git:ssh://github.com:${githubSlug}.git"
37-
}
38-
39-
if (developers) {
40-
delegate.developers {
41-
for (dev in developers.split(',')) {
42-
delegate.developer {
43-
delegate.id dev.toLowerCase().replace(' ', '')
44-
delegate.name dev.strip()
45-
}
46-
}
47-
}
48-
}
49-
}
50-
5119
dependencyManagement {
5220
imports {
5321
mavenBom "org.grails:grails-bom:$grailsVersion"
@@ -102,56 +70,16 @@ jar {
10270
exclude "src/test/projects/**"
10371
}
10472

105-
publishing {
106-
107-
if (isSnapshot) {
108-
repositories {
109-
maven {
110-
credentials {
111-
def u = System.getenv("ARTIFACTORY_USERNAME") ?: project.findProperty("artifactoryPublishUsername") ?: ''
112-
def p = System.getenv("ARTIFACTORY_PASSWORD") ?: project.findProperty("artifactoryPublishPassword") ?: ''
113-
username = u
114-
password = p
115-
}
116-
url = isGrailsPlugin ?
117-
uri('https://repo.grails.org/grails/plugins3-snapshots-local') :
118-
uri('https://repo.grails.org/grails/libs-snapshots-local')
119-
}
120-
}
73+
grailsPublish {
74+
githubSlug = 'grails/grails-redis'
75+
license {
76+
name = 'Apache-2.0'
12177
}
122-
123-
publications {
124-
maven(MavenPublication) {
125-
126-
groupId = project.group
127-
version = project.version
128-
129-
from components.java
130-
131-
artifact sourcesJar
132-
artifact javadocJar
133-
134-
pom.withXml {
135-
136-
def pomNode = asNode()
137-
pomNode.children().last() + pomInfo
138-
139-
// dependency management shouldn't be included
140-
try { pomNode.dependencyManagement.replaceNode({}) } catch (Throwable ignore) {}
141-
}
142-
}
143-
}
144-
}
145-
146-
if (isReleaseVersion) {
147-
afterEvaluate {
148-
signing {
149-
required = { isReleaseVersion && gradle.taskGraph.hasTask('publish') }
150-
sign(publishing.publications.maven)
151-
}
152-
}
153-
}
154-
155-
tasks.withType(Sign) {
156-
onlyIf { isReleaseVersion }
157-
}
78+
title = 'Grails Redis Plugin'
79+
desc = 'This Plugin provides access to Redis and various utilities (service, annotations, etc) for caching.'
80+
developers = ['tednaleid': 'Ted Naleid', 'burtbeckwith': 'Burt Beckwith', 'christianoestreich': 'Christian Oestreich',
81+
'briancoles': 'Brian Coles', 'michaelcameron': 'Michael Cameron', 'johnengelman': 'John Engelman',
82+
'davidseiler': 'David Seiler', 'jordonsaardchit': 'Jordon Saardchit', 'florianlangenhahn': 'Florian Langenhahn',
83+
'germansancho': 'German Sancho', 'johnmulhern': 'John Mulhern', 'shaunjurgemeyer': 'Shaun Jurgemeyer',
84+
'puneetbehl': 'Puneet Behl']
85+
}

0 commit comments

Comments
 (0)