Skip to content

Commit eae5a02

Browse files
committed
15 no code artifact publication (#16)
* Fix repo information for publication * Fix repo scm information for publication * Fix kafka dependency version to 4.1.2 to resolve CVE * Update build.gradle to allow for NEXUS-based artifact builds * Update build.gradle to create manifest * Update version numbers for modified modules add ci workflow and updates to gradle files * Update version number * Update file permissions * Disable unit tests for sensorhub-parser-protobuf build as they are failing compilation * Disable unit tests for sensorhub-parser-protobuf build as they are failing compilation * Disable unit tests for sensorhub-parser-protobuf build as they are failing compilation * Disable unit tests for sensorhub-parser-protobuf build as they are failing compilation * Disable unit tests for sensorhub-parser-protobuf build as they are failing compilation * Update OSH Core Version to 2.0.1 * Update pipeline and OSH Core Version * Update pipeline and OSH Core Version
1 parent f2c969e commit eae5a02

18 files changed

Lines changed: 519 additions & 244 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Defect Report
3+
about: Create a report to help us improve
4+
title: "[DEFECT]"
5+
labels: bug, security
6+
assignees: ''
7+
8+
---
9+
10+
## Issue
11+
12+
### Description
13+
[Description of the issue]
14+
15+
### Steps to Reproduce
16+
[Steps to reproduce the issue]
17+
18+
### Expected Behavior
19+
[What you expected to happen]
20+
21+
### Actual Behavior
22+
[What actually happened]
23+
24+
### Screenshots
25+
[If applicable, add screenshots to help explain your problem.]
26+
27+
### OpenSensorHub Config File
28+
[If applicable, attach the config.json in use when issue occurred.]
29+
30+
### OpenSensorHub Data Store File(s)
31+
[If applicable, attach the datastore files in use when issue occurred.]
32+
33+
### Additional Information
34+
[Add any other context about the problem here.]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Driver Request
3+
about: Describe driver to be built
4+
title: "[DRIVER]"
5+
labels: driver
6+
assignees: ''
7+
8+
---
9+
10+
## Driver Request
11+
12+
### Description
13+
[Description of the enhancement/feature request]
14+
15+
#### Interface Documentation
16+
[Attach documents, links, or information on how to connect to source of truth data, if available]
17+
18+
### Use Case
19+
[What is the use case for this enhancement/feature request?]
20+
21+
### Additional Information
22+
[Add any other context about the enhancement/feature request here.]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[ENHANCEMENT]"
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
## Enhancement/Feature Request
11+
12+
### Description
13+
[Description of the enhancement/feature request]
14+
15+
### Use Case
16+
[What is the use case for this enhancement/feature request?]
17+
18+
### Expected Behavior
19+
[What you expect to happen after this enhancement/feature is implemented]
20+
21+
### Current Behavior
22+
[What currently happens without this enhancement/feature]
23+
24+
### Additional Information
25+
[Add any other context about the enhancement/feature request here.]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Process Request
3+
about: Describe process to be built
4+
title: "[PROCESS]"
5+
labels: process
6+
assignees: ''
7+
8+
---
9+
10+
## Process Request
11+
12+
### Description
13+
[Description of the enhancement/feature request]
14+
15+
### Use Case
16+
[What is the use case for this enhancement/feature request?]
17+
18+
#### Inputs
19+
[What are the inputs for this process]
20+
21+
#### Outputs
22+
[What are the outputs for this process]
23+
24+
### Additional Information
25+
[Add any other context about the enhancement/feature request here.]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Security Vulnerability
3+
about: Describe the security vulnerability
4+
title: "[SECURITY]"
5+
labels: security
6+
assignees: ''
7+
8+
---
9+
10+
## Issue
11+
12+
### Description
13+
[Description of the issue]
14+
15+
### Steps to Reproduce
16+
[Steps to reproduce the issue]
17+
18+
### Expected Behavior
19+
[What you expected to happen]
20+
21+
### Actual Behavior
22+
[What actually happened]
23+
24+
### Screenshots
25+
[If applicable, add screenshots to help explain your problem.]
26+
27+
### OpenSensorHub Config File
28+
[If applicable, attach the config.json in use when issue occurred.]
29+
30+
### OpenSensorHub Data Store File(s)
31+
[If applicable, attach the datastore files in use when issue occurred.]
32+
33+
### Additional Information
34+
[Add any other context about the problem here.]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Service Request
3+
about: Describe service to be built
4+
title: "[SERVICE]"
5+
labels: service
6+
assignees: ''
7+
8+
---
9+
10+
## Service Request
11+
12+
### Description
13+
[Description of the enhancement/feature request]
14+
15+
### Use Case
16+
[What is the use case for this enhancement/feature request?]
17+
18+
### Additional Information
19+
[Add any other context about the enhancement/feature request here.]

.github/ISSUE_TEMPLATE/task.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Task
3+
about: Describes a task related to SOCOM customer that does not require code changes.
4+
title: "[TASK] "
5+
labels: task
6+
assignees: ''
7+
8+
---
9+
10+
## Task
11+
12+
### Description
13+
[Description of the work to be performed]
14+
15+
### Additional Information
16+
[Add any other context about the enhancement/feature request here.]

.github/workflows/ci-pipeline.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: GitFlow CI
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- develop
11+
- 'release/*'
12+
- 'hotfix/*'
13+
- 'feature/*'
14+
pull_request:
15+
16+
jobs:
17+
gitflow-ci:
18+
runs-on: ubuntu-latest
19+
20+
env:
21+
NEXUS_ACTOR: ${{ secrets.NEXUS_ACTOR }}
22+
NEXUS_TOKEN: ${{ secrets.NEXUS_TOKEN }}
23+
NEXUS_REPO_URL: ${{ vars.NEXUS_REPO_URL }}
24+
NEXUS_REPO_SNAPSHOT: ${{ vars.NEXUS_REPO_SNAPSHOT }}
25+
NEXUS_REPO_RELEASE: ${{ vars.NEXUS_REPO_RELEASE }}
26+
OSH_CORE_VERSION: ${{ vars.OSH_CORE_VERSION }}
27+
28+
# Snapshot flag: develop = snapshot, everything else = release
29+
SNAPSHOT: ${{ github.ref == 'refs/heads/develop' }}
30+
RELEASE: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/release/*' || github.ref == 'refs/heads/hotfix/*'}}
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
38+
- name: Set up JDK 21
39+
uses: actions/setup-java@v4
40+
with:
41+
distribution: temurin
42+
java-version: 21
43+
44+
- name: Cache Gradle
45+
uses: actions/cache@v4
46+
with:
47+
path: |
48+
~/.gradle/caches
49+
~/.gradle/wrapper
50+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
51+
52+
# ---------------------------------------------------------
53+
# Detect changed modules
54+
# ---------------------------------------------------------
55+
- name: Detect changed modules
56+
id: changed
57+
run: |
58+
echo "Detecting changed modules..."
59+
60+
git fetch --unshallow || true
61+
git fetch origin --prune
62+
63+
if [ "${{ github.event_name }}" = "pull_request" ]; then
64+
BASE_SHA="${{ github.event.pull_request.base.sha }}"
65+
else
66+
BASE_SHA=$(git merge-base HEAD origin/${{ github.ref_name }} || git merge-base HEAD origin/main)
67+
fi
68+
69+
echo "Base SHA: $BASE_SHA"
70+
71+
git diff --name-only $BASE_SHA HEAD > changed.txt
72+
73+
echo "Changed files:"
74+
cat changed.txt
75+
76+
MODULES=""
77+
while read FILE; do
78+
DIR=$(dirname "$FILE")
79+
[ "$DIR" = "." ] && continue
80+
81+
if [ -f "$DIR/build.gradle" ] || [ -f "$DIR/build.gradle.kts" ]; then
82+
MODULES="$MODULES $DIR"
83+
fi
84+
done < changed.txt
85+
86+
echo "modules=$MODULES" >> $GITHUB_OUTPUT
87+
88+
# ---------------------------------------------------------
89+
# Enforce version bumps
90+
# ---------------------------------------------------------
91+
- name: Enforce version bumps
92+
if: steps.changed.outputs.modules != ''
93+
run: |
94+
FAILED=0
95+
BASE="${{ github.base_ref }}"
96+
97+
# Fallback for push events (base_ref is empty)
98+
if [ -z "$BASE" ]; then
99+
BASE="${{ github.ref_name }}"
100+
fi
101+
102+
for DIR in ${{ steps.changed.outputs.modules }}; do
103+
OLD_VER=$(git show origin/$BASE:$DIR/build.gradle 2>/dev/null \
104+
| grep -E "version\s*=" \
105+
| head -1 \
106+
| sed "s/.*=//; s/[\"']//g; s/ //g")
107+
108+
NEW_VER=$(grep -E "version\s*=" $DIR/build.gradle \
109+
| head -1 \
110+
| sed "s/.*=//; s/[\"']//g; s/ //g")
111+
112+
echo "$DIR old=$OLD_VER new=$NEW_VER"
113+
114+
if [ "$OLD_VER" = "$NEW_VER" ]; then
115+
FAILED=1
116+
fi
117+
done
118+
119+
exit $FAILED
120+
121+
# ---------------------------------------------------------
122+
# Build & Test
123+
# ---------------------------------------------------------
124+
- name: Build & Test
125+
run: ./gradlew clean build --no-daemon -Psnapshot=$SNAPSHOT
126+
127+
# ---------------------------------------------------------
128+
# Publish changed OR missing modules
129+
# ---------------------------------------------------------
130+
- name: Publish
131+
if: env.SNAPSHOT == 'true' || env.RELEASE == 'true'
132+
run: ./gradlew publish -Psnapshot=$SNAPSHOT --no-daemon

0 commit comments

Comments
 (0)