Skip to content

Commit 06d7264

Browse files
committed
feat: generate sbom on release
1 parent 27322e1 commit 06d7264

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

.goreleaser.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ checksum:
99
snapshot:
1010
version_template: "{{ .Tag }}-next"
1111
changelog:
12+
use: github
1213
sort: asc
1314
filters:
1415
exclude:
1516
- '^docs:'
1617
- '^test:'
18+
- '^chore'
19+
sboms:
20+
- artifacts: archive

.toolbox.mk

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ TB_GORELEASER ?= $(TB_LOCALBIN)/goreleaser
1818
TB_HELM_DOCS ?= $(TB_LOCALBIN)/helm-docs
1919
TB_MOCKGEN ?= $(TB_LOCALBIN)/mockgen
2020
TB_SEMVER ?= $(TB_LOCALBIN)/semver
21+
TB_SYFT ?= $(TB_LOCALBIN)/syft
2122

2223
## Tool Versions
2324
TB_GOLANGCI_LINT_VERSION ?= v2.10.1
@@ -28,6 +29,8 @@ TB_HELM_DOCS_VERSION ?= v1.14.2
2829
TB_MOCKGEN_VERSION ?= v0.6.0
2930
TB_SEMVER_VERSION ?= v1.1.10
3031
TB_SEMVER_VERSION_NUM ?= $(call STRIP_V,$(TB_SEMVER_VERSION))
32+
TB_SYFT_VERSION ?= v1.42.1
33+
TB_SYFT_VERSION_NUM ?= $(call STRIP_V,$(TB_SYFT_VERSION))
3134

3235
## Tool Installer
3336
.PHONY: tb.ginkgo
@@ -54,6 +57,10 @@ tb.mockgen: ## Download mockgen locally if necessary.
5457
tb.semver: ## Download semver locally if necessary.
5558
@test -s $(TB_SEMVER) && $(TB_SEMVER) -version | grep -q $(TB_SEMVER_VERSION_NUM) || \
5659
GOBIN=$(TB_LOCALBIN) go install github.com/bakito/semver@$(TB_SEMVER_VERSION)
60+
.PHONY: tb.syft
61+
tb.syft: ## Download syft locally if necessary.
62+
@test -s $(TB_SYFT) && $(TB_SYFT) --version | grep -q $(TB_SYFT_VERSION_NUM) || \
63+
GOBIN=$(TB_LOCALBIN) go install github.com/anchore/syft/cmd/syft@$(TB_SYFT_VERSION)
5764

5865
## Reset Tools
5966
.PHONY: tb.reset
@@ -64,7 +71,8 @@ tb.reset:
6471
$(TB_GORELEASER) \
6572
$(TB_HELM_DOCS) \
6673
$(TB_MOCKGEN) \
67-
$(TB_SEMVER)
74+
$(TB_SEMVER) \
75+
$(TB_SYFT)
6876

6977
## Update Tools
7078
.PHONY: tb.update
@@ -74,5 +82,6 @@ tb.update: tb.reset
7482
github.com/goreleaser/goreleaser/v2?--version \
7583
github.com/norwoodj/helm-docs/cmd/helm-docs \
7684
go.uber.org/mock/mockgen@github.com/uber/mock \
77-
github.com/bakito/semver?-version
85+
github.com/bakito/semver?-version \
86+
github.com/anchore/syft/cmd/syft?--version
7887
## toolbox - end

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ build-docker:
3535
build-podman:
3636
podman build --build-arg upx_brute=" " -t batch-job-controller .
3737

38-
release: tb.semver tb.goreleaser
38+
release: tb.semver tb.goreleaser tb.syft
3939
@version=$$($(TB_SEMVER)); \
40-
git tag -s $$version -m"Release $$version"
40+
git tag -s $$version -m"Release $$version"; \
41+
git push origin $$version
4142
$(TB_GORELEASER) --clean
4243

43-
test-release: tb.goreleaser
44+
test-release: tb.goreleaser tb.syft
4445
$(TB_GORELEASER) --skip=publish --snapshot --clean
4546

4647
tools: tb.mockgen tb.ginkgo helm

0 commit comments

Comments
 (0)