Skip to content

Commit bc4f139

Browse files
committed
Merge branch 'build/determine-version-via-current-tag'
2 parents 6a1cb40 + e82dfb7 commit bc4f139

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/publish.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v3
1414

15+
- name: Set SBOM-Builder version by tag
16+
run: |
17+
mkdir dist
18+
sed -e "s/0.0.0-development-version/${GITHUB_REF/refs\/tags\/v}/g" cmake/sbom.cmake > dist/sbom.cmake
19+
1520
- name: Upload sbom.cmake to release
1621
uses: svenstaro/upload-release-action@v1-release
1722
with:
1823
repo_token: ${{ secrets.GITHUB_TOKEN }}
1924
tag: ${{ github.ref }}
20-
file: cmake/sbom.cmake
25+
file: dist/sbom.cmake
2126
file_glob: true
2227
overwrite: true

cmake/sbom.cmake

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ include(GNUInstallDirs)
99

1010
find_package(Git)
1111

12+
set(SBOM_BUILDER_VERSION "0.0.0-development-version" CACHE STRING "CMake-SBOM-Builder version")
13+
14+
if(SBOM_BUILDER_VERSION MATCHES "development-version")
15+
message( WARNING "Your project is using an unstable development version of CMake-SBOM-Builder. \
16+
Consider switching to a stable release. https://github.com/sodgeit/CMake-SBOM-Builder" )
17+
endif()
18+
1219
function(version_show)
1320
message(STATUS "${PROJECT_NAME} version is ${GIT_VERSION}")
1421
endfunction()
@@ -467,7 +474,7 @@ SPDXID: SPDXRef-DOCUMENT
467474
DocumentName: ${doc_name}
468475
DocumentNamespace: ${SBOM_GENERATE_NAMESPACE}
469476
Creator: Organization: ${SBOM_GENERATE_SUPPLIER}
470-
Creator: Tool: cmake-sbom
477+
Creator: Tool: CMake-SBOM-Builder-${SBOM_BUILDER_VERSION}
471478
CreatorComment: <text>This SPDX document was created from CMake ${CMAKE_VERSION}, using CMake-SBOM-Builder from https://github.com/sodgeit/CMake-SBOM-Builder</text>
472479
Created: ${NOW_UTC}\${SBOM_EXT_DOCS}
473480

0 commit comments

Comments
 (0)