Skip to content

Commit 5a11d68

Browse files
authored
Merge pull request #21 from agorapulse/chore/migrate-to-new-maven-central-publishing
migrate to new maven central publishing
2 parents a8c44f7 + 1701b9a commit 5a11d68

47 files changed

Lines changed: 140 additions & 523 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/gradle-versions-watchdog.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/gradle.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ jobs:
1010
CI: true
1111
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
1212
steps:
13-
- uses: actions/checkout@v2
14-
- name: Set up JDK 1.8
15-
uses: actions/setup-java@v1
13+
- uses: actions/checkout@v4
14+
- name: Set up JDK 11
15+
uses: actions/setup-java@v4
1616
with:
17-
java-version: 1.8
18-
- uses: eskatos/gradle-command-action@v1
19-
with:
20-
arguments: check coveralls --stacktrace
21-
- name: Show Reports
22-
uses: actions/upload-artifact@v1
23-
if: failure()
24-
with:
25-
name: reports
26-
path: build/reports/
17+
java-version: '11'
18+
distribution: 'zulu'
19+
- uses: gradle/actions/setup-gradle@v4
20+
- run: ./gradlew check coveralls --stacktrace

.github/workflows/release.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,24 @@ jobs:
1010
env:
1111
GRADLE_OPTS: "-Xmx6g -Xms4g"
1212
steps:
13-
- uses: actions/checkout@v2
14-
- name: Set up JDK 1.8
15-
uses: actions/setup-java@v1
13+
- uses: actions/checkout@v4
14+
- name: Set up JDK 11
15+
uses: actions/setup-java@v4
1616
with:
17-
java-version: 1.8
18-
- name: Semantic Version
19-
id: version
20-
uses: ncipollo/semantic-version-action@v1
17+
java-version: '11'
18+
distribution: 'zulu'
2119
- name: Decode PGP
2220
id: write_file
2321
uses: timheuer/base64-to-file@v1
2422
with:
2523
fileName: 'secret.pgp'
2624
encodedString: ${{ secrets.SIGNING_SECRET_KEY_BASE64 }}
27-
- uses: eskatos/gradle-command-action@v1
28-
env:
29-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
30-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
25+
- uses: gradle/actions/setup-gradle@v4
26+
- env:
3127
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
3228
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
3329
SIGNING_SECRET_KEY_PATH: ${{ steps.write_file.outputs.filePath }}
34-
with:
35-
arguments: gitPublishPush publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ steps.version.outputs.tag }} -Prelease=true -Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }} --stacktrace
30+
run: ./gradlew gitPublishPush publishAndReleaseToMavenCentral "-Pversion=${{ github.ref_name }}" -PmavenCentralUsername=${{ secrets.SONATYPE_USERNAME }} -PmavenCentralPassword=${{ secrets.SONATYPE_PASSWORD }} -Prelease=true "-Dorg.ajoberstar.grgit.auth.username=${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }}" --stacktrace
3631
ping:
3732
name: Notify Upstream Repositories
3833
runs-on: ubuntu-latest
@@ -43,14 +38,11 @@ jobs:
4338
- agorapulse/agorapulse-bom
4439
- agorapulse/agorapulse-oss
4540
steps:
46-
- uses: actions/checkout@v1
47-
- name: Semantic Version
48-
id: version
49-
uses: ncipollo/semantic-version-action@v1
41+
- uses: actions/checkout@v4
5042
- name: Dispatch to ${{ matrix.repository }}
5143
uses: peter-evans/repository-dispatch@v1
5244
with:
5345
token: ${{ secrets.AGORAPULSE_BOT_PERSONAL_TOKEN }}
5446
repository: ${{ matrix.repository }}
5547
event-type: ap-new-version-released-event
56-
client-payload: '{ "group": "com.agorapulse.testing", "module": "testing-libraries", "version": "${{ steps.version.outputs.tag }}", "property" : "testing.libraries.version", "github" : ${{ toJson(github) }} }'
48+
client-payload: '{ "group": "com.agorapulse.testing", "module": "testing-libraries", "version": "${{ github.ref_name }}", "property" : "testing.libraries.version", "github" : ${{ toJson(github) }} }'

build.gradle

Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SPDX-License-Identifier: Apache-2.0
33
*
4-
* Copyright 2018-2021 Agorapulse.
4+
* Copyright 2018-2025 Agorapulse.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -20,14 +20,13 @@ plugins {
2020
id 'org.kordamp.gradle.checkstyle'
2121
id 'org.kordamp.gradle.codenarc'
2222
id 'org.kordamp.gradle.coveralls'
23-
id 'io.github.gradle-nexus.publish-plugin'
2423
}
2524

