Skip to content

Commit 62de2cd

Browse files
Enable SBOM config for GoReleaser (nats-io#6306)
2 parents cee44be + 2b6ec91 commit 62de2cd

File tree

2 files changed

+59
-46
lines changed

2 files changed

+59
-46
lines changed

.goreleaser.yml

Lines changed: 53 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,72 +5,72 @@ release:
55
github:
66
owner: nats-io
77
name: nats-server
8-
name_template: 'Release {{.Tag}}'
8+
name_template: "Release {{.Tag}}"
99
draft: true
1010

1111
changelog:
1212
disable: true
1313

1414
builds:
15-
- main: .
16-
binary: nats-server
17-
flags:
18-
- -trimpath
19-
ldflags:
20-
- -w -X 'github.com/nats-io/nats-server/v2/server.gitCommit={{.ShortCommit}}' -X 'github.com/nats-io/nats-server/v2/server.serverVersion={{.Tag}}'
21-
env:
22-
- GO111MODULE=on
23-
- CGO_ENABLED=0
24-
goos:
25-
- darwin
26-
- linux
27-
- windows
28-
- freebsd
29-
goarch:
30-
- amd64
31-
- arm
32-
- arm64
33-
- 386
34-
- mips64le
35-
- s390x
36-
- ppc64le
37-
goarm:
38-
- 6
39-
- 7
40-
ignore:
41-
- goos: darwin
42-
goarch: 386
43-
- goos: freebsd
44-
goarch: arm
45-
- goos: freebsd
46-
goarch: arm64
47-
- goos: freebsd
48-
goarch: 386
49-
mod_timestamp: "{{ .CommitTimestamp }}"
15+
- main: .
16+
binary: nats-server
17+
flags:
18+
- -trimpath
19+
ldflags:
20+
- -w -X 'github.com/nats-io/nats-server/v2/server.gitCommit={{.ShortCommit}}' -X 'github.com/nats-io/nats-server/v2/server.serverVersion={{.Tag}}'
21+
env:
22+
- GO111MODULE=on
23+
- CGO_ENABLED=0
24+
goos:
25+
- darwin
26+
- linux
27+
- windows
28+
- freebsd
29+
goarch:
30+
- amd64
31+
- arm
32+
- arm64
33+
- 386
34+
- mips64le
35+
- s390x
36+
- ppc64le
37+
goarm:
38+
- 6
39+
- 7
40+
ignore:
41+
- goos: darwin
42+
goarch: 386
43+
- goos: freebsd
44+
goarch: arm
45+
- goos: freebsd
46+
goarch: arm64
47+
- goos: freebsd
48+
goarch: 386
49+
mod_timestamp: "{{ .CommitTimestamp }}"
5050

5151
nfpms:
52-
- file_name_template: '{{.ProjectName}}-{{.Tag}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}'
53-
homepage: https://nats.io
52+
- file_name_template: "{{.ProjectName}}-{{.Tag}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}"
53+
homepage: https://nats.io
5454
description: High-Performance server for NATS, the cloud native messaging system.
5555
maintainer: Ivan Kozlovic <[email protected]>
5656
license: Apache 2.0
5757
vendor: Synadia Inc.
5858
formats:
59-
- deb
60-
- rpm
59+
- deb
60+
- rpm
6161
contents:
62-
- src: /usr/bin/nats-server
63-
dst: /usr/local/bin/nats-server
64-
type: "symlink"
62+
- src: /usr/bin/nats-server
63+
dst: /usr/local/bin/nats-server
64+
type: "symlink"
6565

6666
archives:
67-
- name_template: '{{.ProjectName}}-{{.Tag}}-{{.Os}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}'
67+
- name_template: "{{.ProjectName}}-{{.Tag}}-{{.Os}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}"
6868
wrap_in_directory: true
6969
format: zip
7070
files:
7171
- README.md
7272
- LICENSE
73-
- name_template: '{{.ProjectName}}-{{.Tag}}-{{.Os}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}'
73+
- name_template: "{{.ProjectName}}-{{.Tag}}-{{.Os}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}"
7474
id: targz-archives
7575
wrap_in_directory: true
7676
format: tar.gz
@@ -79,5 +79,12 @@ archives:
7979
- LICENSE
8080

8181
checksum:
82-
name_template: 'SHA256SUMS'
82+
name_template: "SHA256SUMS"
8383
algorithm: sha256
84+
85+
sboms:
86+
- artifacts: binary
87+
documents:
88+
[
89+
"{{.ProjectName}}-{{.Tag}}-{{.Os}}-{{.Arch}}{{if .Arm}}{{.Arm}}{{end}}.sbom.spdx.json",
90+
]

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ jobs:
5252

5353
script: ./scripts/runTestsOnTravis.sh $TEST_SUITE
5454

55+
# Install Syft which is used by GoReleaser in the deploy step.
56+
# Cosign is an optional dependency to verify the Syft binary.
57+
before_deploy:
58+
- curl -o /usr/local/bin/cosign -L https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64 && chmod +x /usr/local/bin/cosign
59+
- curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | COSIGN_BINARY=/usr/local/bin/cosign sh -s -- -v -b /usr/local/bin
60+
5561
deploy:
5662
provider: script
5763
cleanup: true

0 commit comments

Comments
 (0)