Skip to content

Commit a161bd3

Browse files
authored
LIBS-943 - minor readme improvements (#13)
1 parent eaa9371 commit a161bd3

File tree

5 files changed

+115
-14
lines changed

5 files changed

+115
-14
lines changed

.github/workflows/nightly.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# This configuration is used for nightly builds
12
name: nightly
23

34
on:
45
schedule:
5-
- cron: 0 0 * * 1
6+
# Runs every Monday at 00:00
7+
- cron: 0 0 * * MON
68

79
jobs:
810
nightly:
@@ -11,30 +13,45 @@ jobs:
1113
runs-on: ubuntu-latest
1214

1315
steps:
16+
# Setup java environment
1417
- name: setup-java
1518
uses: actions/setup-java@v1
1619
with:
1720
java-version: 11
1821

22+
# Checkout the git repository
1923
- name: checkout
2024
uses: actions/checkout@v2
25+
with:
26+
ref: ${{ github.head_ref }}
27+
token: ${{ secrets.GPR_TOKEN }}
28+
fetch-depth: ''
29+
30+
# Execute some necessary git commands to get more repository informations
31+
- name: post-checkout
32+
run: git fetch --prune --unshallow
2133

34+
# Setup/load GitHub Actions caching for external dependencies, in this case especially for Maven
2235
- name: caching
2336
uses: actions/cache@v2
2437
with:
2538
path: ~/.m2/repository
2639
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2740
restore-keys: ${{ runner.os }}-maven-
2841

42+
# Execute Maven command for compile and compile of the tests
2943
- name: compile
3044
run: mvn clean compile test-compile
3145

46+
# Execute Unit tests
3247
- name: unit-tests
3348
run: mvn surefire:test
3449

50+
# Execute Integration tests, in this case we can skip the unit tests and load these with jacoco
3551
- name: integration-tests
3652
run: mvn -DskipUTs -Dgpg.skip=true jacoco:restore-instrumented-classes verify
3753

54+
# Execute sonar analysis and publish results to the sonarqube server
3855
- name: sonar-analyse
3956
env:
4057
SONAR_HOST: ${{ secrets.OS_SONAR_HOST_URL }}

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# This configuration is used for the deployment and publish to GitHub Packages
12
name: release
23

34
on:
45
push:
56
branches:
7+
# Runs only on push to the master branch
68
- master
79

810
jobs:
@@ -15,6 +17,7 @@ jobs:
1517
runs-on: ubuntu-latest
1618

1719
steps:
20+
# Setup java environment
1821
- name: setup-java
1922
uses: actions/setup-java@v1
2023
with:
@@ -23,31 +26,45 @@ jobs:
2326
server-username: OSSRH_USERNAME
2427
server-password: OSSRH_PASSWORD
2528

29+
# Checkout the git repository
2630
- name: setup-github-release
2731
run: sed -i -e 's/<\/servers>/<server><id>github<\/id><username>x-access-token<\/username><password>${GITHUB_TOKEN}<\/password><\/server><\/servers>/g' /home/runner/.m2/settings.xml
2832

33+
# Setup GPG for Maven Central deployment
2934
- name: setup-gpg
3035
env:
3136
GPG_PRIVATE_KEY: ${{ secrets.OS_GPG_PRIVATE_KEY }}
3237
run: cat <(echo -e "${GPG_PRIVATE_KEY}") | gpg --batch --import
3338

39+
# Checkout the git repository
3440
- name: checkout
3541
uses: actions/checkout@v2
42+
with:
43+
ref: ${{ github.head_ref }}
44+
token: ${{ secrets.GPR_TOKEN }}
45+
fetch-depth: ''
46+
47+
# Execute some necessary git commands to get more repository informations
48+
- name: post-checkout
49+
run: git fetch --prune --unshallow
3650

51+
# Setup GitHub Actions caching for external dependencies, in this case especially for Maven
3752
- name: caching
3853
uses: actions/cache@v2
3954
with:
4055
path: ~/.m2/repository
4156
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
4257
restore-keys: ${{ runner.os }}-maven-
4358

59+
# Execute Maven command for the deployment and publish to Maven Central
4460
- name: deploy
4561
env:
4662
OSSRH_USERNAME: ${{ secrets.OS_OSSRH_USERNAME }}
4763
OSSRH_PASSWORD: ${{ secrets.OS_OSSRH_PASSWORD }}
4864
GPG_PASSPHRASE: ${{ secrets.OS_GPG_PASSPHRASE }}
4965
run: mvn deploy -Dmaven.wagon.http.pool=false -Dgpg.executable=gpg -Dgpg.passphrase=${GPG_PASSPHRASE}
5066

67+
# Execute sonar analysis and publish results to the sonarcloud server
5168
- name: sonar-analyse
5269
env:
5370
SONAR_HOST: ${{ secrets.OS_SONAR_HOST_URL }}
@@ -60,3 +77,35 @@ jobs:
6077
-Dsonar.organization=${SONAR_ORGANIZATION} \
6178
-Dsonar.projectKey=${GITHUB_REPOSITORY//\//_} \
6279
-Dsonar.java.binaries=./target/classes
80+
81+
# Get the current project version from POM
82+
- name: get-project-version
83+
id: get_project_version
84+
uses: avides/actions-project-version-check@v1
85+
with:
86+
token: ${{ secrets.GITHUB_TOKEN }}
87+
file-to-check: pom.xml
88+
only-return-version: true
89+
90+
# Get last commit message for GitHub Release tag
91+
- name: setup-github-release
92+
id: setup_github_release
93+
env:
94+
PROJECT_VERSION: ${{ steps.get_project_version.outputs.version }}
95+
run: |
96+
echo ::set-output name=gitcommitmessage::$(git log --no-merges -1 --oneline)
97+
if [[ "$PROJECT_VERSION" == *"SNAPSHOT"* || "$PROJECT_VERSION" == *"RC"* ]]; then
98+
echo ::set-output name=isprerelease::true
99+
fi
100+
101+
# Create and publish GitHub Release tag
102+
- name: github-release
103+
uses: actions/create-release@v1
104+
continue-on-error: true
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GPR_TOKEN }}
107+
with:
108+
tag_name: ${{ steps.get_project_version.outputs.version }}
109+
release_name: ${{ steps.get_project_version.outputs.version }}
110+
body: ${{ steps.setup_github_release.outputs.gitcommitmessage }}
111+
prerelease: ${{ steps.setup_github_release.outputs.isprerelease }}

