Skip to content

Commit d141c32

Browse files
committed
jreleaser config and github release workflow
1 parent 8f97546 commit d141c32

3 files changed

Lines changed: 78 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish package to the Maven Central Repository
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Java
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '11'
19+
distribution: 'temurin'
20+
- name: Build
21+
run: mvn clean compile
22+
- name: Publish to Maven Central
23+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
24+
env:
25+
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
26+
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
27+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
28+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.JRELEASER_MAVENCENTRAL_PASSWORD }}
29+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
30+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
31+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
32+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: mvn -Prelease deploy jreleaser:deploy -Djreleaser.config.file=jreleaser.yml -DaltDeploymentRepository=local::file:./target/staging-deploy -DskipTests

jreleaser.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
signing:
2+
active: ALWAYS
3+
armored: true
4+
5+
deploy:
6+
maven:
7+
mavenCentral:
8+
sonatype:
9+
active: RELEASE
10+
url: https://central.sonatype.com/api/v1/publisher
11+
stagingRepositories:
12+
- target/staging-deploy

pom.xml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
<artifactId>perun-assets</artifactId>
77
<version>4.0.0-SNAPSHOT</version>
88
<packaging>bundle</packaging>
9-
109
<name>perun-assets</name>
11-
<url>http://maven.apache.org</url>
12-
10+
<url>https://github.com/PerunTech/perun-assets</url>
11+
<organization>
12+
<name>Perun Technologies</name>
13+
<url>http://peruntech.org</url>
14+
</organization>
1315
<properties>
1416
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1517
</properties>
@@ -23,6 +25,34 @@
2325
</resource>
2426
</resources>
2527
<plugins>
28+
<plugin>
29+
<groupId>org.jreleaser</groupId>
30+
<artifactId>jreleaser-maven-plugin</artifactId>
31+
<version>1.19.0</version>
32+
<configuration>
33+
<jreleaser>
34+
<signing>
35+
<active>ALWAYS</active>
36+
<armored>true</armored>
37+
</signing>
38+
<deploy>
39+
<maven>
40+
<nexus2>
41+
<maven-central>
42+
<active>ALWAYS</active>
43+
<url>
44+
https://s01.oss.sonatype.org/service/local</url>
45+
<closeRepository>false</closeRepository>
46+
<releaseRepository>false</releaseRepository>
47+
<stagingRepositories>
48+
target/staging-deploy</stagingRepositories>
49+
</maven-central>
50+
</nexus2>
51+
</maven>
52+
</deploy>
53+
</jreleaser>
54+
</configuration>
55+
</plugin>
2656
<plugin>
2757
<groupId>org.apache.maven.plugins</groupId>
2858
<artifactId>maven-source-plugin</artifactId>

0 commit comments

Comments
 (0)