26-
if (!project.hasProperty('ossrhUsername')) ext.ossrhUsername = System.getenv('SONATYPE_USERNAME') ?: '**UNDEFINED**'
27-
if (!project.hasProperty('ossrhPassword')) ext.ossrhPassword = System.getenv('SONATYPE_PASSWORD') ?: '**UNDEFINED**'
28-
if (!project.hasProperty('signingKeyId')) ext.signingKeyId = System.getenv('SIGNING_KEY_ID') ?: '**UNDEFINED**'
29-
if (!project.hasProperty('signingPassword')) ext.signingPassword = System.getenv('SIGNING_PASSWORD') ?: '**UNDEFINED**'
30-
if (!project.hasProperty('signingSecretKey')) ext.signingSecretKey = System.getenv('SIGNING_SECRET_KEY_PATH') ? rootProject.file(System.getenv('SIGNING_SECRET_KEY_PATH')).text : '**UNDEFINED**'
25+
if (!project.hasProperty('mavenCentralUsername')) ext.mavenCentralUsername = System.getenv('SONATYPE_USERNAME') ?: '**UNDEFINED**'
26+
if (!project.hasProperty('mavenCentralPassword')) ext.mavenCentralPassword = System.getenv('SONATYPE_PASSWORD') ?: '**UNDEFINED**'
27+
if (!project.hasProperty('signingInMemoryKeyId')) ext.signingInMemoryKeyId = System.getenv('SIGNING_KEY_ID') ?: '**UNDEFINED**'
28+
if (!project.hasProperty('signingInMemoryKeyPassword')) ext.signingInMemoryKeyPassword = System.getenv('SIGNING_PASSWORD') ?: '**UNDEFINED**'
29+
if (!project.hasProperty('signingInMemoryKey')) ext.signingInMemoryKey = System.getenv('SIGNING_SECRET_KEY_PATH') ? rootProject.file(System.getenv('SIGNING_SECRET_KEY_PATH')).text : '**UNDEFINED**'
3130

