File tree 4 files changed +65
-0
lines changed
4 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,18 @@ jobs:
172
172
path : javaagent/build/libs/opentelemetry-javaagent-*-SNAPSHOT.jar
173
173
if-no-files-found : ignore
174
174
175
+ - shell : bash
176
+ name : Collect SBOM's
177
+ run : |
178
+ mkdir sboms
179
+ find . -path ./sboms -prune -o -name "*.spdx.json" -exec mv {} ./sboms/ \;
180
+
181
+ - uses : actions/upload-artifact@v4
182
+ name : Save SBOM's to build
183
+ with :
184
+ name : opentelemetry-java-instrumentation-SBOM-${{ matrix.os }}-${{ matrix.test-java-version }}.zip
185
+ path : " sboms/*.json"
186
+
175
187
test :
176
188
name : test${{ matrix.test-partition }} (${{ matrix.test-java-version }}, ${{ matrix.vm }})
177
189
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -109,6 +109,19 @@ jobs:
109
109
arguments : build publishPlugins publishPluginMavenPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
110
110
build-root-directory : gradle-plugins
111
111
112
+ - shell : bash
113
+ name : Collect SBOM's
114
+ run : |
115
+ mkdir sboms
116
+ find . -path ./sboms -prune -o -name "*.spdx.json" -exec mv {} ./sboms/ \;
117
+ zip opentelemetry-java-instrumentation-SBOM.zip sboms/*
118
+
119
+ - uses : actions/upload-artifact@v4
120
+ name : Save SBOM's to build
121
+ with :
122
+ name : opentelemetry-java-instrumentation-SBOM.zip
123
+ path : " sboms/*.json"
124
+
112
125
- name : Generate release notes
113
126
env :
114
127
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -162,6 +175,7 @@ jobs:
162
175
--title "Version $VERSION" \
163
176
--notes-file /tmp/release-notes.txt \
164
177
v$VERSION \
178
+ opentelemetry-java-instrumentation-SBOM.zip \
165
179
opentelemetry-javaagent.jar
166
180
167
181
echo "version=$VERSION" >> $GITHUB_OUTPUT
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ dependencies {
62
62
implementation(" com.gradle.enterprise:com.gradle.enterprise.gradle.plugin:3.17" )
63
63
implementation(" org.owasp:dependency-check-gradle:9.1.0" )
64
64
implementation(" ru.vyarus:gradle-animalsniffer-plugin:1.7.1" )
65
+ implementation(" org.spdx:spdx-gradle-plugin:0.5.0" )
65
66
// When updating, also update dependencyManagement/build.gradle.kts
66
67
implementation(" net.bytebuddy:byte-buddy-gradle-plugin:1.14.13" )
67
68
implementation(" gradle.plugin.io.morethan.jmhreport:gradle-jmh-report:0.9.0" )
Original file line number Diff line number Diff line change 1
1
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2
2
import com.github.jk1.license.filter.LicenseBundleNormalizer
3
3
import com.github.jk1.license.render.InventoryMarkdownReportRenderer
4
+ import java.util.*
4
5
5
6
plugins {
6
7
id(" com.github.jk1.dependency-license-report" )
7
8
8
9
id(" otel.java-conventions" )
9
10
id(" otel.publish-conventions" )
10
11
id(" io.opentelemetry.instrumentation.javaagent-shadowing" )
12
+ id(" org.spdx.sbom" )
11
13
}
12
14
13
15
description = " OpenTelemetry Javaagent"
@@ -271,6 +273,42 @@ with(components["java"] as AdhocComponentWithVariants) {
271
273
}
272
274
}
273
275
276
+ spdxSbom {
277
+ targets {
278
+ // Create a target to match the published jar name.
279
+ // This is used for the task name (spdxSbomFor<SbomName>)
280
+ // and output file (<sbomName>.spdx.json).
281
+ create(" opentelemetry-java_opentelemetry-javaagent" ) {
282
+ configurations.set(listOf (" baseJavaagentLibs" ))
283
+ scm {
284
+ uri.set(" https://github.com/" + System .getenv(" GITHUB_REPOSITORY" ))
285
+ revision.set(System .getenv(" GITHUB_SHA" ))
286
+ }
287
+ document {
288
+ name.set(" opentelemetry-java_opentelemetry-javaagent" )
289
+ namespace.set(" https://opentelemetry.io/spdx/" + UUID .randomUUID())
290
+ }
291
+ }
292
+ }
293
+ }
294
+ tasks.named(" check" ) {
295
+ dependsOn(" spdxSbom" )
296
+ }
297
+ tasks.named(" assemble" ) {
298
+ dependsOn(" spdxSbom" )
299
+ }
300
+ tasks.withType<AbstractPublishToMaven > {
301
+ dependsOn(" spdxSbom" )
302
+ }
303
+ project.afterEvaluate {
304
+ tasks.withType<PublishToMavenLocal >().configureEach {
305
+ this .getPublication().artifact(" ${layout.buildDirectory.get()} /spdx/opentelemetry-java_opentelemetry-javaagent.spdx.json" ) {
306
+ classifier = " spdx"
307
+ extension = " json"
308
+ }
309
+ }
310
+ }
311
+
274
312
licenseReport {
275
313
outputDir = rootProject.file(" licenses" ).absolutePath
276
314
You can’t perform that action at this time.
0 commit comments