Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit e8ff503

Browse files
committed
[release] - Github Actions to build, release and publishing artifacts to maven central
1 parent 6c0f841 commit e8ff503

File tree

7 files changed

+151
-51
lines changed

7 files changed

+151
-51
lines changed

.github/workflows/maven.yml

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Java CI with Maven
1+
name: Java CI
22

33
on:
44
push:
@@ -13,19 +13,70 @@ on:
1313
- develop/**
1414

1515
jobs:
16-
java:
16+
build:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
java: [ 11 ]
21-
name: Java ${{ matrix.java }}
20+
java: [ 8 ]
21+
name: Build on Java ${{ matrix.java }}
2222
steps:
23-
- uses: actions/checkout@v2
23+
- name: Checkout source code
24+
uses: actions/checkout@v2
25+
2426
- name: Setup java
2527
uses: joschi/setup-jdk@v2
2628
with:
2729
java-version: ${{ matrix.java }}
2830
architecture: x64
31+
2932
- run: java -version
3033
- run: mvn -v
31-
- run: mvn -B verify
34+
- run: mvn -B verify -Dgpg.skip=true
35+
36+
release:
37+
runs-on: ubuntu-latest
38+
needs: [build]
39+
if: contains(github.ref, 'release') && startsWith(github.event.head_commit.message, '[release]')
40+
name: Release
41+
steps:
42+
- name: Checkout source code
43+
uses: actions/checkout@v2
44+
45+
- name: Setup Java 1.8
46+
uses: actions/setup-java@v1
47+
with:
48+
java-version: 1.8
49+
50+
- name: Cache Maven packages
51+
uses: actions/cache@v2
52+
with:
53+
path: ~/.m2
54+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
55+
restore-keys: ${{ runner.os }}-m2
56+
57+
- name: Set env.BRANCH_NAME
58+
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
59+
60+
- name: Release and Publish
61+
uses: qcastel/[email protected]
62+
with:
63+
release-branch-name: ${{ env.BRANCH_NAME }}
64+
65+
gpg-enabled: true
66+
gpg-key-id: ${{ secrets.FREE_NOW_GPG_KEY_ID }}
67+
gpg-key: ${{ secrets.FREE_NOW_GPG_KEY }}
68+
gpg-passphrase: ${{ secrets.FREE_NOW_GPG_PASSPHRASE }}
69+
70+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
71+
72+
git-release-bot-name: "free-now-github"
73+
git-release-bot-email: "[email protected]"
74+
git-skip-sanity-check: true
75+
76+
maven-repo-server-id: ossrh
77+
maven-repo-server-username: ${{ secrets.FREE_NOW_GITHUB_USER }}
78+
maven-repo-server-password: ${{ secrets.FREE_NOW_MAVEN_ACCESS_TOKEN }}
79+
maven-args: "-DskipTests -DskipITs"
80+
81+
env:
82+
JAVA_HOME: /usr/lib/jvm/java-1.8-openjdk/

pom.xml

Lines changed: 83 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,25 @@
55

66
<groupId>com.free-now.multirabbit</groupId>
77
<artifactId>spring-multirabbit-parent</artifactId>
8-
<version>2.3.2-SNAPSHOT</version>
8+
<version>2.3.4-SNAPSHOT</version>
99
<packaging>pom</packaging>
1010

1111
<name>Spring MultiRabbit</name>
1212
<description>Library to extend Spring to provide connection to multiple RabbitMQ servers</description>
13+
<url>https://github.com/freenowtech/spring-multirabbit</url>
14+
15+
<modules>
16+
<module>spring-multirabbit</module>
17+
<module>spring-multirabbit-integration</module>
18+
<module>spring-multirabbit-examples/spring-multirabbit-example-java</module>
19+
<module>spring-multirabbit-examples/spring-multirabbit-example-kotlin</module>
20+
<module>spring-multirabbit-examples/spring-multirabbit-extension-example</module>
21+
</modules>
1322

14-
<url>http://www.free-now.com</url>
1523
<licenses>
1624
<license>
1725
<name>Apache License Version 2.0</name>
18-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
26+
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
1927
</license>
2028
</licenses>
2129

@@ -26,35 +34,42 @@
2634
</developer>
2735
</developers>
2836

29-
<modules>
30-
<module>spring-multirabbit</module>
31-
<module>spring-multirabbit-integration</module>
32-
<module>spring-multirabbit-examples/spring-multirabbit-example-java</module>
33-
<module>spring-multirabbit-examples/spring-multirabbit-example-kotlin</module>
34-
<module>spring-multirabbit-examples/spring-multirabbit-extension-example</module>
35-
</modules>
36-
37-
<properties>
38-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
39-
<maven.compiler.source>1.8</maven.compiler.source>
40-
<maven.compiler.target>1.8</maven.compiler.target>
41-
<springboot.version>2.3.9.RELEASE</springboot.version>
42-
</properties>
43-
4437
<scm>
38+
<connection>scm:git:[email protected]:freenowtech/spring-multirabbit.git</connection>
39+
<developerConnection>scm:git:[email protected]:freenowtech/spring-multirabbit.git</developerConnection>
4540
<tag>HEAD</tag>
46-
<url>scm:git:https://github.com/freenowtech/spring-multirabbit.git</url>
47-
<connection>scm:git:https://github.com/freenowtech/spring-multirabbit.git</connection>
48-
<developerConnection>scm:git:https://github.com/freenowtech/spring-multirabbit.git</developerConnection>
41+
<url>scm:git:[email protected]:freenowtech/spring-multirabbit.git</url>
4942
</scm>
43+
5044
<distributionManagement>
45+
<snapshotRepository>
46+
<id>ossrh</id>
47+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
48+
</snapshotRepository>
5149
<repository>
52-
<id>bintray-mytaxi-oss</id>
53-
<name>mytaxi-oss</name>
54-
<url>https://api.bintray.com/maven/mytaxi/oss/spring-multirabbit/;publish=1</url>
50+
<id>ossrh</id>
51+
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
5552
</repository>
5653
</distributionManagement>
5754

55+
<properties>
56+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
57+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
58+
<java.version>1.8</java.version>
59+
60+
<springboot.version>2.3.9.RELEASE</springboot.version>
61+
<testcontainers-rabbitmq.version>1.15.2</testcontainers-rabbitmq.version>
62+
63+
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
64+
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
65+
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
66+
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
67+
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
68+
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
69+
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
70+
<maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
71+
</properties>
72+
5873
<dependencyManagement>
5974
<dependencies>
6075
<dependency>
@@ -70,24 +85,38 @@
7085
<build>
7186
<plugins>
7287
<plugin>
73-
<groupId>org.apache.maven.plugins</groupId>
74-
<artifactId>maven-surefire-plugin</artifactId>
75-
<version>2.22.2</version>
88+
<artifactId>maven-release-plugin</artifactId>
89+
<version>${maven-release-plugin.version}</version>
7690
</plugin>
7791
<plugin>
7892
<groupId>org.apache.maven.plugins</groupId>
79-
<artifactId>maven-compiler-plugin</artifactId>
80-
<version>3.8.1</version>
93+
<artifactId>maven-surefire-plugin</artifactId>
94+
<version>${maven-surefire-plugin.version}</version>
8195
</plugin>
8296
<plugin>
8397
<groupId>org.apache.maven.plugins</groupId>
84-
<artifactId>maven-release-plugin</artifactId>
85-
<version>2.5.3</version>
98+
<artifactId>maven-gpg-plugin</artifactId>
99+
<version>${maven-gpg-plugin.version}</version>
100+
<configuration>
101+
<gpgArguments>
102+
<arg>--pinentry-mode</arg>
103+
<arg>loopback</arg>
104+
</gpgArguments>
105+
</configuration>
106+
<executions>
107+
<execution>
108+
<id>sign-artifacts</id>
109+
<phase>verify</phase>
110+
<goals>
111+
<goal>sign</goal>
112+
</goals>
113+
</execution>
114+
</executions>
86115
</plugin>
87116
<plugin>
88117
<groupId>org.apache.maven.plugins</groupId>
89118
<artifactId>maven-source-plugin</artifactId>
90-
<version>3.0.1</version>
119+
<version>${maven-source-plugin.version}</version>
91120
<executions>
92121
<execution>
93122
<id>attach-sources</id>
@@ -100,7 +129,7 @@
100129
<plugin>
101130
<groupId>org.apache.maven.plugins</groupId>
102131
<artifactId>maven-javadoc-plugin</artifactId>
103-
<version>3.0.1</version>
132+
<version>${maven-javadoc-plugin.version}</version>
104133
<executions>
105134
<execution>
106135
<id>attach-javadocs</id>
@@ -110,10 +139,30 @@
110139
</execution>
111140
</executions>
112141
</plugin>
142+
<plugin>
143+
<groupId>org.sonatype.plugins</groupId>
144+
<artifactId>nexus-staging-maven-plugin</artifactId>
145+
<version>${nexus-staging-maven-plugin.version}</version>
146+
<extensions>true</extensions>
147+
<configuration>
148+
<serverId>ossrh</serverId>
149+
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
150+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
151+
</configuration>
152+
</plugin>
153+
<plugin>
154+
<groupId>org.apache.maven.plugins</groupId>
155+
<artifactId>maven-compiler-plugin</artifactId>
156+
<version>${maven-compiler-plugin.version}</version>
157+
<configuration>
158+
<source>${java.version}</source>
159+
<target>${java.version}</target>
160+
</configuration>
161+
</plugin>
113162
<plugin>
114163
<groupId>org.apache.maven.plugins</groupId>
115164
<artifactId>maven-checkstyle-plugin</artifactId>
116-
<version>3.1.0</version>
165+
<version>${maven-checkstyle-plugin.version}</version>
117166
<configuration>
118167
<configLocation>oss-checkstyle.xml</configLocation>
119168
<sourceDirectories>${project.basedir}</sourceDirectories>

spring-multirabbit-examples/spring-multirabbit-example-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>com.free-now.multirabbit</groupId>
1414
<artifactId>spring-multirabbit-example-java</artifactId>
15-
<version>2.3.2-SNAPSHOT</version>
15+
<version>2.3.4-SNAPSHOT</version>
1616
<packaging>jar</packaging>
1717

1818
<name>Spring MultiRabbit Example for Java</name>

spring-multirabbit-examples/spring-multirabbit-example-kotlin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>com.free-now.multirabbit</groupId>
1414
<artifactId>spring-multirabbit-example-kotlin</artifactId>
15-
<version>2.3.2-SNAPSHOT</version>
15+
<version>2.3.4-SNAPSHOT</version>
1616
<packaging>jar</packaging>
1717

1818
<name>Spring MultiRabbit Example for Kotlin</name>

spring-multirabbit-examples/spring-multirabbit-extension-example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>com.free-now.multirabbit</groupId>
1414
<artifactId>spring-multirabbit-extended-example-java</artifactId>
15-
<version>2.3.2-SNAPSHOT</version>
15+
<version>2.3.4-SNAPSHOT</version>
1616
<packaging>jar</packaging>
1717

1818
<name>Spring MultiRabbit Extension Example</name>

spring-multirabbit-integration/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>com.free-now.multirabbit</groupId>
1414
<artifactId>spring-multirabbit-integration</artifactId>
15-
<version>2.3.2-SNAPSHOT</version>
15+
<version>2.3.4-SNAPSHOT</version>
1616
<packaging>jar</packaging>
1717

1818
<name>Spring MultiRabbit Library Integration Tests</name>

spring-multirabbit/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3-
43
<modelVersion>4.0.0</modelVersion>
54

65
<parent>
76
<groupId>com.free-now.multirabbit</groupId>
87
<artifactId>spring-multirabbit-parent</artifactId>
9-
<version>2.3.2-SNAPSHOT</version>
10-
<relativePath>../</relativePath>
8+
<version>2.3.4-SNAPSHOT</version>
9+
<relativePath>../pom.xml</relativePath>
1110
</parent>
1211

1312
<artifactId>spring-multirabbit</artifactId>
1413

1514
<name>Spring MultiRabbit Library</name>
1615
<description>Library to extend Spring to provide connection to multiple RabbitMQ servers</description>
16+
<url>https://github.com/freenowtech/spring-multirabbit</url>
1717

1818
<dependencies>
1919
<dependency>
@@ -48,7 +48,7 @@
4848
<dependency>
4949
<groupId>org.testcontainers</groupId>
5050
<artifactId>rabbitmq</artifactId>
51-
<version>1.15.2</version>
51+
<version>${testcontainers-rabbitmq.version}</version>
5252
<scope>test</scope>
5353
</dependency>
5454
</dependencies>
@@ -58,12 +58,12 @@
5858
<plugin>
5959
<groupId>org.apache.maven.plugins</groupId>
6060
<artifactId>maven-compiler-plugin</artifactId>
61+
<version>${maven-compiler-plugin.version}</version>
6162
<configuration>
62-
<source>8</source>
63-
<target>8</target>
63+
<source>${java.version}</source>
64+
<target>${java.version}</target>
6465
</configuration>
6566
</plugin>
6667
</plugins>
6768
</build>
68-
6969
</project>

0 commit comments

Comments
 (0)