3231
config {
3332
release = (rootProject.findProperty('release') ?: false).toBoolean()
@@ -74,13 +73,20 @@ config {
7473
publishing {
7574
enabled = false
7675
signing {
77-
enabled = true
78-
keyId = signingKeyId
79-
secretKey = signingSecretKey
80-
password = signingPassword
76+
enabled = false
77+
}
78+
}
79+
80+
artifacts {
81+
source {
82+
enabled = false
83+
}
84+
}
85+
86+
docs {
87+
javadoc {
88+
enabled = false
8189
}
82-
releasesRepository = 'localRelease'
83-
snapshotsRepository = 'localSnapshot'
8490
}
8591

8692
quality {
@@ -110,32 +116,15 @@ allprojects {
110116
}
111117
}
112118

113-
nexusPublishing {
114-
repositories {
115-
sonatype {
116-
nexusUrl = uri('https://s01.oss.sonatype.org/service/local/')
117-
snapshotRepositoryUrl = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/')
118-
username = ossrhUsername
119-
password = ossrhPassword
120-
}
121-
}
122-
}
123-
124119
subprojects { Project subproject ->
125120
if (subproject.name == 'guide') return
126121

127122
apply plugin: 'groovy'
123+
apply plugin: 'com.vanniktech.maven.publish'
128124

129125
targetCompatibility = JavaVersion.VERSION_1_8
130126
sourceCompatibility = JavaVersion.VERSION_1_8
131127

132-
config {
133-
bintray {
134-
name = subproject.name
135-
githubRepo = "agorapulse/$rootProject.name"
136-
}
137-
}
138-
139128
test {
140129
systemProperty 'TEST_RESOURCES_FOLDER', new File(subproject.projectDir, 'src/test/resources').canonicalPath
141130
systemProperty 'user.timezone', 'UTC'
@@ -147,6 +136,42 @@ subprojects { Project subproject ->
147136
}
148137

149138
clean.dependsOn cleanOut
139+
140+
mavenPublishing {
141+
publishToMavenCentral(true)
142+
signAllPublications()
143+
144+
pom {
145+
name = "Agorapulse Testing Libraries"
146+
description = 'Set of useful testing libraries'
147+
inceptionYear = "2018"
148+
url = "https://github.com/agorapulse/testing-libraries"
149+
licenses {
150+
license {
151+
name = "The Apache License, Version 2.0"
152+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
153+
distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
154+
}
155+
}
156+
developers {
157+
developer {
158+
id = "musketyr"
159+
name = "Vladimir Orany"
160+
url = "https://github.com/musketyr/"
161+
}
162+
}
163+
scm {
164+
url = "https://github.com/agorapulse/testing-libraries.git"
165+
connection = "scm:git:git://github.com/agorapulse/testing-libraries.git"
166+
developerConnection = "scm:git:ssh://git@github.com/agorapulse/testing-libraries.git"
167+
}
168+
}
169+
}
170+
171+
signing {
172+
useInMemoryPgpKeys(rootProject.ext.signingInMemoryKey, rootProject.ext.signingInMemoryKeyPassword)
173+
sign publishing.publications
174+
}
150175
}
151176

152177
check.dependsOn('aggregateCheckstyle', 'aggregateCodenarc', 'aggregateAllTestReports', 'coveralls')

docs/guide/guide.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SPDX-License-Identifier: Apache-2.0
33
*
4-
* Copyright 2018-2021 Agorapulse.
4+
* Copyright 2018-2025 Agorapulse.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

docs/guide/src/docs/asciidoc/index.adoc

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Fixt guarantee that the directories are created before the test run so adding ne
4040
.Gradle
4141
----
4242
repositories {
43-
jcenter()
43+
mavenCentral()
4444
}
4545
4646
dependencies {
@@ -76,45 +76,6 @@ include::{root-dir}/libs/fixt/src/test/groovy/com/agorapulse/testing/fixt/FixtSp
7676
<8> Copy whole directory from the test resources
7777
<9> All thehe files from the fixture directory are available in the new destination
7878

79-
== Grails Job Testing Support
80-
81-
Grails Job Testing Support brings the same trait-based tesing support to jobs created by the http://plugins.grails.org/plugin/grails/quartz[Quartz plugin] as the original
82-
https://testing.grails.org/]Grails Testing Support]. It provides `JobUnitTest<J>` trait which your specification can implement
83-
in order to test the job more easily.
84-
85-
=== Installation
86-
87-
[source,indent=0,role="primary",subs='verbatim,attributes']
88-
.Gradle
89-
----
90-
repositories {
91-
jcenter()
92-
}
93-
94-
dependencies {
95-
testCompile 'com.agorapulse.testing:grails-job-testing-support:{project-version}'
96-
}
97-
----
98-
99-
=== Usage
100-
101-
[source,groovy,indent=0,options="nowrap"]
102-
.Example Job
103-
----
104-
include::{root-dir}/libs/grails-job-testing-support/src/test/groovy/com/agorapulse/testing/grails/job/test/TestJob.groovy[lines=18..-1]
105-
----
106-
107-
[source,groovy,indent=0,options="nowrap"]
108-
.Example Specification
109-
----
110-
include::{root-dir}/libs/grails-job-testing-support/src/test/groovy/com/agorapulse/testing/grails/job/test/TestJobSpec.groovy[lines=18..-1]
111-
----
112-
<1> Implement `JobUnitTest` with the particular job under test
113-
<2> You can inject any mocks into the job instance
114-
<3> Trigger the job
115-
<4> Access the list of configured triggers
116-
<5> Access the job metadata
117-
11879
== Office Unit
11980

12081
Office Unit is trivial tool for matching Microsoft Office documents. It leverage their nature of
@@ -131,7 +92,7 @@ instead.
13192
.Gradle
13293
----
13394
repositories {
134-
jcenter()
95+
mavenCentral()
13596
}
13697
13798
dependencies {
@@ -178,7 +139,7 @@ Set of useful http://spockframework.org/[Spock Framework] extensions.
178139
.Gradle
179140
----
180141
repositories {
181-
jcenter()
142+
mavenCentral()
182143
}
183144
184145
dependencies {

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# SPDX-License-Identifier: Apache-2.0
33
#
4-
# Copyright 2018-2021 Agorapulse.
4+
# Copyright 2018-2025 Agorapulse.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@
1919
slug=agorapulse/testing-libraries
2020
group=com.agorapulse.testing
2121

22-
kordampVersion=0.46.0
23-
nexusPluginVersion=1.0.0
22+
kordampVersion=0.54.0
23+
mavenCentralPublishPluginVersion=0.34.0
2424
version = 0.2.0-SNAPSHOT
2525
groovyVersion = 2.5.4
2626
junitVersion = 4.13

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip

libs/fixt/fixt.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SPDX-License-Identifier: Apache-2.0
33
*
4-
* Copyright 2018-2021 Agorapulse.
4+
* Copyright 2018-2025 Agorapulse.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

libs/fixt/src/main/groovy/com/agorapulse/testing/fixt/Fixt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* SPDX-License-Identifier: Apache-2.0
33
*
4-
* Copyright 2018-2021 Agorapulse.
4+
* Copyright 2018-2025 Agorapulse.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)