Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion modules/oci-publish/01_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,25 @@ $(foreach build_name,$(push_names),$(eval $(call oci_sign_target_per_image,$(bui
## Sign an OCI image.
## If a signature already exists, this will not overwrite it.
## @category [shared] Publish
$(oci_sign_targets):
$(oci_sign_targets):


oci_sbom_upload_targets := $(push_names:%=oci-upload-sbom-%)

.PHONY: $(oci_sbom_upload_targets)
## Upload SPDX SBOM files from oci-build to the current GitHub release.
## @category [shared] Publish
$(oci_sbom_upload_targets): oci-upload-sbom-%: oci-build-% | $(NEEDS_GH)
@layout_path='$(oci_layout_path_$*)'; \
if [ -d "$(CURDIR)/$$layout_path.sbom" ]; then \
tag="$${GITHUB_REF_NAME:-$$(git describe --tags --exact-match 2>/dev/null)}"; \
if [ -z "$$tag" ]; then \
echo "Could not determine release tag (set GITHUB_REF_NAME or run from a tagged commit)"; exit 1; \
fi; \
for f in "$(CURDIR)/$$layout_path.sbom"/*.spdx.json; do \
[ -f "$$f" ] || continue; \
$(GH) release upload "$$tag" "$$f" --clobber; \
done; \
else \
echo "No SBOM directory at $$layout_path.sbom"; exit 1; \
fi