From a4893b964b45eae012ea0ddbfdb7dbb2cbdf7ff6 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 10 Apr 2023 09:54:02 +0200 Subject: [PATCH] Upload sbom as release artifact Uploads xml/json to sourceforge and to Githu releases --- .ci/build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.ci/build.sh b/.ci/build.sh index 5f4d321698..2479f35e82 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -179,6 +179,11 @@ function pmd_ci_deploy_build_artifacts() { # Deploy to sourceforge files https://sourceforge.net/projects/pmd/files/pmd/ pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-bin-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-src-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" + # Deploy SBOM + cp pmd-dist/target/bom.xml "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml" + cp pmd-dist/target/bom.json "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json" + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml" + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json" if pmd_ci_maven_isReleaseBuild; then # create a draft github release @@ -188,6 +193,9 @@ function pmd_ci_deploy_build_artifacts() { # Deploy to github releases pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-bin-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-src-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" + # Deploy SBOM + pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml" + pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json" fi }