Skip to content

Commit ed0df0e

Browse files
authored
Merge pull request #45 from ZenWave360/next
merge 2.0.0-RC1
2 parents 1249629 + 977bbb6 commit ed0df0e

File tree

346 files changed

+10948
-3451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+10948
-3451
lines changed

.github/workflows/main.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Verify Main and Publish Coverage
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
# pull_request:
7+
# branches: [ '**' ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Set up the Java JDK
19+
uses: actions/setup-java@v2
20+
with:
21+
java-version: '17'
22+
distribution: 'adopt'
23+
24+
- name: Verify and Publish Coverage
25+
run: mvn verify
26+
27+
- name: Checkout badges branch to a badges directory nested inside first checkout
28+
uses: actions/checkout@v2
29+
with:
30+
ref: badges
31+
path: badges
32+
33+
- name: Generate JaCoCo Badge
34+
id: jacoco
35+
uses: cicirello/jacoco-badge-generator@v2
36+
with:
37+
badges-directory: badges
38+
generate-branches-badge: true
39+
generate-summary: true
40+
jacoco-csv-file: >
41+
./plugins/asyncapi-spring-cloud-streams3/target/site/jacoco/jacoco.csv
42+
./plugins/java-to-jdl/target/site/jacoco/jacoco.csv
43+
./plugins/java-to-asyncapi/target/site/jacoco/jacoco.csv
44+
./plugins/backend-application-default/target/site/jacoco/jacoco.csv
45+
./plugins/openapi-controllers/target/site/jacoco/jacoco.csv
46+
./plugins/zdl-to-openapi/target/site/jacoco/jacoco.csv
47+
./plugins/jdl-to-asyncapi/target/site/jacoco/jacoco.csv
48+
./plugins/zdl-to-asyncapi/target/site/jacoco/jacoco.csv
49+
./plugins/zdl-to-markdown/target/site/jacoco/jacoco.csv
50+
./plugins/openapi-spring-webtestclient/target/site/jacoco/jacoco.csv
51+
./plugins/openapi-karate/target/site/jacoco/jacoco.csv
52+
./plugins/zenwave-mcp-server/target/site/jacoco/jacoco.csv
53+
./zenwave-sdk-cli/target/site/jacoco/jacoco.csv
54+
55+
- name: Log coverage percentage
56+
run: |
57+
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
58+
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
59+
60+
- name: Packs Jacoco Reports
61+
run: |
62+
rm -rf badges/jacoco
63+
mkdir -p badges/jacoco
64+
echo "GROUP,PACKAGE,CLASS,INSTRUCTION_MISSED,INSTRUCTION_COVERED,BRANCH_MISSED,BRANCH_COVERED,LINE_MISSED,LINE_COVERED,COMPLEXITY_MISSED,COMPLEXITY_COVERED,METHOD_MISSED,METHOD_COVERED" > badges/jacoco-report.csv
65+
find -name 'jacoco.csv' -exec sed '1d' {} \; >> badges/jacoco-report.csv
66+
tar -c `find -name jacoco.csv` `find -name jacoco.exec` `find -name jacoco.xml` | tar -C badges/jacoco -x
67+
68+
69+
- name: Commit and push the coverage badges and summary file
70+
if: ${{ github.event_name != 'pull_request' }}
71+
run: |
72+
echo $(ls -l)
73+
cd badges
74+
if [[ `git status --porcelain` ]]; then
75+
git config --global user.name 'github-agit pctions'
76+
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
77+
git add *.svg *.json jacoco-report.csv jacoco/*
78+
git commit -m "coverage = ${{ steps.jacoco.outputs.coverage }} branches = ${{ steps.jacoco.outputs.branches }}" *.svg *.json jacoco-report.csv jacoco/*
79+
git push
80+
fi
81+

.github/workflows/prepare-maven-release.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,40 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v2
17-
# with:
18-
# token: ${{ github.token }}
17+
1918
- name: Set up Java for publishing to Maven Central Repository
2019
uses: actions/setup-java@v2
2120
with:
2221
java-version: '17'
23-
distribution: 'adopt'
24-
server-id: ossrh
25-
server-username: MAVEN_USERNAME
26-
server-password: MAVEN_PASSWORD
22+
distribution: 'temurin'
2723

2824
- name: Configure Git User
2925
run: |
3026
git config user.email ${{ github.actor }}@users.noreply.github.com
3127
git config user.name ${{ github.actor }}
3228
3329
- name: Prepare Release
34-
run: mvn -B release:prepare -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
30+
run: |
31+
mvn -B release:prepare -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}
32+
mvn -B release:clean
3533
env:
3634
GITHUB_ACTOR: ${{ github.actor }}
3735
GITHUB_TOKEN: ${{ github.token }}
3836

39-
- name: Push Release
40-
run: |
41-
git push
42-
git push --tags
37+
- name: Create Pull Request (Main)
38+
id: cpr
39+
uses: peter-evans/create-pull-request@v5
40+
with:
41+
commit-message: 'Release ${{ github.event.inputs.releaseVersion }}'
42+
branch: release/${{ github.event.inputs.releaseVersion }}
43+
title: 'Release ${{ github.event.inputs.releaseVersion }}'
44+
body: 'Release ${{ github.event.inputs.releaseVersion }}'
45+
labels: 'release'
4346

44-
- name: Build and Publish SNAPSHOT to the Maven Central
45-
run: mvn -B clean install deploy -DskipTests -DdeployAtEnd=true
47+
- name: Enable Pull Request Automerge (Main)
48+
run: gh pr merge --merge --auto --delete-branch "${{ steps.cpr.outputs.pull-request-number }}"
4649
env:
47-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
48-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
49-
SIGN_KEY: ${{ secrets.SIGN_KEY }}
50-
SIGN_KEY_PASS: ${{ secrets.SIGN_KEY_PASS }}
50+
GH_TOKEN: ${{ github.token }}
51+
52+
- name: Push Release Tag
53+
run: git push --tags

.github/workflows/publish-maven-central.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,40 @@ name: Publish to Maven Central
22
on:
33
release:
44
types: [created]
5+
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: 'Tag to check out'
9+
required: true
10+
default: 'main'
511
jobs:
612
publish:
713
runs-on: ubuntu-latest
814
steps:
915
- uses: actions/checkout@v2
16+
with:
17+
ref: ${{ github.event.inputs.tag || github.event.release.tag_name }}
18+
1019
- name: Set up Java for publishing to Maven Central Repository
1120
uses: actions/setup-java@v2
1221
with:
1322
java-version: '17'
14-
distribution: 'adopt'
15-
server-id: ossrh
23+
distribution: 'temurin'
24+
server-id: central
1625
server-username: MAVEN_USERNAME
1726
server-password: MAVEN_PASSWORD
27+
28+
# - name: Enforce Release Version
29+
# run: mvn enforcer:enforce@enforce-release-version
30+
1831
- name: Publish to the Maven Central Repository
19-
run: mvn --batch-mode deploy -DdeployAtEnd=true
32+
run: mvn --batch-mode deploy -DdeployAtEnd=true -Dmaven.javadoc.skip=false
2033
env:
21-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
22-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
34+
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
35+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
2336
SIGN_KEY: ${{ secrets.SIGN_KEY }}
2437
SIGN_KEY_PASS: ${{ secrets.SIGN_KEY_PASS }}
2538

26-
27-
2839
- name: Checkout badges branch to a badges directory nested inside first checkout
2940
uses: actions/checkout@v2
3041
with:
@@ -41,6 +52,7 @@ jobs:
4152
jacoco-csv-file: >
4253
./plugins/asyncapi-spring-cloud-streams3/target/site/jacoco/jacoco.csv
4354
./plugins/java-to-jdl/target/site/jacoco/jacoco.csv
55+
./plugins/java-to-asyncapi/target/site/jacoco/jacoco.csv
4456
./plugins/backend-application-default/target/site/jacoco/jacoco.csv
4557
./plugins/openapi-controllers/target/site/jacoco/jacoco.csv
4658
./plugins/zdl-to-openapi/target/site/jacoco/jacoco.csv
@@ -49,6 +61,7 @@ jobs:
4961
./plugins/zdl-to-markdown/target/site/jacoco/jacoco.csv
5062
./plugins/openapi-spring-webtestclient/target/site/jacoco/jacoco.csv
5163
./plugins/openapi-karate/target/site/jacoco/jacoco.csv
64+
./plugins/zenwave-mcp-server/target/site/jacoco/jacoco.csv
5265
./zenwave-sdk-cli/target/site/jacoco/jacoco.csv
5366
5467
- name: Log coverage percentage
@@ -69,13 +82,14 @@ jobs:
6982
if: ${{ github.event_name != 'pull_request' }}
7083
run: |
7184
echo $(ls -l)
85+
TAG_NAME=${{ github.event.release.tag_name || github.run_id }}
7286
cd badges
7387
if [[ `git status --porcelain` ]]; then
7488
git config --global user.name 'github-agit pctions'
7589
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
7690
git add *.svg *.json jacoco-report.csv jacoco/*
7791
git commit -m "coverage = ${{ steps.jacoco.outputs.coverage }} branches = ${{ steps.jacoco.outputs.branches }}" *.svg *.json jacoco-report.csv jacoco/*
7892
git push
79-
git tag coverage_badges_${{github.event.release.tag_name}}
93+
git tag coverage_badges_${TAG_NAME}
8094
git push --tags
8195
fi

.github/workflows/build.yml renamed to .github/workflows/publish-maven-snapshots.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Build and Publish Maven Snapshots
22

33
on:
44
push:
@@ -15,28 +15,26 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@v2
1717

18-
- name: Set up the Java JDK
18+
- name: Set up Java for publishing to Maven Central Repository
1919
uses: actions/setup-java@v2
2020
with:
2121
java-version: '17'
22-
distribution: 'adopt'
23-
server-id: ossrh
22+
distribution: 'temurin'
23+
server-id: central
2424
server-username: MAVEN_USERNAME
2525
server-password: MAVEN_PASSWORD
2626

27-
- name: Build and Publish SNAPSHOT to the Maven Central
28-
if: ${{ github.event_name == 'push' }}
29-
run: mvn -B verify deploy -DdeployAtEnd=true
27+
- name: Enforce Snapshot Version
28+
run: mvn enforcer:enforce@enforce-snapshot-version
29+
30+
- name: Publish to the Maven Central Repository
31+
run: mvn --batch-mode deploy -DdeployAtEnd=true -Dmaven.javadoc.skip=false
3032
env:
31-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
32-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
33+
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
34+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN }}
3335
SIGN_KEY: ${{ secrets.SIGN_KEY }}
3436
SIGN_KEY_PASS: ${{ secrets.SIGN_KEY_PASS }}
3537

36-
# - name: Build and Verify
37-
# if: ${{ github.event_name == 'pull_request' }}
38-
# run: mvn -B verify
39-
4038
- name: Generate JaCoCo Badge
4139
id: jacoco
4240
uses: cicirello/jacoco-badge-generator@v2
@@ -47,6 +45,7 @@ jobs:
4745
jacoco-csv-file: >
4846
./plugins/asyncapi-spring-cloud-streams3/target/site/jacoco/jacoco.csv
4947
./plugins/java-to-jdl/target/site/jacoco/jacoco.csv
48+
./plugins/java-to-asyncapi/target/site/jacoco/jacoco.csv
5049
./plugins/backend-application-default/target/site/jacoco/jacoco.csv
5150
./plugins/openapi-controllers/target/site/jacoco/jacoco.csv
5251
./plugins/zdl-to-openapi/target/site/jacoco/jacoco.csv
@@ -55,6 +54,7 @@ jobs:
5554
./plugins/zdl-to-markdown/target/site/jacoco/jacoco.csv
5655
./plugins/openapi-spring-webtestclient/target/site/jacoco/jacoco.csv
5756
./plugins/openapi-karate/target/site/jacoco/jacoco.csv
57+
./plugins/zenwave-mcp-server/target/site/jacoco/jacoco.csv
5858
./zenwave-sdk-cli/target/site/jacoco/jacoco.csv
5959
6060
- name: Log coverage percentage
@@ -73,5 +73,5 @@ jobs:
7373
gh pr comment ${{github.event.pull_request.number}} -b "${BODY}"
7474
continue-on-error: true
7575
env:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
7777

0 commit comments

Comments
 (0)