.github/workflows/review.yml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
# This configuration is used for the pull request review
12
name: review
23

34
on:
45
pull_request:
6+
# Runs only on pull request creation and on every new commit to the created pull request
57
types: [opened, synchronize]
68

79
jobs:
@@ -11,29 +13,39 @@ jobs:
1113
runs-on: ubuntu-latest
1214

1315
steps:
16+
# Cancels previous run for this branch that have a different commit id (SHA)
17+
- name: cancel-previous-run
18+
uses: styfle/[email protected]
19+
with:
20+
access_token: ${{ github.token }}
21+
22+
# Setup java environment
1423
- name: setup-java
1524
uses: actions/setup-java@v1
1625
with:
1726
java-version: 11
1827

28+
# Checkout the git repository
1929
- name: checkout
2030
uses: actions/checkout@v2
2131
with:
2232
ref: ${{ github.head_ref }}
2333
token: ${{ secrets.GPR_TOKEN }}
2434
fetch-depth: ''
2535

36+
# Execute some necessary git commands to get more repository informations
2637
- name: post-checkout
2738
run: git fetch --prune --unshallow
2839

40+
# Update GitHub Action configuration if necessary
2941
- name: action-configuration-autoupdate
30-
id: actions_action_configuration_autoupdate
3142
uses: avides/actions-action-configuration-autoupdate@v1
3243
with:
3344
token: ${{ secrets.GPR_TOKEN }}
3445
actions-configuration-files: os-java-library/nightly.yml,os-java-library/release.yml,os-java-library/review.yml
3546
source-repository: ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_REPO }}
3647

