Skip to content

Commit dadcfaa

Browse files
Merge pull request #17 from Cloudrisk/main
sync develop with Main
2 parents 7ca2a7d + 35206b2 commit dadcfaa

34 files changed

+302
-26636
lines changed

.github/workflows/build-and-test-main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# separate terms of service, privacy policy, and support
77
# documentation.
88

9-
name: Java CI with Maven
9+
name: Build and Test JAR
1010

1111
on:
1212
push:
@@ -15,16 +15,16 @@ on:
1515
branches: [ "main" ]
1616

1717
jobs:
18-
build:
18+
build_and_test:
1919

2020
runs-on: ubuntu-latest
2121

2222
steps:
2323
- uses: actions/checkout@v4
24-
- name: Set up JDK 17
24+
- name: Set up JDK 21
2525
uses: actions/setup-java@v4
2626
with:
27-
java-version: '17'
27+
java-version: '21'
2828
distribution: 'temurin'
2929
cache: maven
3030
- name: Set up Python 3.11
Lines changed: 31 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,56 @@
1-
name: Maven Package
1+
name: Build JAR on Tag
22

33
on:
44
push:
55
tags:
6-
- '**'
6+
- '*'
77

88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11+
1112
permissions:
12-
contents: write
13+
contents: write # Ensure write permission for contents
1314
packages: write
1415

1516
steps:
16-
- uses: actions/checkout@v4
17-
18-
- name: Set up JDK 17
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
- name: Set up JDK
1920
uses: actions/setup-java@v4
2021
with:
21-
java-version: '17'
2222
distribution: 'temurin'
23-
server-id: github
24-
settings-path: ${{ github.workspace }}
25-
26-
- name: Build with Maven
27-
run: mvn versions:set -DnewVersion=${{ github.ref_name }} -B -U -DskipTests clean package --file pom.xml
28-
29-
- name: Create GitHub Release
30-
id: create_release
31-
uses: actions/github-script@v6
32-
with:
33-
script: |
34-
const tag = context.ref.replace('refs/tags/', '');
35-
let release;
36-
try {
37-
release = await github.rest.repos.getReleaseByTag({
38-
owner: context.repo.owner,
39-
repo: context.repo.repo,
40-
tag
41-
});
42-
core.setOutput('release_id', release.data.id);
43-
} catch (error) {
44-
if (error.status === 404) {
45-
const release = await github.rest.repos.createRelease({
46-
owner: context.repo.owner,
47-
repo: context.repo.repo,
48-
tag_name: context.ref.replace('refs/tags/', ''),
49-
name: `Release ${context.ref.replace('refs/tags/', '')}`,
50-
draft: false,
51-
prerelease: false
52-
});
53-
core.setOutput('release_id', release.data.id);
54-
} else {
55-
throw error;
56-
}
57-
}
58-
core.setOutput('upload_url', release.data.upload_url);
59-
env:
60-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
java-version: '21' # Matches the enforced version in the POM
24+
cache: maven
6125

