Skip to content

Commit 4828244

Browse files
Add JReleaser Config
Co-authored-by: Markus Stoy <markus.stoy@lmax.com>
1 parent 47010c4 commit 4828244

File tree

2 files changed

+88
-8
lines changed

2 files changed

+88
-8
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,16 @@ jobs:
2424
- name: Setup Gradle
2525
uses: gradle/actions/setup-gradle@v3
2626
- name: Publish package
27-
run: .gradlew publish
27+
run: ./gradlew :nanofix-client:jreleaserFullRelease
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
31+
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.JRELEASER_MAVENCENTRAL_TOKEN }}
32+
JRELEASER_GPG_SECRET_KEY: "${{ secrets.JRELEASER_GPG_SECRET_KEY }}"
33+
JRELEASER_GPG_PUBLIC_KEY: "${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}"
34+
JRELEASER_GPG_PASSPHRASE: "${{ secrets.JRELEASER_GPG_PASSPHRASE }}"
35+
JRELEASER_GITHUB_TOKEN: ${{ github.token }}
36+
JRELEASER_MAVENCENTRAL_STAGE: "FULL"
3037
- name: Add Artifact to GitHub Release
3138
uses: softprops/action-gh-release@v1
3239
with:

nanofix-client/build.gradle

Lines changed: 80 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
plugins {
1717
id 'maven-publish'
18+
id 'org.jreleaser' version '1.14.0'
1819
}
1920

2021
dependencies {
@@ -23,21 +24,93 @@ dependencies {
2324
implementation 'org.slf4j:slf4j-api:1.7.16'
2425
}
2526

27+
jreleaser {
28+
files {
29+
active = 'ALWAYS'
30+
glob {
31+
pattern = 'build/staging-deploy/**/*.jar'
32+
pattern = 'build/staging-deploy/**/*.pom'
33+
pattern = 'build/staging-deploy/**/*.module'
34+
}
35+
}
36+
signing {
37+
active = 'ALWAYS'
38+
armored = true
39+
mode = 'MEMORY'
40+
}
41+
deploy {
42+
maven {
43+
mavenCentral {
44+
sonatype {
45+
active = 'ALWAYS'
46+
url = 'https://central.sonatype.com/api/v1/publisher'
47+
stagingRepository('build/staging-deploy')
48+
applyMavenCentralRules = true
49+
}
50+
}
51+
}
52+
}
53+
release {
54+
github {
55+
skipRelease = true
56+
}
57+
}
58+
gitRootSearch = true
59+
}
60+
2661
publishing {
2762
publications {
28-
mavenJava(MavenPublication) {
63+
maven(MavenPublication) {
64+
groupId = 'com.lmax'
65+
artifactId = 'nanofix'
66+
2967
from components.java
68+
69+
pom {
70+
name = 'nanofix'
71+
description = 'A fix client for testing FIX servers.'
72+
url = 'https://github.com/LMAX-Exchange/nanofix'
73+
inceptionYear = '2015'
74+
licenses {
75+
license {
76+
name = 'Apache-2.0'
77+
url = 'https://spdx.org/licenses/Apache-2.0.html'
78+
}
79+
}
80+
developers {
81+
developer {
82+
id = 'gaddiej'
83+
name = 'Judd Gaddie'
84+
}
85+
developer {
86+
id = 'barkerm'
87+
name = 'Michael Barker'
88+
}
89+
developer {
90+
id = 'shearerd'
91+
name = 'Daniel Shearer'
92+
}
93+
developer {
94+
id = 'singlaj'
95+
name = 'Jatinder Singla'
96+
}
97+
developer {
98+
id = 'stoym'
99+
name = 'Markus Stoy'
100+
}
101+
}
102+
scm {
103+
connection = 'scm:git:https://github.com/LMAX-Exchange/nanofix.git'
104+
developerConnection = 'scm:git:ssh://github.com/LMAX-Exchange/nanofix.git'
105+
url = 'https://github.com/LMAX-Exchange/nanofix'
106+
}
107+
}
30108
}
31109
}
32110

33111
repositories {
34112
maven {
35-
name = 'GitHubPackages'
36-
url = 'https://maven.pkg.github.com/' + System.getenv('GITHUB_REPOSITORY')
37-
credentials {
38-
username = System.getenv('GITHUB_ACTOR')
39-
password = System.getenv('GITHUB_TOKEN')
40-
}
113+
url = layout.buildDirectory.dir('staging-deploy')
41114
}
42115
}
43116
}

0 commit comments

Comments
 (0)