Skip to content

Commit 988192d

Browse files
Merge pull request #9 from letsdev/upmerge-original-repo
Upmerge original repo and fix spring security with cors
2 parents c816a27 + 0ae8b54 commit 988192d

File tree

503 files changed

+37356
-6492
lines changed

Some content is hidden

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

503 files changed

+37356
-6492
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* text=auto
1+
* text=lf

.github/workflows/basyx_test.yml

Lines changed: 452 additions & 45 deletions
Large diffs are not rendered by default.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Release to Maven Central
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout source
13+
uses: actions/checkout@v5
14+
15+
- name: Set up Java and Maven Central credentials
16+
uses: actions/setup-java@v5
17+
with:
18+
java-version: '17'
19+
distribution: 'temurin'
20+
server-id: central
21+
server-username: MAVEN_USERNAME
22+
server-password: MAVEN_PASSWORD
23+
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
24+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
25+
26+
- name: Set project version from tag
27+
run: mvn --batch-mode versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false
28+
29+
- name: Publish to Central
30+
run: mvn --batch-mode deploy -DskipTests -PMavenCentral
31+
env:
32+
MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
33+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
34+
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish Snapshot package to the Maven Central Repository
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '.github/ISSUE_TEMPLATE/**'
9+
- '.github/CODE_OF_CONDUCT.md'
10+
- '.github/CODING_CONVENTIONS.md'
11+
- '.github/CONTRIBUTING.md'
12+
- '.github/dependabot.yml'
13+
- '.github/pull_request_template.md'
14+
- '.github/SECURITY.md'
15+
- 'docs/**'
16+
- 'examples/**'
17+
- 'README.md'
18+
- '.gitattributes'
19+
- '.gitignore'
20+
- 'LICENSE'
21+
- 'NOTICE'
22+
23+
jobs:
24+
publish:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v5
29+
30+
- name: Set up Maven Central Repository
31+
uses: actions/setup-java@v5
32+
with:
33+
java-version: '17'
34+
distribution: 'temurin'
35+
server-id: central
36+
server-username: MAVEN_USERNAME
37+
server-password: MAVEN_PASSWORD
38+
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
39+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
40+
41+
- name: Publish package
42+
run: mvn --batch-mode deploy -DskipTests -PMavenCentral
43+
env:
44+
MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
45+
MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
46+
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }}

.github/workflows/dash-license.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Dash License Check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/pom.xml'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v5
15+
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v5
18+
with:
19+
distribution: temurin
20+
java-version: 17
21+
22+
- name: Build with Maven
23+
run: mvn org.eclipse.dash:license-tool-plugin:license-check -PDashLicense

.github/workflows/docker-milestone-release.yml

Lines changed: 62 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
path: basyx.aasrepository/basyx.aasrepository.component
2020
- name: submodel-repository
2121
path: basyx.submodelrepository/basyx.submodelrepository.component
22+
- name: submodel-service
23+
path: basyx.submodelservice/basyx.submodelservice.component
2224
- name: conceptdescription-repository
2325
path: basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component
2426
- name: aas-discovery
@@ -44,7 +46,7 @@ jobs:
4446

4547
steps:
4648
- name: Checkout Code
47-
uses: actions/checkout@v4
49+
uses: actions/checkout@v5
4850

4951
- name: Set up QEMU
5052
uses: docker/setup-qemu-action@v3
@@ -61,64 +63,75 @@ jobs:
6163
password: ${{ secrets.DOCKER_HUB_TOKEN }}
6264

6365
- name: Set up JDK 17
64-
uses: actions/setup-java@v4
66+
uses: actions/setup-java@v5
6567
with:
6668
java-version: '17'
6769
distribution: 'temurin'
6870
cache: maven
6971

