Skip to content

Commit ec550aa

Browse files
committed
Add release automation
1 parent 8b545b0 commit ec550aa

File tree

2 files changed

+122
-0
lines changed

2 files changed

+122
-0
lines changed

.github/workflows/release.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v3
21+
with:
22+
distribution: 'adopt'
23+
java-version: '17'
24+
25+
- name: Cache Maven packages
26+
uses: actions/cache@v3
27+
with:
28+
path: ~/.m2/repository
29+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
30+
restore-keys: ${{ runner.os }}-maven
31+
32+
- name: Cache Docker layers
33+
uses: actions/cache@v3
34+
with:
35+
path: /var/lib/docker
36+
key: ${{ runner.os }}-docker-${{ hashFiles('Dockerfile') }}
37+
restore-keys: |
38+
${{ runner.os }}-docker-
39+
40+
- name: Build Project
41+
run: mvn clean package
42+
43+
# Create a release
44+
- name: Run JReleaser
45+
run: mvn jreleaser:full-release
46+
env:
47+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
# Persist logs
50+
- name: JReleaser release output
51+
if: always()
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: jreleaser-release
55+
path: |
56+
out/jreleaser/trace.log
57+
out/jreleaser/output.properties

pom.xml

+65
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,29 @@
88
<artifactId>neo4j-db-copy</artifactId>
99
<version>1.0-SNAPSHOT</version>
1010

11+
<description>Neo4j data copy tool, through the bolt protocol</description>
12+
<url>https://github.com/nmervaillie/neo4j-db-copy</url>
13+
<inceptionYear>2023</inceptionYear>
14+
15+
<licenses>
16+
<license>
17+
<name>The Apache Software License, Version 2.0</name>
18+
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
19+
<distribution>repo</distribution>
20+
</license>
21+
</licenses>
22+
23+
<developers>
24+
<developer>
25+
<id>nmervaillie</id>
26+
<name>Nicolas Mervaillie</name>
27+
<roles>
28+
<role>Graphista</role>
29+
</roles>
30+
<timezone>+1</timezone>
31+
</developer>
32+
</developers>
33+
1134
<properties>
1235
<java.version>17</java.version>
1336
<maven.compiler.source>17</maven.compiler.source>
@@ -23,6 +46,7 @@
2346
<testcontainers-bom.version>1.20.1</testcontainers-bom.version>
2447
<surefire.version>3.0.0-M7</surefire.version>
2548
<failsafe.version>3.0.0-M7</failsafe.version>
49+
<jreleaser.version>1.13.1</jreleaser.version>
2650
</properties>
2751

2852
<dependencies>
@@ -179,6 +203,47 @@
179203
</execution>
180204
</executions>
181205
</plugin>
206+
<plugin>
207+
<groupId>org.jreleaser</groupId>
208+
<artifactId>jreleaser-maven-plugin</artifactId>
209+
<version>${jreleaser.version}</version>
210+
<inherited>false</inherited>
211+
<configuration>
212+
<jreleaser>
213+
<release>
214+
<github>
215+
<owner>nmervaillie</owner>
216+
<overwrite>true</overwrite>
217+
<tagName>{{projectVersion}}</tagName>
218+
<releaseName>Release {{projectVersion}}</releaseName>
219+
</github>
220+
</release>
221+
<distributions>
222+
<app>
223+
<artifacts>
224+
<artifact>
225+
<path>
226+
${project.build.directory}/${project.artifactId}
227+
</path>
228+
</artifact>
229+
<artifact>
230+
<path>
231+
${project.build.directory}/${project.artifactId}-${project.version}.jar
232+
</path>
233+
</artifact>
234+
</artifacts>
235+
</app>
236+
</distributions>
237+
</jreleaser>
238+
</configuration>
239+
<executions>
240+
<execution>
241+
<goals>
242+
<goal>full-release</goal>
243+
</goals>
244+
</execution>
245+
</executions>
246+
</plugin>
182247
<plugin>
183248
<groupId>org.apache.maven.plugins</groupId>
184249
<artifactId>maven-surefire-plugin</artifactId>

0 commit comments

Comments
 (0)