62-
- name: Upload JAR to Release
63-
uses: actions/upload-release-asset@v1
26+
- name: Cache Maven dependencies
27+
uses: actions/cache@v4
6428
with:
65-
upload_url: ${{ steps.create_release.outputs.upload_url }}
66-
asset_path: target/python-generator-${{ github.ref_name }}.jar
67-
asset_name: python-generator-${{ github.ref_name }}.jar
68-
asset_content_type: application/java-archive
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
path: ~/.m2/repository
30+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
31+
restore-keys: |
32+
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
7133
72-
- name: Create Source Code Zip
73-
run: git archive -o source-${{ github.ref_name }}.zip HEAD
34+
- name: Build with Maven
35+
run: |
36+
TAG_NAME=${GITHUB_REF#refs/tags/}
37+
echo "Updating POM version to $TAG_NAME"
38+
mvn -B versions:set -DnewVersion=$TAG_NAME
39+
mvn -B package --file pom.xml -DskipTests
7440
75-
- name: Upload Source Code Zip
76-
uses: actions/upload-release-asset@v1
41+
- name: Revert POM changes
42+
run: git checkout -- pom.xml
43+
44+
- name: Upload JAR files
45+
uses: actions/upload-artifact@v4
7746
with:
78-
upload_url: ${{ steps.create_release.outputs.upload_url }}
79-
asset_path: source-${{ github.ref_name }}.zip
80-
asset_name: source-${{ github.ref_name }}.zip
81-
asset_content_type: application/zip
82-
env:
83-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84-
85-
- name: Create Source Code Tar.gz
86-
run: git archive -o source-${{ github.ref_name }}.tar.gz --format=tar.gz HEAD
47+
name: jar-files
48+
path: target/*.jar
8749

88-
- name: Upload Source Code Tar.gz
89-
uses: actions/upload-release-asset@v1
50+
- name: Create GitHub Release
51+
uses: softprops/action-gh-release@v2
9052
with:
91-
upload_url: ${{ steps.create_release.outputs.upload_url }}
92-
asset_path: source-${{ github.ref_name }}.tar.gz
93-
asset_name: source-${{ github.ref_name }}.tar.gz
94-
asset_content_type: application/gzip
53+
files: target/*.jar
9554
env:
9655
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9756

98-
- name: Reset POM
99-
run: git checkout -- pom.xml

.github/workflows/cve-scanning.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CVE Scanning for Maven
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
depchecktest:
10+
runs-on: ubuntu-latest
11+
name: depecheck_test
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Setup JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '21'
19+
distribution: 'temurin'
20+
- name: Build with Maven
21+
run: mvn install -DskipTests
22+
working-directory: .
23+
- name: Depcheck
24+
uses: dependency-check/Dependency-Check_Action@1b5d19fd4a32ff0ff982e8c9d8e27dbf7ac8a46c
25+
id: Depcheck
26+
env:
27+
JAVA_HOME: /opt/jdk
28+
with:
29+
project: ${{github.repository}}
30+
path: '.'
31+
format: 'HTML'
32+
out: 'reports' # this is the default, no need to specify unless you wish to override it
33+
args: >
34+
--suppression ./allow-list.xml
35+
--failOnCVSS 7
36+
--enableRetired
37+
38+
- name: Upload Test results
39+
if: ${{ always() }}
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: Depcheck report
43+
path: ${{github.workspace}}/reports
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: License Scanning for Maven
2+
3+
on:
4+
schedule:
5+
- cron: '0 8,18 * * 1-5'
6+
push:
7+
paths:
8+
- './pom.xml'
9+
- '.github/workflows/license-scanning-maven.yml'
10+
11+
env:
12+
ALLOW_LICENSES: "
13+
licenses/license/name!='Apache License, Version 2.0' and
14+
not(contains(licenses/license/url, '://www.apache.org/licenses/LICENSE-2.0.txt')) and
15+
not(contains(licenses/license/url, '://opensource.org/licenses/Apache-2.0')) and
16+
17+
licenses/license/name!='BSD License' and
18+
not(contains(licenses/license/url, 'antlr.org/license.html')) and
19+
20+
licenses/license/name!='New BSD License' and
21+
not(contains(licenses/license/url, '://www.opensource.org/licenses/bsd-license.php')) and
22+
23+
licenses/license/name!='BSD-3-Clause' and
24+
not(contains(licenses/license/url, '://asm.ow2.io/license.html')) and
25+
26+
licenses/license/name!='Eclipse Public License - v 1.0' and
27+
not(contains(licenses/license/url, '://www.eclipse.org/legal/epl-v10.html')) and
28+
29+
licenses/license/name!='Eclipse Public License - v 2.0' and
30+
not(contains(licenses/license/url, '://www.eclipse.org/legal/epl-v20.html')) and
31+
not(contains(licenses/license/url, '://www.eclipse.org/legal/epl-2.0')) and
32+
33+
licenses/license/name!='GNU Lesser General Public License' and
34+
not(contains(licenses/license/url, '://www.gnu.org/licenses/old-licenses/lgpl-2.1.html')) and
35+
36+
licenses/license/name!='GNU General Public License (GPL), version 2, with the Classpath exception' and
37+
not(contains(licenses/license/url, '://openjdk.java.net/legal/gplv2+ce.html')) and
38+
39+
licenses/license/name!='The MIT License' and
40+
not(contains(licenses/license/url, '://opensource.org/licenses/MIT')) and
41+
not(contains(licenses/license/url, '://www.opensource.org/licenses/mit-license.php')) and
42+
43+
licenses/license/name!='CDDL + GPLv2 with classpath exception' and
44+
not(contains(licenses/license/url, '://github.com/javaee/javax.annotation/blob/master/LICENSE')) and
45+
46+
licenses/license/name!='Public Domain'
47+
"
48+
REPORT_PATH: "target/generated-resources/licenses.xml"
49+
50+
jobs:
51+
scan:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- name: Set up JDK 17
56+
uses: actions/setup-java@v4
57+
with:
58+
java-version: 17
59+
cache: maven
60+
distribution: 'adopt'
61+
- name: Install XQ
62+
run: pip install xq
63+
- name: Build with Maven
64+
run: mvn clean install -Dmaven.test.skip=true
65+
working-directory: .
66+
- name: License XML report
67+
run: mvn org.codehaus.mojo:license-maven-plugin:2.0.0:download-licenses
68+
working-directory: .
69+
- name: Validate XML report
70+
run: |
71+
LICENSE_REPORT=`xq "//dependency[licenses/license/name!=${{ env.ALLOW_LICENSES }}]" ./${{ env.REPORT_PATH }}`
72+
LINES_FOUND=`echo $LICENSE_REPORT | wc -l`
73+
echo "License issues found ..."
74+
if [ $LINES_FOUND -gt 1 ]; then echo $LICENSE_REPORT ; exit -1; fi
75+
working-directory: .
76+
- name: Upload license XML reports
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: license-xml-report
80+
path: './**/${{ env.REPORT_PATH }}'

.node-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

RELEASE.md

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

33
_What is being released?_
44

5-
This release adds support for meta data and for serialization / deserialization consistient with the [serialization specifications in CDM issue #3236](https://github.com/finos/common-domain-model/issues/3236)
5+
This release adds support for meta data and for serialization / deserialization consistent with the [serialization specifications in CDM issue #3236](https://github.com/finos/common-domain-model/issues/3236)
66

77
Also included is support for circular dependencies and increased testing of operators.
88

0 commit comments

Comments
 (0)