70-
- name: Build all modules first
71-
run: mvn clean install -DskipTests
72-
73-
- name: Extract Release Tag
74-
id: extract_tag
72+
# Set the project version from the release tag
73+
- name: Set project version from tag
7574
run: |
76-
# Extract the release tag from the GitHub context
77-
TAG_NAME=${GITHUB_REF#refs/tags/}
78-
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
75+
echo "Setting project version from release tag: ${{ github.event.release.tag_name }}"
76+
mvn --batch-mode versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false
7977
80-
# Build the project
81-
# For registry modules, we activate the dockerbuild profile and specify the module with --pl
82-
- name: Build BaSyx
83-
run: |
84-
if [[ "${{ matrix.name }}" == *"registry"* ]]; then
85-
# Derive the module's artifactId from the path
86-
module_root=$(dirname "$(dirname "$(dirname "${{ matrix.path }}")")")
87-
artifact_id=$(basename "$module_root")
88-
# Run with dockerbuild profile and namespace
89-
mvn clean install -DskipTests -Pdockerbuild "-Ddocker.namespace=${{ env.DOCKER_NAMESPACE }}" --pl "org.eclipse.digitaltwin.basyx:${artifact_id}"
90-
else
91-
echo "Non-registry module - already built in the previous step."
92-
fi
78+
- name: Build all modules first
79+
run: mvn clean install -DskipTests
9380

94-
- name: Prepare Registry JAR for Docker
81+
# Process registry modules
82+
- name: Process Registry Module
83+
id: registry_module
9584
if: contains(matrix.name, 'registry')
9685
run: |
97-
# Go three levels up from src/main/docker to get the module root
98-
module_root=$(dirname "$(dirname "$(dirname "${{ matrix.path }}")")")
99-
100-
# Adjust the path to where the dockerbuild profile places the JAR
101-
JAR_FILE=$(ls "$module_root/target/docker/${{ env.DOCKER_NAMESPACE }}/${{ matrix.name }}/${{ env.TAG_NAME }}/build/maven/"*.jar | head -n 1)
86+
# Get the module path without /src/main/docker
87+
MODULE_PATH=$(echo ${{ matrix.path }} | sed 's|/src/main/docker||')
88+
echo "Building registry module at: ${MODULE_PATH}"
89+
90+
# Build with dockerbuild profile
91+
mvn clean package -DskipTests -Pdockerbuild "-Ddocker.namespace=${{ env.DOCKER_NAMESPACE }}" "-Ddocker.image.tag=${{ github.event.release.tag_name }}" -f ${MODULE_PATH}/pom.xml
92+
93+
# Create maven directory for Docker
94+
mkdir -p "${{ matrix.path }}/maven"
95+
96+
# Find the JAR file using multiple search patterns
97+
echo "Looking for JAR files in standard target directory..."
98+
JAR_FILE=$(find "${MODULE_PATH}/target" -name "*.jar" -not -name "*sources*" -not -name "*javadoc*" -not -name "*-tests.jar" | head -n 1)
99+
102100
if [ -z "$JAR_FILE" ]; then
103-
echo "No repackaged JAR found in $module_root/target/docker/${{ env.DOCKER_NAMESPACE }}/${{ matrix.name }}/${{ env.TAG_NAME }}/build/maven. Check your build."
101+
echo "Not found in standard location, trying docker build location..."
102+
JAR_FILE=$(find "${MODULE_PATH}" -path "*/docker/*/${{ env.DOCKER_NAMESPACE }}/*/${{ github.event.release.tag_name }}/build/maven/*[!tests].jar" | head -n 1)
103+
fi
104+
105+
# If still not found, try a more aggressive search
106+
if [ -z "$JAR_FILE" ]; then
107+
echo "Still not found, trying broader search..."
108+
JAR_FILE=$(find "${MODULE_PATH}" -name "*.jar" -not -name "*sources*" -not -name "*javadoc*" -not -name "*-tests.jar" | head -n 1)
109+
fi
110+
111+
if [ -z "$JAR_FILE" ]; then
112+
echo "No JAR file found! Listing directory structure:"
113+
find "${MODULE_PATH}" -type d | sort
114+
echo "Listing all JAR files:"
115+
find "${MODULE_PATH}" -name "*.jar" | sort
104116
exit 1
105117
fi
106-
107-
# Create the maven directory inside the Docker context and copy the JAR there
108-
mkdir -p "${{ matrix.path }}/maven"
109-
cp "$JAR_FILE" "${{ matrix.path }}/maven/"
110-
111-
# Extract the final name without .jar extension
112-
FINAL_NAME=$(basename "$JAR_FILE" .jar)
113-
echo "FINAL_ARGS=FINAL_NAME=${FINAL_NAME}" >> $GITHUB_ENV
114-
115-
- name: No-Op for Non-Registry Modules
118+
119+
echo "Found JAR: ${JAR_FILE}"
120+
cp "${JAR_FILE}" "${{ matrix.path }}/maven/"
121+
122+
# Save the JAR name for Docker
123+
JAR_BASENAME=$(basename "${JAR_FILE}" .jar)
124+
echo "FINAL_NAME=${JAR_BASENAME}" >> $GITHUB_ENV
125+
126+
# Process non-registry modules
127+
- name: Process Non-Registry Module
128+
id: non_registry_module
116129
if: "!contains(matrix.name, 'registry')"
117-
run: echo "FINAL_ARGS=" >> $GITHUB_ENV
118-
119-
- name: Set short SHA
120-
run: echo "SHORT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
130+
run: |
131+
echo "Processing non-registry module"
132+
echo "FINAL_NAME=" >> $GITHUB_ENV
121133
134+
# Build and push Docker image
122135
- name: Build and Push Docker Image
123136
uses: docker/build-push-action@v6
124137
with:
@@ -127,9 +140,11 @@ jobs:
127140
push: true
128141
platforms: linux/amd64,linux/arm64,linux/arm/v7
129142
tags: |
130-
${{ env.DOCKER_NAMESPACE }}/${{ matrix.name }}:${{ env.TAG_NAME }}
131-
build-args: ${{ env.FINAL_ARGS }}
143+
${{ env.DOCKER_NAMESPACE }}/${{ matrix.name }}:${{ github.event.release.tag_name }}
144+
build-args: |
145+
FINAL_NAME=${{ env.FINAL_NAME }}
132146
133147
- name: Verify Docker Image
134148
run: |
135-
docker pull ${{ env.DOCKER_NAMESPACE }}/${{ matrix.name }}:${{ env.TAG_NAME }}
149+
echo "Verifying Docker image: ${{ env.DOCKER_NAMESPACE }}/${{ matrix.name }}:${{ github.event.release.tag_name }}"
150+
docker pull ${{ env.DOCKER_NAMESPACE }}/${{ matrix.name }}:${{ github.event.release.tag_name }}

.github/workflows/docker-snapshot-release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
path: basyx.aasrepository/basyx.aasrepository.component
3636
- name: submodel-repository
3737
path: basyx.submodelrepository/basyx.submodelrepository.component
38+
- name: submodel-service
39+
path: basyx.submodelservice/basyx.submodelservice.component
3840
- name: conceptdescription-repository
3941
path: basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component
4042
- name: aas-discovery
@@ -60,7 +62,7 @@ jobs:
6062

6163
steps:
6264
- name: Checkout Code
63-
uses: actions/checkout@v4
65+
uses: actions/checkout@v5
6466

6567
- name: Set up QEMU
6668
uses: docker/setup-qemu-action@v3
@@ -77,7 +79,7 @@ jobs:
7779
password: ${{ secrets.DOCKER_HUB_TOKEN }}
7880

7981
- name: Set up JDK 17
80-
uses: actions/setup-java@v4
82+
uses: actions/setup-java@v5
8183
with:
8284
java-version: '17'
8385
distribution: 'temurin'
@@ -119,11 +121,11 @@ jobs:
119121
120122
# Extract the final name without .jar extension
121123
FINAL_NAME=$(basename "$JAR_FILE" .jar)
122-
echo "FINAL_ARGS=FINAL_NAME=${FINAL_NAME}" >> $GITHUB_ENV
124+
echo "FINAL_NAME=${FINAL_NAME}" >> $GITHUB_ENV
123125
124126
- name: No-Op for Non-Registry Modules
125127
if: "!contains(matrix.name, 'registry')"
126-
run: echo "FINAL_ARGS=" >> $GITHUB_ENV
128+
run: echo echo "FINAL_NAME=" >> $GITHUB_ENV
127129

128130
- name: Set short SHA
129131
run: echo "SHORT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
@@ -138,7 +140,7 @@ jobs:
138140
tags: |
139141
${{ env.DOCKER_NAMESPACE }}/${{ matrix.name }}:2.0.0-SNAPSHOT
140142
${{ env.DOCKER_NAMESPACE }}/${{ matrix.name }}:2.0.0-SNAPSHOT-${{ env.SHORT_SHA }}
141-
build-args: ${{ env.FINAL_ARGS }}
143+
build-args: FINAL_NAME=${{ env.FINAL_NAME }}
142144

143145
- name: Verify Docker Image
144146
run: |

0 commit comments

Comments
 (0)