Skip to content

Commit 1d136b8

Browse files
Merge pull request #43 from OneLiteFeatherNET/feature/cycloneDX
feature: add cyclonedx usage and bom publishing
1 parent a39b1df commit 1d136b8

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

.github/workflows/publish.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,23 @@ jobs:
2121
- name: Build with Gradle
2222
run: ./gradlew build
2323
- name: Publish to Maven
24-
run: ./gradlew publish
24+
run: ./gradlew publish
25+
- name: Generate CycloneDX BOM
26+
run: ./gradlew cyclonedxBom
27+
- name: Strip leading v from tag
28+
if: startsWith(github.ref, 'refs/tags/')
29+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
30+
- run: |
31+
echo "Version: $VERSION"
32+
name: Display Version
33+
- name: Upload BOM to Dependency-Track
34+
uses: DependencyTrack/gh-upload-sbom@v3
35+
with:
36+
serverhostname: ${{ secrets.DEPENDENCYTRACK_HOSTNAME }}
37+
apikey: ${{ secrets.DEPENDENCYTRACK_APIKEY }}
38+
projectname: "Vulpes Base"
39+
projectversion: ${{ env.VERSION }}
40+
projecttags: 'java,minestom'
41+
bomfilename: "build/reports/cyclonedx/bom.xml"
42+
autocreate: true
43+
parent: 'b82ab979-123b-4b6a-a9db-494ab852eebb'

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
`java-library`
44
`maven-publish`
55
alias(libs.plugins.shadow)
6+
alias(libs.plugins.cyclonedx)
67
}
78

89
group = "net.onelitefeather"

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencyResolutionManagement {
2626
version("shadow", "9.3.0")
2727
version("bom", "1.6.0")
2828
version("worldSeed", "11.5.5")
29+
version("cyclonedx", "3.0.1")
2930

3031
library("mycelium.bom", "net.onelitefeather", "mycelium-bom").versionRef("bom")
3132
library("minestom", "net.minestom", "minestom").withoutVersion()
@@ -39,6 +40,7 @@ dependencyResolutionManagement {
3940
library("worldSeed", "net.worldseed.multipart", "WorldSeedEntityEngine").versionRef("worldSeed")
4041

4142
plugin("shadow", "com.gradleup.shadow").versionRef("shadow")
43+
plugin("cyclonedx", "org.cyclonedx.bom").versionRef("cyclonedx")
4244
}
4345
}
4446
}

0 commit comments

Comments
 (0)