48+
# Push updated GitHub Actions configuration if necessary
3749
- uses: stefanzweifel/git-auto-commit-action@v4
3850
with:
3951
file_pattern: .github/workflows/*.yml
@@ -42,33 +54,54 @@ jobs:
4254
commit_author: ${{ secrets.ACTIONS_CONFIG_AUTOUPDATE_AUTHOR }}
4355
commit_message: Update GitHub Action configuration
4456

45-
- name: action-configuration-updated
46-
if: ${{ steps.actions_action_configuration_autoupdate.outputs.updated }}
47-
run: exit 1;
48-
57+
# Verify project version is updated
4958
- name: project-version-check
5059
uses: avides/actions-project-version-check@v1
5160
with:
5261
token: ${{ secrets.GITHUB_TOKEN }}
5362
file-to-check: pom.xml
5463
additional-files-to-check: README.md
5564

65+
# Check if documentation reminder comment is already given
66+
- name: find-documentation-reminder-comment
67+
uses: peter-evans/find-comment@v1
68+
id: find_documentation_reminder_comment
69+
with:
70+
issue-number: ${{ github.event.number }}
71+
body-includes: "Confluence/GitHub documentation added or updated?"
72+
73+
# Add documentation reminder comment if not given
74+
- name: documentation-reminder-comment
75+
uses: jungwinter/comment@v1
76+
id: create
77+
if: ${{ steps.find_documentation_reminder_comment.outputs.comment-id == 0 }}
78+
with:
79+
type: create
80+
body: 'Confluence/GitHub documentation added or updated?'
81+
issue_number: ${{ github.event.number }}
82+
token: ${{ secrets.GITHUB_TOKEN }}
83+
84+
# Setup/load GitHub Actions caching for external dependencies, in this case especially for Maven
5685
- name: caching
5786
uses: actions/cache@v2
5887
with:
5988
path: ~/.m2/repository
6089
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
6190
restore-keys: ${{ runner.os }}-maven-
6291

92+
# Execute Maven command for compile and compile of the tests
6393
- name: compile
6494
run: mvn clean compile test-compile
6595

96+
# Execute Unit tests
6697
- name: unit-tests
6798
run: mvn surefire:test
6899

100+
# Execute Integration tests, in this case we can skip the unit tests and load these with jacoco
69101
- name: integration-tests
70102
run: mvn -DskipUTs -Dgpg.skip=true jacoco:restore-instrumented-classes verify
71103

104+
# Execute sonar analysis for current branch
72105
- name: sonar-analyse
73106
env:
74107
SONAR_HOST: ${{ secrets.OS_SONAR_HOST_URL }}
@@ -83,8 +116,10 @@ jobs:
83116
-Dsonar.projectKey=${GITHUB_REPOSITORY//\//_} \
84117
-Dsonar.pullrequest.key=${{ github.event.number }} \
85118
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} \
119+
-Dsonar.pullrequest.github.repository=${GITHUB_REPOSITORY} \
86120
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \
87121
-Dsonar.java.binaries=./target/classes
88122
123+
# Execute Maven enforcer plugin
89124
- name: pom-analyse
90125
run: mvn enforcer:enforce

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<dependency>
1313
<groupId>com.avides.spring</groupId>
1414
<artifactId>spring-rabbit</artifactId>
15-
<version>2.4.0</version>
15+
<version>2.5.0</version>
1616
</dependency>
1717
```
1818

@@ -49,13 +49,13 @@ docker run \
4949
rabbitmq:VERSION
5050
```
5151

52-
The ´RABBITMQ_NODENAME´ environment variable is necessary!
52+
The `RABBITMQ_NODENAME` environment variable is necessary!
5353

54-
The rabbit user needs at least ´MONITORING´ as tag!
54+
The rabbit user needs at least `MONITORING` as tag!
5555

5656
## Known issues
5757

58-
The rabbit template needs to be autowired with ´@Lazy´!
58+
The rabbit template needs to be autowired with `@Lazy`!
5959

6060
If one property needs to be overridden in other profiles the complete prefix/collection needs to be copied!
6161

@@ -84,7 +84,7 @@ Using MeterRegistry will increment a counter with the bean name of the template
8484

8585
## Configuration
8686

87-
## Example
87+
### Example
8888

8989
Example for one connection factory
9090

@@ -179,7 +179,7 @@ Example for an implementation of a SpringRabbitListener
179179

180180
```java
181181
@Component
182-
public class MyListener extends AbstractSpringRabbitListener<CoreData>
182+
public class MyListener extends AbstractSpringRabbitListener<MyData>
183183
{
184184
@Autowired
185185
private MyService myService;

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>com.avides.spring</groupId>
55
<artifactId>spring-rabbit</artifactId>
6-
<version>2.4.0</version>
6+
<version>2.5.0</version>
77

88
<name>spring-rabbit</name>
99
<description>Makes configuring RabbitMQ for Spring Boot applications more comfortable</description>
@@ -72,7 +72,7 @@
7272
<jaxb-api.version>2.3.0</jaxb-api.version>
7373
<jaxb-core.version>2.3.0.1</jaxb-core.version>
7474
<jaxb-impl.version>2.3.0</jaxb-impl.version>
75-
<junit.version>4.13</junit.version>
75+
<junit.version>4.13.1</junit.version>
7676
<assertj-core.version>3.16.1</assertj-core.version>
7777
<jacoco.version>0.8.5</jacoco.version>
7878
<powermock.version>2.0.7</powermock.version>

0 commit comments

Comments
 (0)