Skip to content

Commit b3bf373

Browse files
committed
generate sbom
1 parent 950e99b commit b3bf373

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

.goreleaser.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ changelog:
2727
exclude:
2828
- '^docs:'
2929
- '^test:'
30+
sboms:
31+
- artifacts: archive

.toolbox.mk

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ TB_GINKGO ?= $(TB_LOCALBIN)/ginkgo
1616
TB_GOLANGCI_LINT ?= $(TB_LOCALBIN)/golangci-lint
1717
TB_GORELEASER ?= $(TB_LOCALBIN)/goreleaser
1818
TB_SEMVER ?= $(TB_LOCALBIN)/semver
19+
TB_SYFT ?= $(TB_LOCALBIN)/syft
1920

2021
## Tool Versions
2122
# renovate: packageName=github.com/golangci/golangci-lint/v2
@@ -27,6 +28,9 @@ TB_GORELEASER_VERSION_NUM ?= $(call STRIP_V,$(TB_GORELEASER_VERSION))
2728
# renovate: packageName=github.com/bakito/semver
2829
TB_SEMVER_VERSION ?= v1.1.7
2930
TB_SEMVER_VERSION_NUM ?= $(call STRIP_V,$(TB_SEMVER_VERSION))
31+
# renovate: packageName=github.com/anchore/syft/cmd/syft
32+
TB_SYFT_VERSION ?= v1.36.0
33+
TB_SYFT_VERSION_NUM ?= $(call STRIP_V,$(TB_SYFT_VERSION))
3034

3135
## Tool Installer
3236
.PHONY: tb.ginkgo
@@ -45,6 +49,10 @@ tb.goreleaser: ## Download goreleaser locally if necessary.
4549
tb.semver: ## Download semver locally if necessary.
4650
@test -s $(TB_SEMVER) && $(TB_SEMVER) -version | grep -q $(TB_SEMVER_VERSION_NUM) || \
4751
GOBIN=$(TB_LOCALBIN) go install github.com/bakito/semver@$(TB_SEMVER_VERSION)
52+
.PHONY: tb.syft
53+
tb.syft: ## Download syft locally if necessary.
54+
@test -s $(TB_SYFT) && $(TB_SYFT) --version | grep -q $(TB_SYFT_VERSION_NUM) || \
55+
GOBIN=$(TB_LOCALBIN) go install github.com/anchore/syft/cmd/syft@$(TB_SYFT_VERSION)
4856

4957
## Reset Tools
5058
.PHONY: tb.reset
@@ -53,13 +61,15 @@ tb.reset:
5361
$(TB_GINKGO) \
5462
$(TB_GOLANGCI_LINT) \
5563
$(TB_GORELEASER) \
56-
$(TB_SEMVER)
64+
$(TB_SEMVER) \
65+
$(TB_SYFT)
5766

5867
## Update Tools
5968
.PHONY: tb.update
6069
tb.update: tb.reset
6170
toolbox makefile --renovate -f $(TB_LOCALDIR)/Makefile \
6271
github.com/golangci/golangci-lint/v2/cmd/golangci-lint?--version \
6372
github.com/goreleaser/goreleaser/v2?--version \
64-
github.com/bakito/semver?-version
73+
github.com/bakito/semver?-version \
74+
github.com/anchore/syft/cmd/syft?--version
6575
## toolbox - end

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ tidy:
1313
test: tb.ginkgo
1414
$(TB_GINKGO) -r --cover --coverprofile=coverage.out
1515

16-
release: tb.goreleaser tb.semver
16+
release: tb.goreleaser tb.semver tb.syft
1717
@version=$$($(TB_SEMVER)); \
1818
git tag -s $$version -m"Release $$version"
19-
$(TB_GORELEASER) --clean
19+
PATH=$(TB_LOCALBIN):$${PATH} $(TB_GORELEASER) --clean
2020

21-
test-release: tb.goreleaser
22-
$(TB_GORELEASER) --skip=publish --snapshot --clean
21+
test-release: tb.goreleaser tb.syft
22+
PATH=$(TB_LOCALBIN):$${PATH} $(TB_GORELEASER) --skip=publish --snapshot --clean

0 commit comments

Comments
 (0)