Skip to content

Commit 034a842

Browse files
committed
Attempt 1 at configuring JReleaser for publishing to sonatype
1 parent edda36f commit 034a842

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
# Run tests & build artifact
4040
- name: Run tests & build release
41-
run: ./mvnw package
41+
run: ./mvnw install -Prelease
4242

4343
# Upload test results
4444
- name: Upload Test Results
@@ -73,7 +73,12 @@ jobs:
7373
env:
7474
JRELEASER_PROJECT_VERSION: ${{ env.JRELEASER_PROJECT_VERSION }}
7575
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76-
76+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
77+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
78+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
79+
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.JRELEASER_DEPLOY_MAVEN_NEXUS2_USERNAME }}
80+
JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.JRELEASER_DEPLOY_MAVEN_NEXUS2_PASSWORD }}
81+
7782
# Upload JRelease debug log
7883
- name: JReleaser output
7984
if: steps.tagged.outputs.tagExists == 0

jreleaser.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,24 @@ distributions:
2929
type: SINGLE_JAR
3030
artifacts:
3131
- path: target/{{projectName}}-{{projectVersion}}.jar
32+
33+
signing:
34+
active: RELEASE
35+
mode: MEMORY
36+
armored: true
37+
verify: true
38+
artifacts: true
39+
checksums: true
40+
files: false
41+
42+
deploy:
43+
maven:
44+
nexus2:
45+
app:
46+
active: RELEASE
47+
url: https://s01.oss.sonatype.org/service/local
48+
applyMavenCentralRules: true
49+
stagingRepositories:
50+
- target/staging-deploy
51+
closeRepository: true
52+
releaseRepository: true

pom.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,39 @@
9898
</plugins>
9999
</build>
100100

101+
<profiles>
102+
<profile>
103+
<id>release</id>
104+
<build>
105+
<plugins>
106+
<plugin>
107+
<groupId>org.apache.maven.plugins</groupId>
108+
<artifactId>maven-javadoc-plugin</artifactId>
109+
<version>3.4.1</version>
110+
<executions>
111+
<execution>
112+
<id>attach-javadoc</id>
113+
<goals>
114+
<goal>jar</goal>
115+
</goals>
116+
</execution>
117+
</executions>
118+
</plugin>
119+
<plugin>
120+
<groupId>org.apache.maven.plugins</groupId>
121+
<artifactId>maven-source-plugin</artifactId>
122+
<version>3.2.1</version>
123+
<executions>
124+
<execution>
125+
<id>attach-source</id>
126+
<goals>
127+
<goal>jar</goal>
128+
</goals>
129+
</execution>
130+
</executions>
131+
</plugin>
132+
</plugins>
133+
</build>
134+
</profile>
135+
</profiles>
101136
</project>

0 commit comments

Comments
 (0)